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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: Using SYNCSORT want to re-arrange the records in the file.
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

Site Director


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

PostPosted: Thu Dec 19, 2013 8:00 pm    Post subject:
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    Post subject:
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: 1713
Location: UK

PostPosted: Thu Dec 19, 2013 9:20 pm    Post subject:
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

Site Director


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

PostPosted: Thu Dec 19, 2013 10:19 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Dec 20, 2013 12:55 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 5 Fri Dec 02, 2016 9:47 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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