INVOKE REXX TO BATCH JOB



IBM's Command List programming language & Restructured Extended Executor

INVOKE REXX TO BATCH JOB

Postby Sah_97 » Thu Jun 13, 2024 2:12 pm

Hi every one i want to know how to how execute a REXX program in a JCL. This REXX uses ISPF and TSO services:
i write a rexx to save dataset list that statred with ucat and show their extendas and tracks of all of them and save it in a outpout dataset but when i run this via a jcl it retuned rc=0 but doesnt creat output .

**actually i want to list all dataset started with ucat* in a ps file and retrieve their extents and tracks and report the datasets that their xt is upper than 80 via batch job.

here is my rexx :
/* REXX */
/**********************************************************************/
LEVEL = "UCAT.*"
VOL =""
STATS ="YES"
GROUP = "REPORT"
SAVEDS = GROUP".DATASETS"
DSVAR =""
STATUS ="YES"
/* LMDINIT */
ADDRESS ISPEXEC "LMDINIT LISTID(LISTIDV) LEVEL("LEVEL") VOLUME("VOL")"

DO UNTIL RC<> 0
ADDRESS ISPEXEC "LMDLIST LISTID("LISTIDV") OPTION("SAVETYPE")",
"STATS("STATS") GROUP("GROUP") STATUS("STATUS")"

/* LMDFREE TO FREE UP THE DSLIST_ID ASSOCIATION */
ADDRESS ISPEXEC "LMDFREE LISTID("LISTIDV")"

IF GROUP <> "" THEN
ADDRESS ISPEXEC "EDIT DATASET("SAVEDS")"
EXIT

and my jcl code is attached.
You do not have the required permissions to view the files attached to this post.
Sah_97
 
Posts: 3
Joined: Tue May 28, 2024 8:55 pm
Has thanked: 1 time
Been thanked: 0 time

Re: INVOKE REXX TO BATCH JOB

Postby Pedro » Sat Jun 15, 2024 10:03 am

You did not provide the actual JCL. From your screenshot, it looks like the rexx is able to run, but the ISPF is not. The ISPF product data sets should be included in the JCL in various DD statements.

re: ADDRESS ISPEXEC "EDIT DATASET("SAVEDS")"

This will not work in a batch job as the editor is normally and interactive process and 'interactive' is not available in batch. Your exec should check if the environment is batch or not and only EDIT if not batch.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: INVOKE REXX TO BATCH JOB

Postby prino » Sun Jun 16, 2024 12:38 am

Pedro wrote:re: ADDRESS ISPEXEC "EDIT DATASET("SAVEDS")"

This will not work in a batch job as the editor is normally and interactive process and 'interactive' is not available in batch. Your exec should check if the environment is batch or not and only EDIT if not batch.

You will need to invoke the editor with an edit macro, i.e.
ADDRESS ISPEXEC "EDIT DATASET("SAVEDS") macro(whatever)"

that ends the edit session (if in batch).
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post