View previous topic :: View next topic
|
Author |
Message |
Satheeshkumar
New User
Joined: 20 Feb 2009 Posts: 51 Location: Chennai
|
|
|
|
My requirement is to check the existance of dataset which includes the symbolic parameter in the name of the DSN., as
QWERTY.MMMMM.MYFILE.RS&GL0067
in the above 'GL0067' is cycle date, which i am passing through JCL
//SET GL0067=100701
//STEP01 EXEC PGM=IDCAMS
//SYSOUT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRY (QWERTY.MMMMM.MYFILE.RS&GL0067)
/*
can you please tell me how to pass value to sympolic parameter in sysin |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You can't do it as such.
You can use a REXX exec to invoke the IDCAMS after symbolic substitution.
Might have a copy of the code, if I do, I'll post it. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
The JCL
Code: |
//STEP0020 EXEC PGM=IKJEFT01,PARM='DSNCHECK &SYSUID..REXX'
//SYSEXEC DD DSN=Your_REXX_Library,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY |
The REXX - In member DSNCHECK in Your_REXX_Library
Code: |
/* REXX *** TAKE DATASET NAME FROM PARM AND CHECK IF IT EXISTS */
ARG DSNAME .
" LISTCAT ENT('"STRIP(DSNAME)"')"
EXIT RC |
Gives RC=0 if the dataset exists, RC=4 if not. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Hey, I've even upgraded it to check if the file is empty or not.
Now this question will never ever be asked again on the forum,
because everyone uses the search button ........................... right
RC=0 if exists and populated, RC=4 if exists and empty, RC=8 if does not exist.
Code: |
/* REXX *** TAKE DATASET NAME FROM PARM AND CHECK IF IT EXISTS
AND IF IT EXISTS IS IT POPULATED */
ARG DSNAME .
" LISTCAT ENT('"STRIP(DSNAME)"')"
IF RC <> 0
THEN EXIT (8)
ELSE " PRINT IDS('"STRIP(DSNAME)"') COUNT(1)"
IF RC = 0
THEN EXIT
ELSE EXIT (4) |
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
expat wrote: |
Now this question will never ever be asked again on the forum, because everyone uses the search button ........................... right |
oh almighty, only if expat were true! |
|
Back to top |
|
|
|