|
|
| Author |
Message |
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 191 Location: India
|
|
|
|
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 |
|
 |
References
|
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1633 Location: germany
|
|
|
|
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 |
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 3153 Location: italy
|
|
|
|
| what about the SRCHFOR option ( interactive or batch ) |
|
| Back to top |
|
 |
Skolusu
DFSORT Developer
Joined: 07 Dec 2007 Posts: 357 Location: San Jose
|
|
|
|
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 |
|
 |
Skolusu
DFSORT Developer
Joined: 07 Dec 2007 Posts: 357 Location: San Jose
|
|
|
|
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 |
|
 |
|
|
|