View previous topic :: View next topic
|
Author |
Message |
pavankch
New User
Joined: 07 Aug 2009 Posts: 2 Location: Bangalore
|
|
|
|
Hi, I have the below requirement on SORT Card
My input file contains the Employee and the amount field, lets say
11111 2.0
22222 5.0
00000 3.0
33333 1.8
44444 2.6
00000 3.0
00000 5.5
55555 1.2
Some of the employee numbers are tagged as zeros in the input file, this file is sent to us from a third party system.
Now i need to find the records which are zeros and replace it with the non-zero employee number picking from the prior record.
My output should be like,
11111 2.0
22222 5.0
22222 3.0
33333 1.8
44444 2.6
44444 3.0
44444 5.5
55555 1.2
Can anyone help me with this requirement.. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try this
Code: |
//STEP0001 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
11111 2.0
22222 5.0
00000 3.0
33333 1.8
44444 2.6
00000 3.0
00000 5.5
55555 1.2
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,5,ZD,GT,+0),
PUSH=(1,5))
/*
|
Gerry |
|
Back to top |
|
|
pavankch
New User
Joined: 07 Aug 2009 Posts: 2 Location: Bangalore
|
|
|
|
Wow.. Thanks much Gerry.. This worked.. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
I finally got to test a GROUP function.
z/OS 1.11 was installed and the updated DFSORT came with it.
Gerry |
|
Back to top |
|
|
|