IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How can we set Return based of files count


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Fri Oct 17, 2014 4:53 pm
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1689
Location: Tiruppur, India

PostPosted: Fri Oct 17, 2014 5:40 pm
Reply with quote

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
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Fri Oct 17, 2014 5:45 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Fri Oct 17, 2014 5:49 pm
Reply with quote

Did you locate any of the multiple discussions of this here? Or is it OK if vasanthz does that for you?
Back to top
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Fri Oct 17, 2014 5:52 pm
Reply with quote

Hi,
Multiple suggestion are good
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8794
Location: Welsh Wales

PostPosted: Fri Oct 17, 2014 5:57 pm
Reply with quote

Is this perhaps in relation to your other current topic,
comparing two files ................ icon_eek.gif
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1689
Location: Tiruppur, India

PostPosted: Fri Oct 17, 2014 6:33 pm
Reply with quote

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
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Fri Oct 17, 2014 6:34 pm
Reply with quote

Thank you vasanthz
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2590
Location: NYC,USA

PostPosted: Fri Oct 17, 2014 8:20 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare the file record count percent... DFSORT/ICETOOL 4
No new posts Record count of RECFM=U tape file DFSORT/ICETOOL 17
This topic is locked: you cannot edit posts or make replies. Is there a way to restrict user login... All Other Mainframe Topics 11
No new posts REMOVE DUPLICATE RECORDS BASED ON A S... DFSORT/ICETOOL 4
No new posts Using sort on VB records based on off... DFSORT/ICETOOL 6
Search our Forums:

Back to Top