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

Delimited file


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

New User


Joined: 10 Mar 2011
Posts: 45
Location: india

PostPosted: Fri Mar 13, 2015 5:12 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Mar 13, 2015 6:15 pm
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

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

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Mar 13, 2015 11:23 pm
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: 446
Location: USA

PostPosted: Fri Mar 13, 2015 11:25 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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
No new posts How to split large record length file... DFSORT/ICETOOL 10
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