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 4 files with 3 types of records

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

New User


Joined: 19 Jul 2007
Posts: 5
Location: hyderabad

PostPosted: Wed Jun 04, 2008 3:55 pm    Post subject: SYNCSORT 4 files with 3 types of records
Reply with quote

I have 4 file with 3 types of records
one header record, multiple data records & one trailer record.

file 1 : H2008-01-01
file 2 : D55555AAAAA
D11111BBBBB
file 3 : D22222CCCC
file 4 : T00003

now i have to sort this files to get a single output file something like this
Records should be sorted first on first byte and then on next 5 bytes and then
next 5 bytes

H2008-01-01
D11111BBBBB
D22222CCCC
D55555AAAAA
T00003

i am using the following control card
SORT FIELDS=(1,1,CH,A,2,5,ZD,A,7,5,CH,A)
OUTFIL FNAMES=SORTOUT1,
INCLUDE=(1,1,CH,NE,C'H')
OUTFIL FNAMES=SORTOUT2,
INCLUDE=(1,1,CH,EQ,C'H')

the problem is that i am getting the same output but in two different files
Back to top
View user's profile Send private message

the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Wed Jun 04, 2008 4:00 pm    Post subject:
Reply with quote

Quote:
Records should be sorted first on first byte

Is your example matching your criteria?

H
D
D
D
T
Back to top
View user's profile Send private message
sdwajid
Currently Banned

New User


Joined: 19 Jul 2007
Posts: 5
Location: hyderabad

PostPosted: Wed Jun 04, 2008 4:05 pm    Post subject:
Reply with quote

yes
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Jun 04, 2008 4:45 pm    Post subject:
Reply with quote

Hi,

try this
Code:
//STEP0001 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
H2008-01-01                                                     
/*                                                             
//         DD *                                                 
D55555AAAAA                                                     
D11111BBBBB                                                     
/*                                                             
//         DD *                                                 
D22222CCCC                                                     
/*                                                             
//         DD *                                                 
T00003                                                         
/*                                                             
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  SORT FIELDS=(81,1,BI,A,1,11,BI,A)                             
  INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'H'),OVERLAY=(81:C'1')),       
        IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),OVERLAY=(81:C'3')),       
        IFTHEN=(WHEN=NONE,OVERLAY=(81:C'2'))
  OUTREC BUILD=(1,80)                       
/*                                           
               


Gerry
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 Jun 04, 2008 8:10 pm    Post subject:
Reply with quote

Hello,

Quote:
the problem is that i am getting the same output but in two different files
Why have 2 output files been named? Your requirement says you want a single output file

If you remove these:
Quote:
OUTFIL FNAMES=SORTOUT1,
INCLUDE=(1,1,CH,NE,C'H')
OUTFIL FNAMES=SORTOUT2,
INCLUDE=(1,1,CH,EQ,C'H')
do you get the desired output?
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 if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


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