Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

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

Active User


Joined: 03 Nov 2005
Posts: 269
Location: Mumbai

PostPosted: Thu Sep 22, 2011 1:28 pm    Post subject: skip records depending on sum value of two Comp-3 fields
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: 269
Location: Mumbai

PostPosted: Thu Sep 22, 2011 3:51 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Sep 22, 2011 3:57 pm    Post subject: Reply to: skip records depending on sum value of two Comp-3
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: 269
Location: Mumbai

PostPosted: Thu Sep 22, 2011 4:34 pm    Post subject:
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    Post subject:
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: 269
Location: Mumbai

PostPosted: Tue Sep 27, 2011 5:49 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us