Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us