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
 
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 OUTREC with ALter Command scorp_rahul23 DFSORT/ICETOOL 1 Wed Nov 22, 2017 3:10 pm
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm

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