Hi all,
I need to code a JCL so that the First step checks a VSAM File . If its empty , the second step is skipped. If its having records then the next step should be executed.
In either case , the first step should return ZERO return code.
Please help me if this is possible.
Thanks
Shanti
To check VSAM File if its empty or not with zero ReturnCODE
-
- Posts: 1
- Joined: Tue Jan 22, 2008 10:45 pm
- Skillset: Mainframe,COBOL, JCL, REXX
- Referer: Through colleague
- 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: To check VSAM File if its empty or not with zero ReturnCODE
You can use:
or
or
However, I don't get this statement
It's either going to have to give an RC=0 if it's empty, and a non-zero RC if it's not, or vice-versa. Both conditions can't result in the same RC.
Code: Select all
//STEPXXXX EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=VSAM...
//TOOLIN DD DATA
COUNT FROM(IN) EMPTY
/*
or
Code: Select all
//STEPXXXX EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=VSAM...
//TOOLIN DD DATA
COUNT FROM(IN) NOTEMPTY
/*
or
Code: Select all
//STEPXXXX EXEC PGM=IDCAMS
//IN DD DSN=VSAM..
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PRINT INFILE(IN) COUNT(1)
/*
However, I don't get this statement
In either case , the first step should return ZERO return code.
It's either going to have to give an RC=0 if it's empty, and a non-zero RC if it's not, or vice-versa. Both conditions can't result in the same RC.
-
- Posts: 110
- Joined: Thu Dec 27, 2007 5:18 pm
- Skillset: Known little stuffs to answer a few queries!!
- Referer: Google
- Contact:
Re: To check VSAM File if its empty or not with zero ReturnCODE
Shanti,
Based on the return code of STEP01 only you can decide whether to run STEP02 or NOT.
You can NOT make a decision with same RC for both the cases.
Could you please clarify on why do you specifically want to have RC=0 for STEP01?
Arun.
Based on the return code of STEP01 only you can decide whether to run STEP02 or NOT.
You can NOT make a decision with same RC for both the cases.
Could you please clarify on why do you specifically want to have RC=0 for STEP01?
Arun.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Need to check whether file is ESDS file or not by using REXX
by Devrana » Sat Oct 05, 2024 2:28 pm » in CLIST & REXX - 6
- 3178
-
by sergeyken
View the latest post
Tue Oct 08, 2024 5:25 pm
-
-
- 2
- 1446
-
by naga821
View the latest post
Fri Oct 28, 2022 7:31 pm
-
-
How to import a ZFS data file into VSAM catalog
by danik56 » Tue Nov 23, 2021 10:29 pm » in VSAM/SMS - 0
- 3405
-
by danik56
View the latest post
Tue Nov 23, 2021 10:29 pm
-
-
- 0
- 3491
-
by zeller56
View the latest post
Sun Oct 01, 2023 1:50 am
-
- 10
- 4229
-
by chillmo
View the latest post
Thu Mar 13, 2025 12:01 am