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

Syncsort RC not 0 If Not in Order!


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 74
Location: Boston

PostPosted: Tue Mar 15, 2011 2:37 pm
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: 74
Location: Boston

PostPosted: Tue Mar 15, 2011 3:51 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Rotate partition-logical & physic... DB2 0
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DB2 Load - Sort Or order BY DB2 1
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
Search our Forums:

Back to Top