bodatrinadh
Active User
Joined: 05 Jan 2007 Posts: 101 Location: chennai (India)
|
|
|
|
I'm have a delimited input file.
Code: |
GTURO|BPH|0002400000312|EQUALIZE||CUR|0.250|XPO
GTURO|BPH|0002400000313|EQUALIZE||CUR|0.250|XPO
GTURO|BPH|0002400000310|EQUALIZE||CUR|0.250|XPO
GTURO|BPH|0002400000311|EQUALIZE||CUR|0.250|XPO
|
and my desired output is
Code: |
GTURO BPH0002400000312 EQUALIZE CUR 00025{XPO
GTURO BPH0002400000313 EQUALIZE CUR 00025{XPO
GTURO BPH0002400000310 EQUALIZE CUR 00025{XPO
GTURO BPH0002400000311 EQUALIZE CUR 00025{XPO |
My current sort looks like this:
Code: |
SORT FIELDS=COPY,SKIPREC=1
OUTREC PARSE=(%01=(ENDBEFR=C'|',FIXLEN=10),
%02=(ENDBEFR=C'|',FIXLEN=3),
%03=(ENDBEFR=C'|',FIXLEN=13),
%04=(ENDBEFR=C'|',FIXLEN=8),
%05=(ENDBEFR=C'|',FIXLEN=3),
%06=(ENDBEFR=C'|',FIXLEN=3),
%07=(ENDBEFR=C'|',FIXLEN=6),
%08=(ENDBEFR=C'|',FIXLEN=3)),
BUILD=(01:%01,JFY=(SHIFT=LEFT),
11:%02,JFY=(SHIFT=LEFT),
14:%03,JFY=(SHIFT=LEFT),
27:%05,JFY=(SHIFT=LEFT),
37:%04,JFY=(SHIFT=LEFT),
47:%06,JFY=(SHIFT=LEFT),
57:%07,JFY=(SHIFT=LEFT),
63:%08,JFY=(SHIFT=LEFT),66:10X),CONVERT
|
Thanks
Trinadh
Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj |
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
bodatrinadh,
Your sample input data fields seem to be at fixed positions though it is delimited. Is it true for all the records? If yes, then you might not need a PARSE and JFY as shown in your sort card.
You have n't mentioned what problem you are facing. Also it will be better if you post your input and output file attributes and the conversion rules required for numeric fields. |
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Also, when I alligend your input/output - it shows up the way it's inthe first post - was not sure if you really needed those many "spaces" between fields... but you never objected...
Also looks like the only numeric conversion you had is multiplying these fields
Code: |
0.250
0.250
0.250
0.250 |
by 1000 and convert them to ZD? |
|