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

Convert the Fixed length file to CSV file format using SORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Thu Mar 12, 2009 9:20 pm
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
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

Moderator Emeritus


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

PostPosted: Fri Mar 13, 2009 7:08 pm
Reply with quote

Hello,

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

DFSORT Developer


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

PostPosted: Sat Mar 14, 2009 1:52 am
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:

Use [URL] BBCode for External Links
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
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