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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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