View previous topic :: View next topic |
Author |
Message |
Wallaby Bob Beginner
Joined: 02 Feb 2004 Posts: 2 Topics: 1 Location: Sydney
|
Posted: Mon Feb 02, 2004 8:25 pm Post subject: Batch utility to write PDS member list to sequential file |
|
|
Does anybody know of or have any JCL for a utility that will write a PDS member list to a sequential file?
I did this about 8 years ago but can't remember the tool I used to generate the PDS member list.
Examples of JCL would be greatly apreciated. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Tue Feb 03, 2004 6:17 am Post subject: |
|
|
Wallaby Bob,
The following JCL will give you the desired results.
Code: |
//STEP10 EXEC PGM=IKJEFT01
//SYSTSPRT DD DSN=YOUR PDS MEM LISTING
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(1,1),RLSE),
// UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSTSIN DD *
LISTDS 'your pds name' MEMBERS
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Wallaby Bob Beginner
Joined: 02 Feb 2004 Posts: 2 Topics: 1 Location: Sydney
|
Posted: Tue Feb 03, 2004 4:52 pm Post subject: |
|
|
Kolusu,
Thanks. That worked perfectly.
Wallaby Bob. |
|
Back to top |
|
|
shiv_swami Beginner
Joined: 29 Nov 2003 Posts: 68 Topics: 14
|
Posted: Wed Feb 04, 2004 4:01 am Post subject: |
|
|
Hi,
We can create member list along with other attributes by saying "Save LIST" at the command line when we browse/view a PDS.
It would be something like this..
Code: | ADSRP 01.04 04/01/07 11:32 31 25 17 G1NXQBT
ADSRPCEF 01.11 04/01/29 06:26 29 30 20 G1NXQBT |
The list will be saved in dataset called as &sysuid..LIST.members.
This has quite useful information.Can this be done in batch _________________ Regards,
Shivprakash |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Feb 04, 2004 4:19 pm Post subject: |
|
|
Here is a Rexx routine written by DOUG NADEL. you can customize this for writting it to a dataset.
Code: |
/*REXX ROUTINE TO READ A PDS DIRECTORY AND SHOW THE ISPF STATS */
/* NON LOAD MODULE ONLY. */
/* AUTHOR: DOUG NADEL */
PARSE UPPER ARG DSNAME .
IF 0<>LISTDSI(DSNAME) THEN
DO
SAY 'DATA SET 'DSNAME' NOT ALLOCATED'
EXIT
END
IF 'PO'<>SUBSTR(SYSDSORG,1,2) THEN
DO
SAY 'DATA SET 'DSNAME' IS NOT A PDS'
EXIT
END
ADDRESS TSO
'ALLOC F(AREAD) DS('DSNAME') SHR REUSE DSORG(PS) LRECL(256) RECFM(F B)
'EXECIO * DISKR AREAD ( FINIS STEM DIRS.'
'FREE F(AREAD)'
DO BLOCKNUM = 1 TO DIRS.0
BLOCK=DIRS.BLOCKNUM
PARSE VAR DIRS.BLOCKNUM BL 3 BLOCK
BLOCK=SUBSTR(BLOCK,1,C2D(BL)-2)
DO WHILE BLOCK<>''
PARSE VAR BLOCK NAME 9 TTR 12 C 13 BLOCK
C=C2D(BITAND(C,'1F'X))
IF NAME='FFFFFFFFFFFFFFFF'X THEN
LEAVE BLOCKNUM
STATS=''
IF C=15 & SYSRECFM \= 'U' THEN
STATS=DECODESTATS(SUBSTR(BLOCK,1,30))
SAY NAME STATS
BLOCK=DELSTR(BLOCK,1,C*2)
END
END
EXIT
DECODESTATS: PROCEDURE /* DECODE THE DIRECTORY */
DIRENTRY=ARG(1)
PARSE VAR DIRENTRY,
VV 2 MM 3 FLAGS 4 SS 5 CRECC 6 CRDATE 9 MODCC 10 MODDATE 13 HH,
14 TM 15 LINES 17 INIT 19 MOD 21 USERID 28 .
PARSE VALUE C2X(CRDATE) WITH CYY 3 CJJJ 6 .
PARSE VALUE C2X(MODDATE) WITH MYY 3 MJJJ 6 .
OUT=LEFTD(VV)'.'LEFTD(MM) /* VV.MM */
OUT=OUT 19+C2X(CRECC)CYY'.'CJJJ /* CREATE DATE */
OUT=OUT 19+C2X(MODCC)MYY'.'MJJJ /* MOD DATE */
OUT=OUT LEFTX(HH)':'LEFTX(TM)':'LEFTX(SS) /* MOD TIME */
OUT=OUT RIGHT(C2D(LINES),5) /* LINES */
OUT=OUT RIGHT(C2D(INIT),5) /* INITIAL LINES */
OUT=OUT RIGHT(C2D(MOD),5) /* MOD LINES */
OUT=OUT USERID /* USER ID */
IF BITAND(FLAGS,'80'X) = '80'X THEN
OUT=OUT '(SCLM)' /* SAVED BY SCLM */
RETURN OUT
LEFTD: RETURN RIGHT(C2D(ARG(1)),2,'0')
LEFTX: RETURN RIGHT(C2X(ARG(1)),2,'0')
|
Another way to do is that You can run ISPF in a batch job that calls a REXX procedure that uses ISPF services(LMINIT, LMOPEN and LMMLIST with the SAVE option)
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
manojagrawal Beginner
Joined: 25 Feb 2003 Posts: 124 Topics: 29
|
Posted: Thu Feb 12, 2004 12:41 pm Post subject: |
|
|
Hi,
Both the job above and the save list worked perfectly (Dont know Rexx).
Is it possible to get the output like the savelist using a job?
Is it possible to re-direct the output of savelist to a specific dataset? _________________ Thanks & Regards,
Manoj. |
|
Back to top |
|
|
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Thu Feb 12, 2004 2:36 pm Post subject: |
|
|
Hi Mano,
As Shiv stated earlier you can use ISPF 3.4 to display a dataset list or a PDS member list.
If you enter "save x" on the cmd line where:
x = any 8 chars beginning with an alpha char
A sequential dataset with the name "yourTSOid.x.y" is created where:
x = the 8 chars you entered in the cmd
y = "datasets" if you requested a ds list
or
y = "members" if you requested a members list
Regards, Jack.
P.S. It may be member/dataset (without the "s").Can't recall. |
|
Back to top |
|
|
manojagrawal Beginner
Joined: 25 Feb 2003 Posts: 124 Topics: 29
|
Posted: Fri Feb 13, 2004 10:16 am Post subject: |
|
|
Hi Jack,
Its members Thanks! _________________ Thanks & Regards,
Manoj. |
|
Back to top |
|
|
psridhar Beginner
Joined: 16 May 2004 Posts: 68 Topics: 26
|
Posted: Thu Feb 02, 2006 10:20 am Post subject: |
|
|
Hi Kolusu,
In my REXX tool, I need to find out the change date and user of a member in a PDS. I am using the Rexx routine written by DOUG NADEL. But the problem here is my PDS has around 10000 members and I need to just find out the SCML details of one (input) member.
Can you please suggest me the changes required to the routine so that it will fetch the details only for the required member.
Thanks in advance
Sridhar P |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Thu Feb 02, 2006 7:04 pm Post subject: |
|
|
The routine reads a PDS directory and PDS directories are basically sequential sorted files so you have to just check for the member you are looking for within the loop. This exec was written for the rare times that you need to get ISPF statistics from within TSO but outside of ISPF. If you are running within ISPF though, use the LMMFIND service with STATS(YES) to get whatever info you need. |
|
Back to top |
|
|
bablack Beginner
Joined: 04 Dec 2002 Posts: 71 Topics: 0 Location: Little Falls, NJ
|
Posted: Fri Feb 03, 2006 4:43 pm Post subject: |
|
|
You can do it with the IBM IEHLIST utility
//STEP1 EXEC PGM=IEHLIST
//SYSPRINT DD output dataset
//DD2 DD UNIT=3390,VOLUME=SER=vvvvvv,DISP=OLD
//SYSIN DD *
LISTPDS DSNAME=dsname,VOL=3390=vvvvvv _________________ Bruce A. Black
Senior Software Developer
Innovation Data Processing |
|
Back to top |
|
|
|
|