View previous topic :: View next topic
|
Author |
Message |
feng hao
New User
Joined: 26 Mar 2008 Posts: 44 Location: China
|
|
|
|
Hi,
There is a requirement which running below operations in batch mode.
1. Type 3.4 under ISPF and go into DS list panel;
2. Then type HLQ.A.B*.C*, and press enter;
3. Get the data set list after above operations and store it in a dataset.
The question is that, is it possible to implement above requirement by pure JCL without REXX or CLIST?
And it would be quite appreciated if you could provide a "hello world"-like JCL example which interfaces with ISPF services. Then I might change and revision it by referring to IBM redbooks. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
the issue has been debated quite a few times...
what happened when You searched the forums
Quote: |
The question is that, is it possible to implement above requirement by pure JCL |
again for the zillionth time ...
JCL does not do anything on its own... It is just used to provide to the system the informations needed to run a program... |
|
Back to top |
|
|
Peter Nancollis
New User
Joined: 15 Mar 2011 Posts: 47 Location: UK
|
|
|
|
Quote: |
The question is that, is it possible to implement above requirement by pure JCL without REXX or CLIST?
|
No |
|
Back to top |
|
|
feng hao
New User
Joined: 26 Mar 2008 Posts: 44 Location: China
|
|
|
|
Thank you very much, guys.
To enrico-sorichetti,
I understood your meaning and it was my mistake that I meant only the utility without programming.
To Peter Nancollis,
Yes, Peter, I got it and now I use REXX which calls LMDINIT & LMDLIST, under ISPF host environment which is established by ISPSTART.
Thank you so much for all of your comments, agian! |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
My answer was going to be yes, you have to use a program to call ISPF Dialog Services, but no, it does not have to be written in REXX or CLIST. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
*Pose* - for this, why not just create a macro in your emulator (PCOM, I can help with). |
|
Back to top |
|
|
Michael Jakob
New User
Joined: 13 Mar 2011 Posts: 17 Location: Switzerland
|
|
|
|
/* REXX - This REXX must be started with ISPSTART */
/* Pattern of dataset name must be provided as parameter */
/* Assuming DDMYOUT is allocated in JCL as output-file*/
arg myLevel
/* Prepare Dataset list */
ADDRESS 'ISPEXEC',
"LMDINIT LISTID(MYDLIST) LEVEL(myLevel)"
/* Get first entry */
ADDRESS 'ISPEXEC',
"LMDLIST LISTID(&MYDLIST) OPTION(LIST) DATASET(MYDSN)"
WRC = RC;
DO WHILE(WRC = 0);
/* Whatever you like to do with your Dataset name*/
/* For example: writing to a file */
WDSN.0 = 1;
WDSN.1 = MYDSN;
EXECIO * DISKW DDMYOUT (STEM WDSN.
/* get following entries */
ADDRESS 'ISPEXEC',
"LMDLIST LISTID(&MYDLIST) OPTION(LIST) DATASET(MYDSN) STATS(YES)"
WRC = RC;
END;
/* clear dataset list */
ADDRESS 'ISPEXEC',
"LMDLIST LISTID(&MYDLIST) OPTION(FREE) DATASET(MYDSN) STATS(YES)"
WDSN.0 = 0;
WDSN.1 = '';
EXECIO 0 DISKW DDMYOUT (STEM WDSN. FINIS
ADDRESS 'ISPEXEC',
"LMDFREE LISTID(&MYDLIST)"
EXIT 0
/* this solution is not tested! */ |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Michael, welcome to the forum.
Quote: |
3. Get the data set list after above operations and store it in a dataset. |
The original requirement was to save the list, so I think rather than
LMDLIST ... OPTION(LIST), you should use OPTION(SAVE). |
|
Back to top |
|
|
Srileka
New User
Joined: 21 Jun 2007 Posts: 19 Location: India
|
|
|
|
Hi,
I have a doubt. When we use OPTION(SAVE) in LMDLIST, is it possible to route the output to a user defined dataset?
The manual says, we can give GROUP and the output dataset would be userid.group.DATASETS or prefix.userid.group.DATASETS. I have many dataset masks for which i need the matching dataset list. So for each LMDLIST command the dataset userid.group.DATASETS would be over written. To avoid this I want to use different dataset names for each LMDLIST.
Thanks,
Srileka.V |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
should not take long to test with different GROUP(<something>) tokens ! |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
It seems like LMDLIST does not exactly fit your naming requirements.
I suggest you follow LMDLIST with:
Code: |
Address TSO "RENAME old.name new.name" |
|
|
Back to top |
|
|
anatol
Active User
Joined: 20 May 2010 Posts: 121 Location: canada
|
|
|
|
If I understood the request - JCL to get list of datasets in file without REXX
Here:
//STEP01 EXEC PGM=IKJEFT01,DYNAMNBR=200
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//OUTDD DD DISP=OLD,DSN=IS10709.LISTC.REPORT
//SYSTSIN DD *
LISTC LV(HLQ.A.B*.C*') OUTFILE(OUTDD)
The list then you can select by SORT or ICETOOL as next step , if format :
IDCAMS SYSTEM SERVICES
NONVSAM ------- HLQ.A.BBB.CCCC
IN-CAT --- UCAT.#volume
is not aceptable |
|
Back to top |
|
|
anatol
Active User
Joined: 20 May 2010 Posts: 121 Location: canada
|
|
|
|
here is the 2 steps jcl which give you clean list of datasets
//STEP01 EXEC PGM=IKJEFT01,DYNAMNBR=200
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//OUTDD DD DISP=OLD,DSN=out_dsn
//SYSTSIN DD *
LISTC LV('HLQ.A.B*.C*') OUTFILE(OUTDD)
//*********************************************************
//STEP02 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=OLD,DSN=out_dsn
//SORTOUT DD ISP=OLD,DSN=report dsn
//SYSIN DD *
OPTION COPY
INCLUDE COND=(6,15,CH,EQ,C'NONVSAM -------')
INREC FINDREP=(IN=C'NONVSAM -------',OUT=C'')
The OUTDD dataset recm is VBA |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Code: |
LISTC LV('HLQ.A.B*.C*') OUTFILE(OUTDD) |
Could You please post evidence that the suggested syntax works and You do not get , for example
Code: |
IDC3211I KEYWORD 'LV' IS IMPROPER |
and when You fix it using the proper construct
Code: |
LISTC LEVEL('HLQ.A.B*.C*') OUTFILE(OUTDD) |
You do not get
Code: |
IDC3203I ITEM 'HLQ.A.B*.C*' DOES NOT ADHERE TO RESTRICTIONS |
maybe the system I tested it is behind with maintenance ! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
a better alternative would be the use of the IGGCSI00 catalog interface
which has a much better filtering capability
and can report according to the required pattern layout
search the forums for samples on its usage |
|
Back to top |
|
|
anatol
Active User
Joined: 20 May 2010 Posts: 121 Location: canada
|
|
|
|
The LV abbreviation evidence is:
Code: |
Jobs Resources Devices Tools Filter View Options Help
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
OPCTST JOB31137 < . .JESYSMSG> Line 55 of 70
Command ===> Scroll ===> CSR
Current Find Text: IMPROPER Dataset 3 of 4
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+---->
IEFACT3I EXCP: 0 DASD: 0 VIO: 0 OTHER - MOUNTS:
*
IEF375I JOB/OPCTST /START 2011124.1927
IEF376I JOB/OPCTST /STOP 2011124.1927 CPU 0MIN 00.02SEC SRB 0MIN 00.00S
1READY
LISTC LV('CBADEV.IS10709.*.JCL')
NONVSAM ------- CBADEV.IS10709.CONVERT.JCL
IN-CAT --- UCAT.#SIS335
NONVSAM ------- CBADEV.IS10709.DTCU.JCL
IN-CAT --- UCAT.#SIS335
NONVSAM ------- CBADEV.IS10709.SAMPLE.JCL
IN-CAT --- UCAT.#SIS335
NONVSAM ------- CBADEV.IS10709.SAMPLE.JCL.OLD
IN-CAT --- UCAT.#SIS335
READY
END
******************************** Bottom of Data ******************************** |
but you can use only full mask of qualifier ... HLQ.*.JCL is valid HLQ.A*.JCL is not ... but you can use sort to filter it |
|
Back to top |
|
|
anatol
Active User
Joined: 20 May 2010 Posts: 121 Location: canada
|
|
|
|
the LV evidance is:
Code: |
Jobs Resources Devices Tools Filter View Options Help
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
OPCTST JOB31137 < . .JESYSMSG> Line 55 of 70
Command ===> Scroll ===> CSR
Current Find Text: IMPROPER Dataset 3 of 4
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+---->
IEFACT3I EXCP: 0 DASD: 0 VIO: 0 OTHER - MOUNTS:
*
IEF375I JOB/OPCTST /START 2011124.1927
IEF376I JOB/OPCTST /STOP 2011124.1927 CPU 0MIN 00.02SEC SRB 0MIN 00.00S
1READY
LISTC LV('CBADEV.IS10709.*.JCL')
NONVSAM ------- CBADEV.IS10709.CONVERT.JCL
IN-CAT --- UCAT.#SIS335
NONVSAM ------- CBADEV.IS10709.DTCU.JCL
IN-CAT --- UCAT.#SIS335
NONVSAM ------- CBADEV.IS10709.SAMPLE.JCL
IN-CAT --- UCAT.#SIS335
NONVSAM ------- CBADEV.IS10709.SAMPLE.JCL.OLD
IN-CAT --- UCAT.#SIS335
READY
END
******************************** Bottom of Data ******************************** |
But you can use only full mask of qualifier... HLQ.*.JCL is valid, HLQ.A*.JCL is not... but you can use sort to filter it |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
My bad for the lv ( tested with the batch idcams instead of the tso command )
but tested
Your bad for the mask!
nott tested
and I gave evidence that before posting I tested, You did not
Quote: |
But you can use only full mask of qualifier... HLQ.*.JCL is valid, HLQ.A*.JCL is not... but you can use sort to filter it |
that' s not what You suggested in the first post of yours
usually when posting solutions it is a good practice to make sure that they are completely tested beforehand
I still believe that using IGGCSI00 is the fastest way out
the filtering is done in a smart way by the catalog interface itself
and the whole shebang will consist in just using expat' s example or
adding a do loop and taking avay some unised lines in the IGGCSIRX in sys1.samplib
or another way is to investigate ismf filtering capabilities and batch execution thru NAVIQUEST |
|
Back to top |
|
|
Srileka
New User
Joined: 21 Jun 2007 Posts: 19 Location: India
|
|
|
|
Thanks for your response. I have written the contents of the default file to a personal dataset. Below is my code. Now I am getting RC as 10 for the second time execution of LMDLIST and LMDFREE command, (RC for LMDINIT is 0). Only for the first mask i am getting expected results - list being saved in default dataset, contents are copied to personal dataset, deleting default dataset, all commands give RC 0.
Note:
I am running this REXX in JCL, so allocated all the files in the JCL.
Code: |
DROP INPREC.
DROP REPORT.
I=0
J=0
ADDRESS TSO
"EXECIO * DISKR INPUT (STEM INPREC. FINIS"
ADDRESS ISPEXEC
DO I = 1 TO INPREC.0
MASK = STRIP(INPREC.I)
ADDRESS ISPEXEC
"LMDINIT LISTID("LSTID") LEVEL("MASK")"
"LMDLIST LISTID("LSTID") OPTION(SAVE) GROUP("DSN") STATS(YES)"
"LMDFREE LISTID("LSTID")"
J = J + 1
COUNT = ZDLDST
REPREC.J = MASK || COUNT
ADDRESS TSO
UID = SYSVAR('SYSUID')
"ALLOC FI(DSNFL) DA('" || UID || ".DSN.DATASETS') SHR REUSE"
"EXECIO * DISKR DSNFL (STEM DSNREC. FINIS"
"EXECIO * DISKW DSLIST (STEM DSNREC. FINIS"
"DELETE '" || UID || ".DSN.DATASETS'"
END
ADDRESS TSO
"EXECIO * DISKW REPORT (STEM REPREC. FINIS"
EXIT |
Thanks,
Srileka.V |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
Add a
after the LMDFREE. |
|
Back to top |
|
|
Srileka
New User
Joined: 21 Jun 2007 Posts: 19 Location: India
|
|
|
|
Excellent! Its working now... Thanks a lot.
Only the output file writing part is not working - getting only the results of the of first list. I know the reason and i can correct it. Thanks for the fix.
Thanks,
Srileka.V |
|
Back to top |
|
|
|