Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How can we set Return based of files count

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How can we set Return based of files count
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: 1521
Location: Chennai

PostPosted: Fri Oct 17, 2014 5:40 pm    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Oct 17, 2014 5:49 pm    Post subject: Reply to: How can we set Return based of files count
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    Post subject: Reply to: How can we set Return based of files count
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: 8593
Location: Back in jolly old England

PostPosted: Fri Oct 17, 2014 5:57 pm    Post subject:
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: 1521
Location: Chennai

PostPosted: Fri Oct 17, 2014 6:33 pm    Post subject:
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    Post subject: Reply to: How can we set Return based of files count
Reply with quote

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

Senior Member


Joined: 21 Sep 2010
Posts: 1788
Location: NY,USA

PostPosted: Fri Oct 17, 2014 8:20 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Comparing 2 Files using Current time arunsoods DFSORT/ICETOOL 5 Fri Sep 22, 2017 6:00 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us