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

Reading a comma delimited file using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Mon Jul 19, 2010 7:32 pm
Reply with quote

Hi All,

Is it possible to read a comma delimited file using a DFSORT

For Ex:-

I have a input file like this
Code:

1,22,333,4444
1,2,3,4
1,,33,444


Output should be
Code:

1  22  333  4444
1  2   3    4
1      33   444


The length of
1st field is 1
2nd field is 2
3rd field is 3
4th field is 4
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: Mon Jul 19, 2010 9:20 pm
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1,22,333,4444
1,2,3,4
1,,33,444
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  INREC PARSE=(%1=(ENDBEFR=C',',FIXLEN=1),
               %2=(ENDBEFR=C',',FIXLEN=2),
               %3=(ENDBEFR=C',',FIXLEN=3),
               %4=(FIXLEN=4)),
  BUILD=(%1,2X,%2,2X,%3,2X,%4)
/*
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 DFSORT GUID DFSORT/ICETOOL 1
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top