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

Using SYNCSORT want to re-arrange the records in the file.


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
navneetkadu

New User


Joined: 16 Nov 2006
Posts: 3
Location: Pune, India

PostPosted: Thu Dec 19, 2013 6:04 pm
Reply with quote

In file I have two types of records:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
DTL02011324506001222HAN
DTL12011324506001222UUUUUUUU
DTL08011324506001222888981
DET01011324506000222YUNI
DET02011324506000222777777UU
DET0801132450600022200000000
DET120113245060002224528
DTL08011324507003222842916
DTL08011324507003222
DTL01011324507001222YUYRR
DTL08011324507001222
DTL1201132450700122200652
BAT0B           V2221312161301132450702121212XYYYY
BAT0B           V2221312161301132450602121212XYYYY
------------------------------------------------------------------------
Input file has two types of records, detail and batch.
Where I want to sort Detail records on 12 digits (10 digits base and 2 digit sequence) number (start 6th position till 17th).
And then place the corresponding Batch record after the end of corresponding detail records. Batch record has 10 digit base in it, (starts at 29th position till 38th)

Out file I want as below:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
DET01011324506000222YUNI
DET02011324506000222777777UU
DET0801132450600022200000000
DET120113245060002224528
DTL02011324506001222HAN
DTL12011324506001222UUUUUUUU
DTL08011324506001222888981
BAT0B           V2221312161301132450602121212XYYYY
DTL01011324507001222YUYRR
DTL08011324507001222
DTL1201132450700122200652
DTL08011324507003222842916
DTL08011324507003222
BAT0B           V2221312161301132450702121212XYYYY
------------------------------------------------------------------------

Please let me know if any one have some specific approach for this.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Dec 19, 2013 8:00 pm
Reply with quote

Hello and welcome to the forum,

Suggest you prepend the base & seq then a "type" (1 for dtl, 2 for bat), sort on these prepended values then leave them off when writing the output.
Back to top
View user's profile Send private message
navneetkadu

New User


Joined: 16 Nov 2006
Posts: 3
Location: Pune, India

PostPosted: Thu Dec 19, 2013 8:16 pm
Reply with quote

Hey Dick, thank you for your response.
Can this be done for VB file? my file is VB.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Dec 19, 2013 9:20 pm
Reply with quote

Exactly wyh you "prepend" and not stick the seq at the other end.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Dec 19, 2013 10:19 pm
Reply with quote

Hello,

Yes - i repeat what Nic said.
Back to top
View user's profile Send private message
navneetkadu

New User


Joined: 16 Nov 2006
Posts: 3
Location: Pune, India

PostPosted: Fri Dec 20, 2013 12:07 am
Reply with quote

It works.. I got my expected results.
Thank you! icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Dec 20, 2013 12:55 am
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
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
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top