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
 

 

Format records using sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
c_mayur

New User


Joined: 21 Jul 2007
Posts: 4
Location: India

PostPosted: Mon Jun 16, 2014 11:42 pm    Post subject: Format records using sort
Reply with quote

My file looks like this

Code:
PRL001  ,06/07/2014,03/05/2014
PRL002  ,06/10/2014,01/31/2014
PRL001  ,06/07/2014,02/06/2014
PRL002  ,06/09/2014,03/14/2014


Need to format the file to have output like this

Code:
06/07/2014,PRL001  ,03/05/2014
06/10/2014,PRL002  ,01/31/2014
06/07/2014,PRL001  ,02/06/2014
06/09/2014,PRL002  ,03/14/2014
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Tue Jun 17, 2014 12:04 am    Post subject: Reply to: Format records using sort
Reply with quote

It is a simple BUILD on INREC. Specify the start/length of each input field, in the order you want them on the output. Done.

What is the problem you've had? Did you try to use OVERLAY instead of BUILD? You'd need an extra field. If that means extending the record, you'll have the equivalent of a BUILD anyway, with extra messing about.
Back to top
View user's profile Send private message
Abid Hasan

New User


Joined: 25 Mar 2013
Posts: 65
Location: India

PostPosted: Tue Jun 17, 2014 12:04 am    Post subject: Reply to: Format records using sort
Reply with quote

Hello,

Please read on OUTFIL in DFSORT, this link gives ample examples on the usage of the same; and here is the link for the DFSORT Application Programming Guide which should help you work out the parameter definitions.
This task can be easily achieved by reformatting records using OUTFIL.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Tue Jun 17, 2014 1:02 am    Post subject: Reply to: Format records using sort
Reply with quote

The records could be reformatted in INREC, OUTREC or OUTFIL. If OUTREC or OUTFIL aren't otherwise required, I always use INREC.
Back to top
View user's profile Send private message
Abid Hasan

New User


Joined: 25 Mar 2013
Posts: 65
Location: India

PostPosted: Tue Jun 17, 2014 2:59 pm    Post subject: Reply to: Format records using sort
Reply with quote

Completely agree Bill, INREC being the better choice, because of the DFSORT processing hierarchy.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am


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