View previous topic :: View next topic |
Author |
Message |
tattva Beginner
Joined: 02 Feb 2005 Posts: 97 Topics: 36
|
Posted: Wed May 18, 2005 2:49 pm Post subject: Set Return code depending on the no: of records in a Dataset |
|
|
Hi all,
I need to create a REXX which will be embedded inside a jCL. The functionality is :-
1) The Jcl will have a input dataset.
2) REXX utility will have to count the number of lines in the dataset.
3) If the number of lines is in between range(say btw 30 and 100 ),then should the return code to 04)
4) This return code should be the return code of the JCL.
can any one of you let me know if this possible..
Thanks,
Tattva |
|
Back to top |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Wed May 18, 2005 2:58 pm Post subject: |
|
|
Sure.
Read the first 100 records into a stem variable.
If the value of the stem variable index is > 30 or < 100, exit with rc=4, else exit with rc=0.
Code: |
/* REXX */
"EXECIO 100 DISKR indd (STEM rec. FINIS"
If (rec.0 > 30 & rec.0 < 100) Then Exit 4
Else Exit 0
|
|
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed May 18, 2005 3:11 pm Post subject: |
|
|
Tattva,
You have been on this site for a while and by now you should be able to follow the rules of this forum.
Use meaningful topics (don't use the Forum name for the topic). Avoid putting "urgent" in your topics.
As I mentioned earlier , people on this website share their knowledge voluntarily and you are not doing any good to extract answers from them.
keep in mind that if you repeat the same mistake once again , I will delete the posts as well as you will loose the privileges to post on this board.
Thanks
Kolusu
PS: I am editing the title to reflect the requirement. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
tattva Beginner
Joined: 02 Feb 2005 Posts: 97 Topics: 36
|
Posted: Wed May 18, 2005 3:24 pm Post subject: |
|
|
Sorry about that !!! Kolusu!!
Thanks,
Tattva |
|
Back to top |
|
 |
dtf Beginner
Joined: 10 Dec 2004 Posts: 110 Topics: 8 Location: Colorado USA
|
Posted: Wed May 18, 2005 3:37 pm Post subject: |
|
|
Assuming the file could be either VSAM or QSAM, and this is not known until runtime, is there still a REXX solution?
________
AMC Ambassador history
Last edited by dtf on Tue Feb 01, 2011 1:54 pm; edited 1 time in total |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed May 18, 2005 4:47 pm Post subject: |
|
|
Quote: | Assuming the file could be either VSAM or QSAM, and this is not known until runtime, is there still a REXX solution? |
DTF,
yes you can . Actually you do not need rexx to set the return code. You can use IDCAMS RERO with skip and count parms or Print parm to check the number of records
Code: |
//*********************************************************************
//* SETS RC=0000 IF DATASET HAS AT LEAST 15 RECORDS *
//* SETS RC=0004 IF DATASET HAS LESS THAN 15 RECORDS *
//* SETS RC=0012 IF DATASET HAS ZERO RECORDS *
//*********************************************************************
//STEP0100 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INPUT DD DSN=YOUR INPUT FILE,
// DISP=SHR
//OUT DD DUMMY
//SYSIN DD *
REPRO IFILE(INPUT) OFILE(OUT) SKIP(14) COUNT(1)
/*
|
Check this link which discusses about handling empty files.
http://www.mvsforums.com/helpboards/viewtopic.php?t=1285&highlight=empty
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
acevedo Beginner

Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Tue May 24, 2005 9:46 am Post subject: |
|
|
Of course Kolusu solution is pefect but my doubt is about the original question:
I need to create a REXX ...
why? this could be done as well in Cobol, Pl1, assembler, easytrieve... why Rexx? |
|
Back to top |
|
 |
|
|