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

Count of specific records in each member in a dataset


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

Active User


Joined: 22 Jan 2008
Posts: 194
Location: India

PostPosted: Thu Jul 31, 2008 11:16 am
Reply with quote

requirement is:
have a datasets aaa.bbb.ccc.
got members like a1,b1,c1,d1

each member (a1) have around 10 records, i want to count the number of records based on specific condition like the line have "CA" , like this i need to count in all members in a dataset.

the condition is same for all members as of now.

i am able to count the required record in all members individualy in each step but looking for possibility to do same for entire dataset.

Any suggestions ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jul 31, 2008 12:10 pm
Reply with quote

HappySrinu,

in the rexx manuel (or the ispf edit and edit macros) there is an example of ALLMEMS (or something like that) which provides an example of a rexx script which uses the LMM... utilities to access the name of of each pds member, then invokes ISPF EDIT with an IMACRO. Your 'singleton-counter' would be the IMACRO in this case.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jul 31, 2008 3:12 pm
Reply with quote

what about the SRCHFOR option ( interactive or batch )
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jul 31, 2008 9:48 pm
Reply with quote

Happysrinu,

The following DFSORT/ICETOOL JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=IEBPTPCH                           
//SYSPRINT DD SYSOUT=*                                 
//SYSUT1   DD DSN=YOUR PDS,                     
//            DISP=SHR                                 
//SYSUT2   DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(25,25)) 
//SYSIN    DD *                                       
  PUNCH TYPORG=PO                                     
/*               
//STEP0200 EXEC PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN       DD DSN=&&T1,DISP=SHR                                     
//OUT      DD SYSOUT=*,RECFM=FB                                     
//TOOLIN   DD *                                                     
 SPLICE FROM(IN) TO(OUT) WITHALL ON(122,8,CH) WITH(1,121) USING(CTL1)
//CTL1CNTL DD *                                                     
  SORT FIELDS=COPY                                                   
  INREC IFTHEN=(WHEN=INIT,                                           
       OVERLAY=(122:SEQNUM,8,ZD)),                                   
        IFTHEN=(WHEN=(2,6,CH,EQ,C'MEMBER'),                         
       OVERLAY=(122:SEQNUM,8,ZD,15,8)),                             
        IFTHEN=(WHEN=NONE,                                           
       OVERLAY=(130:SEQNUM,8,ZD,                                     
                122:122,8,ZD,SUB,130,8,ZD,M11,LENGTH=8))             
                                                                     
  OUTFIL FNAMES=OUT,INCLUDE=(2,80,SS,EQ,C'CA'),                     
  REMOVECC,NODETAIL,                                                 
  SECTIONS=(130,8,                                                   
  TRAILER3=('NO :OF LINES FOUND IN MEMBER ',130,8,                   
            ' FOR THE STRING CA ARE : ',COUNT))                     
/*                                               


Hope this helps...

Cheers
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jul 31, 2008 10:33 pm
Reply with quote

Happysrinu,

You can replace the DFSORT/ICETOOL step above with an an easier and more efficient way using the new WHEN=GROUP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008):

Code:

//STEP0200 EXEC PGM=ICEMAN                                           
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN=&&T1,DISP=SHR                                     
//SORTOUT  DD SYSOUT=*,RECFM=FB                                     
  SORT FIELDS=COPY                                                   
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,6,CH,EQ,C'MEMBER'),PUSH=(82:15,8))
  OUTFIL INCLUDE=(2,80,SS,EQ,C'CA',AND,2,6,CH,NE,C'MEMBER'),         
    REMOVECC,NODETAIL,                                                 
    SECTIONS=(82,8,                                                     
      TRAILER3=('NO :OF LINES FOUND IN MEMBER ',82,8,                     
            ' FOR THE STRING CA ARE : ',COUNT))                       
/*                                                                   


For complete details on the new WHEN=GROUP function and the other new functions available with PTF UK90013, see:

Use [URL] BBCode for External Links
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 To get the count of rows for every 1 ... DB2 3
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top