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
 

 

Count of specific records in each member in a dataset

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

Active User


Joined: 22 Jan 2008
Posts: 195
Location: India

PostPosted: Thu Jul 31, 2008 11:16 am    Post subject: Count of specific records in each member in a dataset
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Thu Jul 31, 2008 3:12 pm    Post subject: Reply to: Count of specific records in each member in a data
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    Post subject:
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    Post subject: Reply to: Count of specific records in each member in a data
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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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 Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 6 Fri Mar 24, 2017 2:24 pm
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am


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