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
 

 

Conditional inrec and outrec

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

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Tue Jul 15, 2008 1:02 pm    Post subject: Conditional inrec and outrec
Reply with quote

Hi ppl,
I've the following jcl
It will group records with its sum based on the condition given.

Code:

//STEP01    EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                             
  NAME1    SECOND                                           
  NAME1    FIRST                                             
  NAME1    THIRD                                             
  NAME1    FOURTH                                           
  NAME2    THIRD                                             
  NAME2    SECOND                                           
  NAME2    FIRST                                             
  NAME2    FOURTH                                           
  NAME2    FIFTH                                             
  NAME4    FIRST                                             
  NAME3    FIRST                                             
  NAME3    SECOND                                           
  NAME3    THIRD                                             
  NAME5    FIRST                                             
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                             
   INREC IFTHEN=(WHEN=INIT,OVERLAY=(25:C'1'))               
   SORT FIELDS=(3,5,CH,A)                                   
    SUM FIELDS=(25,1,ZD)                                           
    INCLUDE COND=(3,5,CH,EQ,C'NAME1',OR,3,5,CH,EQ,C'NAME2',OR,     
    3,5,CH,EQ,C'NAME3')                                           
    OUTREC BUILD=(5:1,25)                                         
/*   


The output is getting displayed as

Code:

 NAME1    SECOND     4
 NAME2    THIRD      5
 NAME3    FIRST      3


I need to display records only with the count greater than or equal to 4.
How do i eliminate the other records??
Can we have conditions in INREC and OUTREC?
Back to top
View user's profile Send private message

Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue Jul 15, 2008 4:04 pm    Post subject:
Reply with quote

Yes you can have conditions in INREC and OUTREC. In this case you can try using OUTREC IFTHEN=(WHEN=(25,1,ZD,GE,4)
Back to top
View user's profile Send private message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Tue Jul 15, 2008 4:05 pm    Post subject:
Reply with quote

Ya.. I gave the following statements to achieve the result.

Code:

   OUTFIL FNAMES=OUT1,OMIT=(300,1,ZD,LE,3)
      OUTREC FIELDS=(1:1,300)     


Thanks...
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 SORT- outrec ram_vizag DFSORT/ICETOOL 10 Tue Sep 27, 2016 12:50 am
No new posts OUTREC FILELDS FAILS WITH ICE126A 2 ... balaji81_k DFSORT/ICETOOL 8 Sat Jul 02, 2016 1:22 am
No new posts OUTREC RDW NOT INCLUDED krsenthil85 SYNCSORT 10 Fri May 06, 2016 3:22 am
No new posts What does this INREC do? Lino Pontes DFSORT/ICETOOL 5 Fri Apr 08, 2016 12:17 am
No new posts Help needed in Conditional statement ... vinu78 DB2 5 Tue Sep 15, 2015 10:14 am


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