Ron,

It is quite simple to pad the leading zeros. Here is a sample. I assumed 
that you have a 6 byte field

//STEP0100 EXEC PGM=SORT 
//SYSOUT   DD SYSOUT=* 
//SORTIN   DD * 
       - PAD 6 ZEROES 
1       - PAD 5 ZEROES 
12       - PAD 4 ZEROES 
123       - PAD 3 ZEROES 
1234       - PAD 2 ZEROES 
12345       - PAD 1 ZEROES 
123456       - NO PADDING 
//SORTOUT  DD SYSOUT=* 
//SYSIN    DD * 
  OPTION COPY 
  INREC OVERLAY=(1,6,UFF,M11,LENGTH=6) 
//* 

The output from this is 

000000- PAD 6 ZEROES 
000001 - PAD 5 ZEROES 
000012  - PAD 4 ZEROES 
000123   - PAD 3 ZEROES 
001234    - PAD 2 ZEROES 
012345     - PAD 1 ZEROES 
123456      - NO PADDING   

Further if you have any questions please let me know

Thanks,
Sri Hari Kolusu
DFSORT Development
IBM Corporation
Email: [email protected]
Phone: 408-927-2187 Tie Line: 457-2187

IBM Mainframe Discussion List <[email protected]> wrote on 
09/13/2014 10:29:11 PM:

> From: Ron Thomas <[email protected]>
> To: [email protected]
> Date: 09/13/2014 10:29 PM
> Subject: SORT JCL
> Sent by: IBM Mainframe Discussion List <[email protected]>
> 
> Hi.
> 
> We have a file which is of the below layout LRECL = 80
> 
> 0001 - 4043
> 4045 - 4060
> 4062 - 4108
> 4110 - 4700
> 4705 - 4706
> 4708    88888 
> 4714 
> 4719 
> 4723
> 67777 
> 
> Here we need to make this file as below by appending zeros to the 
> 1'st byte of each number only if the length of the number is 4 . 
> This being a parmcard if someone entered a 5 digit then no need to 
> apend a zero . Could some one let me know how to do the same in sort?
> 
> 00001 - 04043
> 04045 - 04060
> 04062 - 04108
> 04110 - 04700
> 04705 - 04706
> 04708   888888 
> 04714 
> 04719 
> 04723 
> 677777
> 
> Thanks
> Ron T
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
> 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to