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 - Combine multiple records of a file into 1 record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - Combine multiple records of a file into 1 record
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: 2276
Location: @my desk

PostPosted: Tue Nov 16, 2010 5:10 pm    Post subject:
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    Post subject:
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: 2276
Location: @my desk

PostPosted: Tue Nov 16, 2010 5:32 pm    Post subject:
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    Post subject:
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    Post subject:
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: 2276
Location: @my desk

PostPosted: Wed Nov 17, 2010 12:16 pm    Post subject:
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm


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