Hi I am able to list the PDS and write it to a file when executing a REXX through TSO command. It worked fine.
But when i tried to write a batch job i am receving RC = 20 in the below line
Code:
"ISPEXEC LMDINIT LISTID("IDV") LEVEL("DS")"
This is my REXX program
Code:
/*REXX*/
/************ GET THE LIST OF CMN PDS ********/
ARG DATASET
DS = DATASET
SAY 'DATASET:' DS
ADDRESS TSO
"ISPEXEC LMDINIT LISTID("IDV") LEVEL("DS")"
SAY RC
IX = 0
DO FOREVER
"ISPEXEC LMDLIST LISTID("IDV") OPTION(LIST) DATASET(DSVAR)"
IF RC <> 0 THEN DO
"ISPEXEC LMDLIST LISTID("IDV") OPTION(FREE)"
LEAVE
END
.....
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
Yes - you missed a [/code] and obviously the Preview button is missing from your editor.
Also, when invoking IKJEFT01 it is normal to provide SYSTSIN to let it know what it should be doing.
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
You appear to be passing the namme of the Rexx script to background TSO via the PARM parameter. This is entirely acceptable when using TSO only; when using ISPF, however, you should use a SYSTSIN DD, as Mr. Clouston has said, and invoke ISPF via ISPSTART CMD(scriptname).
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
You don't have your site's system ISPF messages library concatenated to ISPMLIB. ISPV010 is a standard system message usually stored in the site ISPF message library.
/*REXX*/
/************ GET THE LIST OF CMN PDS ********/
ARG DATASET
DS = DATASET
SAY 'DATASET:' DS
ADDRESS TSO
"ISPEXEC LMDINIT LISTID("IDV") LEVEL("DS")"
SAY RC
IX = 0
DO FOREVER
"ISPEXEC LMDLIST LISTID("IDV") OPTION(LIST) DATASET(DSVAR)"
IF RC <> 0 THEN DO
"ISPEXEC LMDLIST LISTID("IDV") OPTION(FREE)"
LEAVE
END
IX = IX + 1
WORK.IX = DSVAR
SAY "DSVAR:" DSVAR
IF (SUBSTR(WORK.IX,23,1) = ' ') & ,
(SUBSTR(WORK.IX,19,1) <> ' ') THEN
QUEUE SUBSTR(DSVAR,10,4) SUBSTR(DSVAR,15,3) WORK.IX
SAY WORK.IX
END
ADDRESS TSO
"EXECIO" QUEUED() "DISKW FILEOUT ( FINIS"
"FREE F(FILEOUT)"
SAY 'RC:'RC
ADDRESS TSO "DELSTACK"
EXIT
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
If your shop has a standard ISPF proc, I suggest that you use it, so as to avoid the problems noted by Mr. Sample and Sr. Vera. If you do so, I think that you will find no further problems with your script.
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
I noticed you use a stem variable, as if you are going to use the STEM form of the EXECIO command. But instead, you use the form that gets its data from the stack.
I do not think you need to use a stem variable:
Code:
IX = IX + 1
WORK.IX = DSVAR
And other places. Instead, use DSVAR where you use WORK.IX
Your code will work regardless, except if you have an extremely large number of members. In that case, you will have a copy of the data in the stem, as well as a copy QUEUE'd up, plus a copy that ISPF maintains via LMDLIST. You may encounter storage exhausted problems.
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
IIRC, this is because you did add the ISPLOG DD to the JCL; ISPF warns you that it wished to allocate the data set dynamically. Remove the DD, and the message should go away.
But if i remove ISPLOG i am receving the below message
Code:
ISPF system data set allocation error - press Enter to continue.
Log file allocation error - ISPF will operate without a log data set.
Data set 'MYRACFID.SPFLOG1.LIST' in use by another user, try later.