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

Conditional inrec and outrec


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Conditional EATTR in MFS ? IMS DB/DC 0
No new posts Conditional replace values in output ... DFSORT/ICETOOL 3
No new posts question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
No new posts INREC PARSE used to sort a CSV file DFSORT/ICETOOL 2
No new posts Sort w/OUTREC Question DFSORT/ICETOOL 2
Search our Forums:

Back to Top