/* REXX */
/*
 *
 * %Z%%W% %I%
 *
 * =========================================================================
 * Licensed Materials - Property of IBM
 * "Restricted Materials of IBM"
 * (C) Copyright IBM Corp. 2005, 2011. All Rights Reserved
 * 
 * DISCLAIMER: 
 * The following [enclosed] code is sample code created by IBM 
 * Corporation.  This sample code is not part of any standard IBM product 
 * and is provided to you solely for the purpose of assisting you in the 
 * development of your applications.  The code is provided 'AS IS', 
 * without warranty of any kind.  IBM shall not be liable for any damages 
 * arising out of your use of the sample code, even if they have been 
 * advised of the possibility of such damages.
 * =========================================================================
 *
 * Sample JZOS rexx script which executes the TSO STATUS command for the MVS job given
 * its jobname and (optionally) jobid as arguments. The output from the STATUS
 * command is written to stdout.
 *
 */

parse arg jobname jobid

if jobid <> '' then
  do
    jobname = jobname'('jobid')'
  end

call rexxopt 'notsoin'
address tso "STATUS" jobname
address tso LOGOFF
exit 0
