Aneesh
New User
Joined: 30 Sep 2006 Posts: 60
|
|
|
|
Hi,
I have an 80 byte FB file with the first 6 characters in a text format. I need to convert this to an edited format (TTTTT.TTTT). (The remaining characters are blanks in the file)
1.5
16.5
5
134.45
12.35
Output
00001.5000
00016.5000
00005.0000
00134.4500
00012.3500
Is this possible using any data format - I tried to use UFF but it completely removes the decimal point info.
Thanks for your help.
Thanks,
Aneesh. |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
This is a bit tricky because you have different numbers of digits after the decimal point for different values. But here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1.5
16.5
5
134.45
12.35
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,
PARSE=(%01=(ENDBEFR=C'.',FIXLEN=5),
%02=(FIXLEN=4)),
BUILD=(%01,UFF,EDIT=(TTTTT),C'.',%02,80:X)),
IFTHEN=(WHEN=INIT,
FINDREP=(STARTPOS=7,ENDPOS=10,IN=C' ',OUT=C'0'))
/*
|
|
|