View previous topic :: View next topic
|
Author |
Message |
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
Hi,
I am trying to pad numbers (aligned left in the input) with left zeros and numbers right aligned.
Code: |
//SORTIN DD *
ABC1
BDJ233
JFK3
KDK43
DK 54321
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,3,(+99999,SUB,(+99999,SUB,4,5,ZD)),M11,LENGTH=5)
/*
|
i am thinking too loud with this sort instruction - it's not giving desired results.
I want output as
Code: |
ABC00001
BDJ00233
JFK00003
KDK00043
DK 54321
|
can u please help. thanks in advance. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC1
BDJ233
JFK3
KDK43
DK 54321
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(4:4,5,UFF,M11,LENGTH=5)
/*
|
|
|
Back to top |
|
|
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
thanks Frank |
|
Back to top |
|
|
|