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

Arthematic Operators in INCLUDE COND


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

New User


Joined: 18 May 2007
Posts: 28
Location: Hyderabad

PostPosted: Tue May 24, 2011 3:30 pm
Reply with quote

I want to use arthematic operators in INCLUDE COND, to check the difference between two fields and wirte the value to output file if it is greater than 45. Is this possible using SORT ( in INCLUDE COND). If yes, Can any one please suggest.

Thanks in advance.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue May 24, 2011 3:40 pm
Reply with quote

After you did a search/read in the manual (you did, didnt you?) what conclusion you got?
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue May 24, 2011 7:24 pm
Reply with quote

You can use Inrec to specify the difference at the last of the column. Then use INCLUDE CODE to check if the difference is greater than 45.

The below code might give you some idea. Not tested it.
Code:

    SORT FIELDS=COPY                                                   
    INREC IFTHEN=(WHEN=INIT,OVERLAY=(7:04,2,ZD,SUB,1,2,ZD,LENGTH=3))   
    INCLUDE COND=(07,3,ZD,GT,+20)                                       


[/code]
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue May 24, 2011 11:27 pm
Reply with quote

gylbharat,

That will NOT work because the INCLUDE statement is processed before the INREC statement. OUTFIL INCLUDE would work since the OUTFIL statement is processed after the INREC statement.

madishpa,

You can use a DFSORT job something like this:

Code:

//S1 EXEC PGM=SORT                                               
//SYSOUT DD SYSOUT=*                                             
//SORTIN DD *                                                     
12345     12345                                                   
20000     10000                                                   
20045     20000                                                   
20046     20000                                                   
//SORTOUT DD SYSOUT=*                                             
//SYSIN DD *                                                     
  OPTION COPY                                                     
  INREC OVERLAY=(81:1,5,ZD,SUB,11,5,ZD,TO=ZD,LENGTH=8)           
  OUTFIL INCLUDE=(81,8,ZD,GT,+45),BUILD=(1,80)                   
/*


If you need more specific help, give more details of the fields, RECFM, LRECL, etc.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Wed May 25, 2011 2:38 pm
Reply with quote

Thanks Frank. This is really helpful... icon_smile.gif
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Reference for COND parameter. JCL & VSAM 1
No new posts IEF142I and Cond. Code 12 All Other Mainframe Topics 3
No new posts Cond parameter and Rc code of a proce... JCL & VSAM 5
This topic is locked: you cannot edit posts or make replies. Sort to include records of file 2 int... Java & MQSeries 1
Search our Forums:

Back to Top