utpalshan
New User
Joined: 08 Apr 2009 Posts: 2 Location: Mumbai
|
|
|
|
Hi,
I have an input file(LRECL=10) that can contain records upto 9 digits
Sample input file:
----+----1
1000
87657
36815543
I require the output file to be padded with trailing zeroes.
Required output file:
----+----1----+----2
1000000000000000
8765700000000000
3681554300000000
Can anyone guide me?
Thanks,
Utpal |
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
utpalshan,
Assuming that you have trailing spaces , the following DFSORT jcl will give you the desired results. The output file length is set to 20 bytes.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=your 10 byte input file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,FINDREP=(INOUT=(C' ',C'0'))),
IFTHEN=(WHEN=INIT,BUILD=(1,10,10C'0'))
//* |
|
|