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
 

 

Convert the Fixed length file to CSV file format using SORT

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

New User


Joined: 24 Sep 2008
Posts: 2
Location: Chennai

PostPosted: Thu Mar 12, 2009 6:25 pm    Post subject: Convert the Fixed length file to CSV file format using SORT
Reply with quote

Hi,
First i did a search in this forum for my below requirement. However, i got something related to that .
Please share me if you already done this kind of formatting.

I would like to convert the fixed length input file into CSV format file using SORT.

Input file:
123AAA456
456BBB789
789CCC012

Expecting ouput:
123,AAA,456
456,BBB,789
789,CCC,012

Thanks,
Chitti.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Mar 12, 2009 9:20 pm    Post subject:
Reply with quote

Chitti,

If you just want to insert a comma between 3 byte fields, you can use a DFSORT job like this:

Code:

//S1    EXEC  PGM=SORT                           
//SYSOUT    DD  SYSOUT=*                         
//SORTIN DD *                                     
123AAA456                                         
456BBB789                                         
789CCC012                                         
//SORTOUT DD SYSOUT=*                             
//SYSIN    DD    *                               
  OPTION COPY                                     
  INREC BUILD=(1,3,C',',4,3,C',',7,3,80:X)       
/*                                               



If you want to do something else, you need to explain more clearly and in more detail what you want to do.
Back to top
View user's profile Send private message
chittibabu.sa

New User


Joined: 24 Sep 2008
Posts: 2
Location: Chennai

PostPosted: Fri Mar 13, 2009 10:04 am    Post subject:
Reply with quote

Your code works well. Thank you Frank. I would like to explore SORT features. Can you please suggest some books or manuals.

Chitti.
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 Mar 13, 2009 7:08 pm    Post subject:
Reply with quote

Hello,

This is a link to a "Sticky" near the top of the DFSORT part of the forum:
http://ibmmainframes.com/viewtopic.php?t=1348
It should be helpful.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Mar 14, 2009 1:52 am    Post subject:
Reply with quote

Chitti,

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am


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