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

Syncsort - Combine multiple records of a file into 1 record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Magna

New User


Joined: 30 Oct 2006
Posts: 24

PostPosted: Tue Nov 16, 2010 4:20 pm
Reply with quote

Hi,
I have a requirement. I have a file which is of LRECL 100 bytes and the record layout is like given below.
11AAAAXXXXXX
2BBBBXXXXXX
3CCCCXXXXXX
11aaaaxxxxxx
2bbbbxxxxxx
3ccccxxxxxx

Note: there are no sequence numbers present and the 1 2 3 given before A B C denotes the record types. So which means we have to combine all the record types into one record and the output file length should be 300 bytes.

and the o/p file should have the values as below.
11AAAAXXXXXX 2BBBBXXXXXX 3CCCCXXXXXX
11aaaaxxxxxx 2bbbbxxxxxx 3ccccxxxxxx

I have to use Syncsort to achieve this. Can someone please give an idea how this can be done. This can be achieved using SPLICE but still the examples which I got from the searches are not relevant for this.

Thanks,
Magna.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Nov 16, 2010 5:10 pm
Reply with quote

Which Syncsort version do you have?
Back to top
View user's profile Send private message
Magna

New User


Joined: 30 Oct 2006
Posts: 24

PostPosted: Tue Nov 16, 2010 5:25 pm
Reply with quote

Its Synctool Release 1.6.2
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Nov 16, 2010 5:32 pm
Reply with quote

Quote:
Which Syncsort version do you have?
Quote:
there are no sequence numbers present
You said there are no sequence numbers, but will there be record types - 1,2 or 3 present at pos-1 for all the records?
Back to top
View user's profile Send private message
Magna

New User


Joined: 30 Oct 2006
Posts: 24

PostPosted: Tue Nov 16, 2010 6:38 pm
Reply with quote

The record types will be present in position 2 and in position 1 of every record type 1 the value 1 will be present.
Back to top
View user's profile Send private message
Magna

New User


Joined: 30 Oct 2006
Posts: 24

PostPosted: Tue Nov 16, 2010 7:08 pm
Reply with quote

Aplogies... the version is 1.3.2.0R
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Nov 17, 2010 12:16 pm
Reply with quote

The below Syncsort job should work for your requirement.
Code:
//STEP01   EXEC PGM=SORT                                             
//SORTIN   DD DSN= Input file (FB/100)
//SYSOUT   DD SYSOUT=*                                               
//SORTOUT  DD DSN= Output file (FB/300)
//SYSIN    DD  *                                                     
 INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,ZD,EQ,1),PUSH=(101:ID=1,1,100)),   
   IFTHEN=(WHEN=GROUP,BEGIN=(2,1,ZD,EQ,2),PUSH=(202:1,100),RECORDS=2), 
   IFTHEN=(WHEN=(2,1,ZD,EQ,3),OVERLAY=(302:1,100))                     
 SORT FIELDS=COPY                                                     
 OUTFIL REMOVECC,NODETAIL,SECTIONS=(101,1,TRAILER3=(102,300)),BUILD=(300X)
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 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top