View previous topic :: View next topic
|
Author |
Message |
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi,
I want to eliminate records from an input file if the sum of two comp fields is greater than 10000.00
Fields position and pic clause is a below
Code: |
Field-1 1-9 S9(13)V9(4) COMP-3
Field-2 9-18 S9(13)V9(4) COMP-3 |
Input file is a FB file of length 644.
I am aware how to sum these two fields but not sure how to use summed value for elimation.
Kindly suggest how to achieve this
Thanks and regards,
Chandan |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
If i give the check like
Code: |
INCLUDE COND=(1,10,PD,GT,10000) |
it selects the data which is having value 99999.99 which it should not.
Basically I want to know how to identify decimal point here so that lesser data will not be selected. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
OK, you're nearly there. PD in sort doesn't know about decimal places. So, you have four (counted 'em again), so you need to check for > 100000000.
Looking back at your first post again, I realise how I missed the four decimals... already covered above.
Two more things. The 8/9 byte field is now in your INCLUDE as 10. And, if you don't want things above 10000.0000 to appear, don't you want to use OMIT? Three. If you have four decimal places, please stop writing them with only two! |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Thanks DIck..It worked perfectly fine |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
chandan.inst,
Use the following DFSORT JCL which will give you the desired results. It will sum both the PD fields and then drop any records greater 10,000
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=your input FB 644 byte file,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
OUTREC OVERLAY=(645:1,9,PD,ADD,10,9,PD,PD,LENGTH=12)
OUTFIL BUILD=(1,644),OMIT=(645,12,PD,GT,100000000)
//* |
|
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Thanks for the replies Skolusu and Bill..
It was my mistake in my intial post. I wanted to include records having value gretaer than 10000.000 so in one of the replies I have used INCLUDE where as your replies mention OMIT( which is perfectly fine as per my inital post)
It's working fine now
Regards,
Chandan |
|
Back to top |
|
|
|