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 Splitting the file based on check digit

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

New User


Joined: 07 Nov 2007
Posts: 12
Location: Hyderabad

PostPosted: Wed Mar 19, 2008 7:49 pm    Post subject: SYNCSORT Splitting the file based on check digit
Reply with quote

Hi All..

I have a small requirement. I have different kinds of files with different record layouts. But the key for these files is present in the same location.(Starting 2 positions)

The key field is of 3 byte ZD field.

Now I want to split a file based on the following logic:
Divide the key field by 3 and based on the remainder move that record to the files accordingly.
That is if the remainder is 0, move the record to file1,
if remainder is 1, move the record to file 2 and
if remainder is 2, move the record to file 3.

Lets say for example my input file is a FB with LRECL=80 and the input records are as follows:

120AAAAAA
121ABCDEF
122BCDEFG
123UUUUUU
124IIIIIIIII
125QQQQQ

The three output files should be like:

Output 1
120AAAAAA
123UUUUUU

Output 2
121ABCDEF
124IIIIIIIII

Output 3
122BCDEFG
125QQQQQ

Also the same sort card should be used for other files with different record-lengths like FB with LRECL=8000 or 900 etc.

Please let me know if the requirement is not clear.

Vissubhai
Back to top
View user's profile Send private message

Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Mar 19, 2008 8:56 pm    Post subject:
Reply with quote

vissubhai,

SORTIN can consist of concatenated data sets, but if the data sets are fixed-length, they must all have the same LRECL.
Back to top
View user's profile Send private message
vissubhai

New User


Joined: 07 Nov 2007
Posts: 12
Location: Hyderabad

PostPosted: Wed Mar 19, 2008 9:20 pm    Post subject:
Reply with quote

Alissa,

My requirement is can I have only one sort card for different files.

SORTIN will have only One input file and will have SORTOF01, SORTOF02, SORTOF03 files with record length same as of input file.

That is I have different JCLs for different files but wanted to use the same sortcard for them.

Let me know if I am not clear.

Thanks,
Vissubhai
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Mar 19, 2008 9:58 pm    Post subject:
Reply with quote

With FB data, the LRECL needs to be coded accordingly in the inrec/outrec statements, as follows:
Code:

//STEP1  EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
120AAAAAA                                               
121ABCDEF                                               
122BCDEFG                                               
123UUUUUU                                               
124IIIIIIIII                                           
125QQQQQ 
//SORTOF01 DD DSN=OUTPUT.REMAIN0                       
//SORTOF02 DD DSN=OUTPUT.REMAIN1                       
//SORTOF03 DD DSN=OUTPUT.REMAIN2                       
//SYSIN DD  *                                           
    INREC FIELDS=(1,80,1,3,ZD,MOD,+3,M11,LENGTH=1)
    SORT FIELDS=COPY                                   
    OUTFIL FILES=01,INCLUDE=(81,1,ZD,EQ,0),OUTREC=(1,80)
    OUTFIL FILES=02,INCLUDE=(81,1,ZD,EQ,1),OUTREC=(1,80)
    OUTFIL FILES=03,INCLUDE=(81,1,ZD,EQ,2),OUTREC=(1,80)
/*


If your data were VB, then you could modify the job to standardize it for any LRECL:
Code:

//STEP1  EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=INPUT.VB,DISP=SHR
//SORTOF01 DD DSN=OUTPUT.REMAIN0                       
//SORTOF02 DD DSN=OUTPUT.REMAIN1                       
//SORTOF03 DD DSN=OUTPUT.REMAIN2                       
//SYSIN    DD *                                             
    INREC FIELDS=(1,4,5,3,ZD,MOD,+3,M11,LENGTH=1,5)       
    SORT FIELDS=COPY                                     
    OUTFIL FILES=01,INCLUDE=(5,1,ZD,EQ,0),OUTREC=(1,4,6) 
    OUTFIL FILES=02,INCLUDE=(5,1,ZD,EQ,1),OUTREC=(1,4,6) 
    OUTFIL FILES=03,INCLUDE=(5,1,ZD,EQ,2),OUTREC=(1,4,6) 
/*         
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Mar 19, 2008 10:32 pm    Post subject:
Reply with quote

Hello,

Quote:
My requirement is can I have only one sort card for different files.
This "requirement" needs to be changed to "My requirement is I can have only one sort card for different files of the same lrecl".

Possibly i misunderstand and this is only a "want" rather than an actual requirement. . .
Back to top
View user's profile Send private message
vissubhai

New User


Joined: 07 Nov 2007
Posts: 12
Location: Hyderabad

PostPosted: Thu Mar 20, 2008 9:19 am    Post subject:
Reply with quote

Thanks a lot Alissa...
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 Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


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