Ron,
Use the following JCL
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
----+----1----+----2----+----3----+----4----+----5----+----6----+---
1 43
343 - 999
CHAIN
4062 - 4108
4110 - 4700
4705 - 4706
4708
4714
4719
4723
345
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,5,CH,NE,C'CHAIN'),
OVERLAY=(1:1,5,UFF,M11,LENGTH=5,
7:7,5,UFF,M11,LENGTH=5,
1:1,5,CHANGE=(5,C'00000',C' '),NOMATCH=(1,5),
7:7,5,CHANGE=(5,C'00000',C' '),NOMATCH=(7,5)))
//*
The output from this is
00001 00043
00343-00999
CHAIN
04062-04108
04110-04700
04705-04706
04708
04714
04719
04723
00345
Thanks,
Kolusu
IBM Mainframe Discussion List <[email protected]> wrote on
09/15/2014 10:18:06 AM:
> From: Ron Thomas <[email protected]>
> To: [email protected]
> Date: 09/15/2014 10:18 AM
> Subject: Re: SORT JCL
> Sent by: IBM Mainframe Discussion List <[email protected]>
>
> Kolusu.
>
> Apologies for the wrong data put, "-" is there in the input on col "6".
>
> Here is the requirements
>
> FROM DEPT - TODEPT
> 100 - 200
>
>
> i.e all data "FROM DEPT" and "TODEPT" to be made 5 bytes by
> padding zeros irrespective of what users entered. if the user
> entered 5 byte dept then make no changes for all other cases pad
> with zeros to make it as 5 bytes. 1 byte data inputted to be padded
> with 4 leading zeros and same as in all the other cases.
>
> If there is some word like CHAIN in one of the records then leave
> that record . no need to make any changes.
>
>
>
> INPUT
>
> 1 – 43
> 343-999
> CHAIN
> 4062 - 4108
> 4110 - 4700
> 4705 - 4706
> 4708
> 4714
> 4719
> 4723
>
> OUTPUT
>
> 00001 – 00043
> 00343 - 00999
> CHAIN
> 04062 - 04108
> 04110 - 04700
> 04705 - 04706
> 04708
> 04714
> 04719
> 04723
>
> 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