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
 

 

Arthematic Operators in INCLUDE COND

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

New User


Joined: 18 May 2007
Posts: 27
Location: Hyderabad

PostPosted: Tue May 24, 2011 3:30 pm    Post subject: Arthematic Operators in INCLUDE COND
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: 2435
Location: Netherlands, Amstelveen

PostPosted: Tue May 24, 2011 3:40 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue May 24, 2011 11:27 pm    Post subject:
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    Post subject:
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    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 Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts COND parameter vs IF THEN ELSE Alks JCL & VSAM 11 Fri Jun 17, 2016 5:28 pm


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