View previous topic :: View next topic
|
Author |
Message |
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
Hi ,
I have to datasets.How can we compare the records count and set the return code for the jcls?
if both count are equal set rc =0
else
it would be RC = 1 |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello,
Is it ok, if the RC is set as 4 instead of RC=1 when the record counts don't match?
One more thing, what SORT product do you have at your shop? |
|
Back to top |
|
|
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
vasanthz wrote: |
Hello,
Is it ok, if the RC is set as 4 instead of RC=1 when the record counts don't match? |
ya ..It is fine |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Did you locate any of the multiple discussions of this here? Or is it OK if vasanthz does that for you? |
|
Back to top |
|
|
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
Hi,
Multiple suggestion are good |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Is this perhaps in relation to your other current topic,
comparing two files ................ |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello,
I would leave this here, if something is wrong in the approach, feel free to delete
Diwali fever starts...!!
sets RC=1 if there is mismatch,
sets RC=0 if counts match.
Code: |
//STEP0010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//FILE1 DD DISP=SHR,DSN=file1.here
//FILE2 DD DISP=SHR,DSN=file2.here
//TOOLIN DD *
COUNT FROM(FILE1) WRITE(COUNT) DIGITS(8) WIDTH(80)
COUNT FROM(FILE2) WRITE(COUNT) DIGITS(8) WIDTH(80)
SELECT FROM(COUNT) TO(NODUP) ON(1,8,CH) NODUPS
/*
//COUNT DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,1),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//NODUP DD DSN=&&TEMP2,DISP=(,PASS),SPACE=(TRK,1),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//******************************************************
//STEP0020 EXEC PGM=IDCAMS
//NODUP DD DSN=&&TEMP2,DISP=(OLD,PASS)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PRINT INFILE(NODUP) COUNT(1)
IF LASTCC EQ 4 THEN SET MAXCC=0
IF LASTCC EQ 0 THEN SET MAXCC=1
/* |
|
|
Back to top |
|
|
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
Thank you vasanthz |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Quote: |
Hi,
Multiple suggestion are good |
Saravanan, There many similar topics/suggestions on the same question already, what all we need to do it just modify accordingly.
Also you can also use a JOINKEYS where you use a sequence number to add for every records in both the files and then sum up to match the nubmer and use NULLOFL to SET the RC. |
|
Back to top |
|
|
|