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
 

 

Delimited file

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

New User


Joined: 10 Mar 2011
Posts: 31
Location: india

PostPosted: Fri Mar 13, 2015 5:12 pm    Post subject: Delimited file
Reply with quote

Hi all,

I am having the below input file having delimited by ",".

Code:
Field -1 --> Name
Field -2 --> city
Field -3 --> street no
Field -4 --> road no


Code:
raju,madras,street no-10,mainroad-10


I have used sort card with delimited option

the data I got is

Code:
Raju  madras street no-10 maonroad-10


But the data comes in the below format , there is no street no.

Code:
raju,madras,,mainroad-10


my sort card is not working; i am getting the output like

Code:
Raju  madras              maonroad-10


BUt i need output like, spaces should be populated in the 3rd field.
Code:

Raju  madras                      maonroad-10


Could uou please let me know how can we do it.

Code'd
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Mar 13, 2015 6:15 pm    Post subject: Reply to: Delimited file
Reply with quote

You need to show the code that is failing. Also please used the Code tags to preserve formatting.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1717
Location: NY,USA

PostPosted: Fri Mar 13, 2015 9:49 pm    Post subject:
Reply with quote

Very much confusing!!
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10272
Location: italy

PostPosted: Fri Mar 13, 2015 11:23 pm    Post subject: Reply to: Delimited file
Reply with quote

Quote:
my sort card is not working;

how in heaven are we supposed to provide help with the useless info You provided

post the sort control statements using the code tags
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 375
Location: USA

PostPosted: Fri Mar 13, 2015 11:25 pm    Post subject: Reply to: Delimited file
Reply with quote

I believe you need the help of PARSE operand of SORT.

If your input data looks like this:
Code:
//SORTIN DD *               
 ABC,XYZ,STREET10,MAINROAD10
 ABC,XYZ,,MAINROAD10         


And you need output like this:

Code:
 ABC XYZ  STREET10  MAINROAD10   
 ABC XYZ            MAINROAD10   


Then you may want to use PARSE and build a SYSIN card like this:
Code:
 OPTION COPY   
 OUTREC PARSE=(%01=(ENDBEFR=C',',FIXLEN=5), 
               %02=(ENDBEFR=C',',FIXLEN=5), 
               %03=(ENDBEFR=C',',FIXLEN=10),
               %04=(ENDBEFR=C',',FIXLEN=10)),
 BUILD=(%01,%02,%03,%04)                     
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 FTP xls file from Mainfrmae kumarsatheeshc1 TSO/ISPF 5 Tue Jun 20, 2017 6:56 pm
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts XML Parse for large file muralikrishnan_new COBOL Programming 3 Mon Jun 12, 2017 12:50 pm


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