hello every one .
i have a question i write a rexx to save all dataset start with (ucat ) means ucat* and retrieved informaiton (Tracks, %Used,XT,) and if their XT is larger than 16 save them in output file.
i write a pgm to do that when execute it it woprks but when run it by jcl is returned max-rc 0 but didnt work and dont allocate empty output file :
here is my code :
rexx:
/* REXX */
TRACE OFF
"DELSTACK"
CNT=0
I=0
X=1
USEDSN="'DBKISA3.REP.OUT'"
B='DBKISA3.*'
CALL ALLOCATE_TEMP_DATASET
"ISPEXEC LMDLIST LISTID("NJF") OPTION(FREE)"
"ISPEXEC LMDINIT LISTID("NJF") LEVEL(&B)"
/*
IF RC=0 THEN DO
SAY "* UCAT.TS2TSO * 50 * * * "
SAY "**********************************************************************",
"***********************************************************"
SAY "* DSNAME * EXT_NO * CR_DATE * VOLSER * TRACKS ",
"* USED * REF_DATE * DEF_EXT * EXECUTE_PROGRAM *"
SAY "**********************************************************************" ,
"***********************************************************"
/*
SAY '*****************************************************************'
SAY '* DSNAME * NUMBER OF EXTENTS *'
SAY '*****************************************************************'
*/
END */
DO FOREVER
"ISPEXEC LMDLIST LISTID("NJF") STATS(YES) OPTION(LIST) DATASET(DSVAR)"
IF RC = 0 THEN
DO
QUEUE'* '||LEFT(DSVAR,20)||'* '||LEFT(ZDLEXTX,10)||'* '||LEFT(ZDLCDATE,10),
||'* '||LEFT(ZDLVOL,11)||'* '||LEFT(ZDLSIZE,11)||'* '||LEFT(ZDLUSED,11)||'* ',
||LEFT(ZDLRDATE,10)||'* '||LEFT(DATE(S)||'_'TIME(N),20)
/* SAY'* 'ZDLCDATE
SAY'* 'ZDLVOL
SAY'* 'ZDLSIZE
SAY'* 'ZDLUSED
SAY'* 'ZDLRDATE */
END
ELSE LEAVE
END
TRACE OFF
"ALLOC F(OUT1) DA("USEDSN") MOD REUSE"
"EXECIO * DISKW OUT1 ( FINIS "
"FREE FI(OUT1)"
SAY'****************************'
SAY'* TEMPDS.REPORT UPDATED. *'
SAY'****************************'
/********************************************************************/
/* ALLOCATING TEMP SHARE TEMP DATASETS */
/********************************************************************/
ALLOCATE_TEMP_DATASET:
X=MSG(OFF)
ADDRESS TSO
CREAT_TEMPDS= "ALLOC DSNAME("||USEDSN||") NEW REUSE UNIT(SYSDA)
DSORG(PS) RECFM(F,B) LRECL(140) BLKSIZE(1400) SPACE(15,15) CYL"
ALLOC_OUTPUT_FILE ="ALLOC DD(DATA) DA("||USEDSN||") SHR REUSE"
FREEDSN="FREE DSNAME("||USEDSN||")"
ALLOC_OUTPUT_FILE
IF RC<>0 THEN DO
CREAT_TEMPDS
IF RC<>0 THEN SAY "CREATING INFORMATION DATASET FAILED"
ALLOC_OUTPUT_FILE
PUSH "* DSNAME * EXT_NO * CR_DATE * VOLSER * TRACKS ",
"* USED * REF_DATE * EXECUTE_PROGRAM_DATE *"
"EXECIO * DISKW DATA (FINIS"
"FREE DD(DATA)"
FREEDSN="FREE DSNAME("||USEDSN||")"
FREEDSN
END
FREEDSN
RETURN
my jcl :
//TSOTEST JOB CLASS=A,MSGCLASS=X
//STEP10 EXEC PGM=IKJEFT01,REGION=0M,DYNAMNBR=30,
// PARM='LIST3'
//SYSEXEC DD DSN=DBKISA3.JCLS,DISP=SHR
//SYSTSIN DD DUMMY
//SYSTSPRT DD SYSOUT=*
REXX to save all dataset start with (ucat)
- MrSpock
- Global moderator
- Posts: 809
- Joined: Wed Jun 06, 2007 9:37 pm
- Skillset: REXX, JCL, DFSORT, Syncsort, Axway MFT, Connect:Direct, FTP, SFTP
- Referer: ibmmainframes.com
- Location: Raleigh NC USA
- Contact:
Re: rexxquestion
Right off, part of the problem I see is that you're using ISPF services (ISPEXEC) but nowhere in your JCL have you setup and started an ISPF environment.
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: rexxquestion
As pointed out by MrSpock, you are using ISPF services, but your JCL do not allocate required ISPF dataset, nor does your parm specify ISPSTART CMD(name).
Something else, it looks like you are missing a RETURN before the ALLOCATE_TEMP_DATASET: label, so I will expect your temp ds to reallocated when you do not expect it.
Last, but certainly not least, please use the CODE tags, your program is rather hard to read due to lack of indentation.
Something else, it looks like you are missing a RETURN before the ALLOCATE_TEMP_DATASET: label, so I will expect your temp ds to reallocated when you do not expect it.
Last, but certainly not least, please use the CODE tags, your program is rather hard to read due to lack of indentation.
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: rexxquestion
Sample JCL
I admit that I am not very fond of the expression "ISPEXEC ....". I much prefer either
or
Code: Select all
//ISP EXEC PGM=IKJEFT1B,PARM='ISPSTART CMD(XXXX) TEST'
//SYSEXEC DD DISP=SHR,DSN=your.local.exec
//SYSTSPRT DD SYSOUT=*
//ISPMLIB DD DISP=SHR,DSN=ISP.SISPMENU
//ISPPLIB DD DISP=SHR,DSN=ISP.SISPPENU
//ISPSLIB DD DISP=SHR,DSN=ISP.SISPSENU
//ISPTLIB DD DISP=SHR,DSN=ISP.SISPTENU
//ISPPROF DD UNIT=SYSDA,SPACE=(TRK,(5,5,4)),RECFM=FB,LRECL=80
//ISPLOG DD SYSOUT=*,RECFM=VA,LRECL=125,BLKSIZE=129
//ISPFILE DD SYSOUT=*,RECFM=FB,LRECL=80,BLKSIZE=6240
//SYSTSIN DD *
I admit that I am not very fond of the expression "ISPEXEC ....". I much prefer either
Code: Select all
address IspExec
"ispf command ...."
or
Code: Select all
address IspExec "ispf command ...."