View previous topic :: View next topic
Author
Message
Michaelod Warnings : 1 New User Joined: 02 Sep 2008Posts: 49 Location: Edinburgh
Hi,
I have a file 621 bytes long with numerous records.
I am looking to find the count of records where position (158,16,LT,0 and 559,16,GT,0) or (158,16,GT,0 and 559,16,LT,0) and write the count to an output file 9 bytes long e.g. 000015489
Both fields are defined as S9(14)v9(2).
Can anyone help?
Thanks
Back to top
ksk Active User Joined: 08 Jun 2006Posts: 355 Location: New York
Back to top
Michaelod Warnings : 1 New User Joined: 02 Sep 2008Posts: 49 Location: Edinburgh
I had a look at that thread but it didnt seem to work properly when I tried it.
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
And from that, we're supposed to be able to help. . .
Is there any reason you did not post the problem info from your attempt?
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Michaelod,
Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=FB.
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB)
//SORTOUT DD DSN=... output file (FB/9)
//SYSIN DD *
OPTION COPY
INCLUDE COND=((158,16,ZD,LT,0,AND,559,16,ZD,GT,0),OR,
(158,16,ZD,GT,0,AND,559,16,ZD,LT,0))
OUTFIL REMOVECC,NODETAIL,
BUILD=(9X),
TRAILER1=(COUNT=(M11,LENGTH=9))
/*
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Michaelod wrote:
I am looking to find the count of records where position (158,16,LT,0 and 559,16,GT,0) or (158,16,GT,0 and 559,16,LT,0)
Frank,
Dont we need to add an ",OR, the second condition"?
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Oh, I missed the second condition. I fixed it above.
Back to top
Please enable JavaScript!