Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 72
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: 1445
Location: Azeroth

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: 72
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: 7236

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: 72
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: 1445
Location: Azeroth

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: 72
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: 1610
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts DFHWS2LS return value divated CICS 4 Mon Nov 07, 2016 5:44 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us