IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

skip records depending on sum value of two Comp-3 fields


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Thu Sep 22, 2011 1:28 pm
Reply with quote

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
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Thu Sep 22, 2011 3:51 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Sep 22, 2011 3:57 pm
Reply with quote

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
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Thu Sep 22, 2011 4:34 pm
Reply with quote

Thanks DIck..It worked perfectly fine
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Sep 22, 2011 9:49 pm
Reply with quote

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
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Tue Sep 27, 2011 5:49 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top