View previous topic :: View next topic
|
Author |
Message |
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi,
I have a PDS consisting of 300 members. My job is list all member names with pattern *DCP* . Is there any utility to achieve this at single run?
Regards
R KARTHIK |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
You can use the ISPF service LMMLIST.
O. |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi ofer71,
Can u explain how to use that LMMLIST? And also whether it is shop specific....
Regards
R KARTHIK |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
LMMLIST is an ISPF service, and like the other services it comes with ISPF. You can find a lot of examples and explanations in the fine manual and in Google.
O. |
|
Back to top |
|
|
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 194 Location: India
|
|
Back to top |
|
|
tangentray
New User
Joined: 30 Dec 2006 Posts: 20 Location: Kolkata, India
|
|
|
|
How about:
Code: |
M MY.FAVOURITE.PDS(*dcp*)
|
If you want to save the list in a flat file. Key in "SAVE LIST" on the command line and the list will be saved in <uid>.LIST.MEMBERS. |
|
Back to top |
|
|
tangentray
New User
Joined: 30 Dec 2006 Posts: 20 Location: Kolkata, India
|
|
|
|
Ignore the above, just wanted to underline ... did not work though |
|
Back to top |
|
|
tangentray
New User
Joined: 30 Dec 2006 Posts: 20 Location: Kolkata, India
|
|
|
|
Man this is irritating!! please ignore "[. u. ]...... [.\.u]" hope this prints |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi all,
I tried following REXX code and it is working
THEPDS = 'DEV2.TEST.JCL'
X = OUTTRAP('L.')
"LISTDS '"THEPDS"' MEMBERS"
X = OUTTRAP('OFF')
I=0
DO LOOP = 7 TO L.0
OLDMEM = STRIP(L.LOOP)
MEM1 = INDEX(OLDMEM,'DCP')
MEM2 = INDEX(OLDMEM,'ECP')
IF MEM1 > 0 | MEM2 > 0 THEN
DO
I=I+1
MEM.0 = I
MEM.I = OLDMEM
END
END
"ALLOC FI(DDOUT) DA(WORK.TEXT) SHR"
"EXECIO * DISKW DDOUT (STEM MEM. FINIS "
"FREE FI(DDOUT)"
"ISPEXEC VIEW DATASET(WORK.TEXT)"
But tangentray simplifies the work...Thanks man....
Thanks for HappySrinu, ofer71 for notfying about LMMLIST, LISTDS... |
|
Back to top |
|
|
ssk1711
New User
Joined: 16 Jun 2008 Posts: 40 Location: bangalore
|
|
|
|
Hi
try the below...
***************************************************
DSNAME = "****.*****"
CALL OUTTRAP "MBRS1."
"LISTD" DSNAME "MEMBERS"
CALL OUTTRAP "OFF"
DO I=7 TO MBRS1.0
IF POS('DCB',MBRS1.I) <> 0 THEN
SAY MBRS1.I /*will give the required result*/
END
****************************************************** |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
HI ssk1711,
Thnks for sharing POS command in REXX.
Regards
R KARTHIK |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I was under the impression that this request was for a batch solution. Anyway, this is what I came up with:
Code: |
//STEPX EXEC PGM=IKJEFT01,PARM='LISTDS ''THE.PDS'' MEMBERS'
//SYSTSPRT DD DSN=&&SYSTSPRT,DISP=(,PASS),UNIT=VIO
//SYSTSIN DD DUMMY
//*
//STEPY EXEC PGM=ICETOOL
//IN DD DSN=&&SYSTSPRT,DISP=(OLD,DELETE)
//T1 DD UNIT=VIO,RECFM=FB
//OUT DD DSN=OUTPUT.LIST,DISP=(,CATLG,DELETE),....
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(T1) USING(CTL2)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,CONVERT,STARTREC=7,INCLUDE=(5,3,CH,EQ,C' '),
BUILD=(8,8,80:X)
/*
//CTL2CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(1,8,SS,EQ,C'DCP')
/*
|
|
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi SUPERK,
Since i have SYSNSORT in my shop, ur code doesnt work out for me.
But thanks for sharing IKJEFT01 PGM.
Regards
R KARTHIK |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Here is the LMMLIST solution (of course, you can run it in batch):
Code: |
/* REXX */
ADDRESS ISPEXEC "LMINIT DATAID(EZTID) DATASET('your_pds')"
ADDRESS ISPEXEC "LMOPEN DATAID(&EZTID)"
DO FOREVER
ADDRESS ISPEXEC "LMMLIST DATAID(&EZTID) OPTION(LIST) MEMBER(MEMNAME)",
"PATTERN(DCP*)"
IF RC = 8 THEN LEAVE
SAY MEMNAME
END
ADDRESS ISPEXEC "LMCLOSE DATAID(&EZTID)"
ADDRESS ISPEXEC "LMFREE DATAID(&EZTID)"
EXIT
|
O. |
|
Back to top |
|
|
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 183 Location: hyderabad
|
|
|
|
Quote: |
Since i have SYSNSORT in my shop, ur code doesnt work out for me.
|
karthikr44,
The above code given by superk will work for SYNCSORT as well.Run and check the above code.
Thanks
Krishy |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
@sril.krishy & karthikr44 :
Using Syncsort, Pgm must be SYNCTOOL |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi,
Sounds like a one shot deal, so you might try this and then edit OUTDD to show only the member names:
Code: |
//SEARCH EXEC PGM=ISRSUPC,
// PARM=(SRCHCMP,'ANYC')
//NEWDD DD DSN=yrDSN,
// DISP=SHR
//OUTDD DD DSN=yrDSN,
// DISP=OLD (can be NEW)
//SYSIN DD *
SRCHFOR '*DCP*'
// |
You can search for multi strings:
Code: |
SRCHFOR '*DCP*',
SRCHFOR '*ABC*',
.
.
.
SRCHFOR '*XYZ*' |
|
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
mmwife -
The SRCHFOR statement will look for the string within the members. I believe the O/P wanted to filter the member names.
In addition, the fine manual says nothing about a pattern characters for the SRCHFOR value.
O. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
In addition, the fine manual says nothing about a pattern characters for the SRCHFOR value |
The value specified (without the asterisks) is used as a "pattern" and the entire record is searched for the pattern/value.
Quote: |
I believe the O/P wanted to filter the member names |
Mee too |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Dick -
Quote: |
The value specified (without the asterisks) is used as a "pattern" and the entire record is searched for the pattern/value. |
I double-checked myself now. There is no "pattern" search in SUPERC.
When you specify SRCHFOR *DCP*, SUPERC will look for the string "*DCP*".
O. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi O,
Quote: |
I double-checked myself now. There is no "pattern" search in SUPERC.
When you specify SRCHFOR *DCP*, SUPERC will look for the string "*DCP*".
|
Yup, we're both saying the same thing . . .
If the "*DCP*" is changed to "DCP" the search returns everything that matches - kinda like a "pattern". It is just not called a pattern
d |
|
Back to top |
|
|
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 183 Location: hyderabad
|
|
|
|
Quote: |
Using Syncsort, Pgm must be SYNCTOOL
|
UmeySan,
SYNCSORT is provided the Synonym option.So,SYNCSORT will be automatically invoked when we code ICETOOL as PGM.
Thanks
Krishy |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Oops! I misread the OP. |
|
Back to top |
|
|
|