View previous topic :: View next topic
|
Author |
Message |
dharmaraok
New User
Joined: 10 Mar 2011 Posts: 45 Location: india
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You need to show the code that is failing. Also please used the Code tags to preserve formatting. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Very much confusing!! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
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 |
|
|
|