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
 

 

Syncsort RC not 0 If Not in Order!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
fredrick andrews

New User


Joined: 10 Jun 2010
Posts: 52
Location: chennai

PostPosted: Mon Mar 14, 2011 1:23 am    Post subject: Syncsort RC not 0 If Not in Order!
Reply with quote

I have a requirement where I will have to set a Return code of 0, If there is orderliness * in the records and any other Return code (4,8,...) if they are not properly ordered.

Input File: ( FB / 50 )

Code:

11111
aaaaa
bbbbb     }-> dups
bbbbb     }  follow immediately
bbbbb     }  follow immediately
ccccc
22222
33333
ggggg
hhhhh
iiiii
ttttt



If this is the I/p file , the RC should have been 0.


Input file :


Code:

11111     -> dup1
aaaaa
bbbbb     -> dup 2
bbbbb     -> dup 2
11111    ->  dup1 ( did not follow first occurence )
bbbbb     ->  dup2 ( did not follow sec occurence )
ccccc
22222
33333
ggggg
hhhhh
iiiii
ttttt


Orderliness - If there are duplicates , they should be in a group . So, If there are say 3 duplicates , then all of these 3 should be ordered together.

In this case, the Return code should be 0.

Else, the RC should be Non -Zero.
Back to top
View user's profile Send private message

hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Tue Mar 15, 2011 2:37 pm    Post subject:
Reply with quote

Hi fredrick,
Try this two step process..
If your data is ordered(based on your rules), the RC would be 4 else it would be 5.

Code:

//STEP010  EXEC PGM=SORT                       
//SYSOUT   DD SYSOUT=*                         
//SORTIN   DD DSN=-->>input file                                 
//SORTOUT DD  DSN=-->> Output file1         
//SORTXSUM DD  DSN=-->> XSUM file         
//SYSIN    DD *                                   
  SORT FIELDS=(1,5,CH,A,81,8,ZD,A)                 
  INREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,5))     
  SUM FIELDS=NONE,XSUM                             
//*                                               
//STEP020 EXEC PGM=IDCAMS                           
//SYSPRINT DD SYSOUT=*                             
//INDD1    DD DSN=-->>XSUM File
//OUTDD    DD  DSN=-->> Dummy file     
//SYSIN    DD *                                   
  PRINT IFILE(INDD1) COUNT(1)                     
  IF LASTCC=0 THEN -                               
              DO                                   
                SET MAXCC=5       
              END                 


Thanks,
Ashwin.
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Tue Mar 15, 2011 3:51 pm    Post subject:
Reply with quote

Hi,
A small correction on the IDCAMS step's SYSIN card to set RC=0 for correct order and RC=5 for not in order.


Code:


//SYSIN    DD *             
  PRINT IFILE(INDD1) COUNT(1)
  IF LASTCC=0 THEN -         
      SET MAXCC=5           
  ELSE SET MAXCC=0           


Thanks,
Ashwin.
Back to top
View user's profile Send private message
fredrick andrews

New User


Joined: 10 Jun 2010
Posts: 52
Location: chennai

PostPosted: Sun Mar 27, 2011 12:51 am    Post subject:
Reply with quote

Hi aswin,

It worked...
Sorry for the delay in replying...
Thanks!
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 Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am


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