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
 

 

About the solution of running ISPF in batch
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
feng hao

New User


Joined: 26 Mar 2008
Posts: 44
Location: China

PostPosted: Mon Apr 18, 2011 3:03 pm    Post subject: About the solution of running ISPF in batch
Reply with quote

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
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Apr 18, 2011 3:08 pm    Post subject: Reply to: About the solution of running ISPF in batch
Reply with quote

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
View user's profile Send private message
Peter Nancollis

New User


Joined: 15 Mar 2011
Posts: 47
Location: UK

PostPosted: Tue Apr 19, 2011 2:23 am    Post subject:
Reply with quote

Quote:
The question is that, is it possible to implement above requirement by pure JCL without REXX or CLIST?

No
Back to top
View user's profile Send private message
feng hao

New User


Joined: 26 Mar 2008
Posts: 44
Location: China

PostPosted: Sun Apr 24, 2011 6:59 pm    Post subject:
Reply with quote

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
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Mon Apr 25, 2011 1:17 pm    Post subject: Reply to: About the solution of running ISPF in batch
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Apr 25, 2011 3:09 pm    Post subject:
Reply with quote

*Pose* - for this, why not just create a macro in your emulator (PCOM, I can help with).
Back to top
View user's profile Send private message
Michael Jakob

New User


Joined: 13 Mar 2011
Posts: 17
Location: Switzerland

PostPosted: Fri Apr 29, 2011 4:29 am    Post subject: sample of your request
Reply with quote

/* 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
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Fri Apr 29, 2011 6:23 am    Post subject: Reply to: About the solution of running ISPF in batch
Reply with quote

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
View user's profile Send private message
Srileka

New User


Joined: 21 Jun 2007
Posts: 19
Location: India

PostPosted: Wed May 04, 2011 6:09 pm    Post subject: Reply to: About the solution of running ISPF in batch
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed May 04, 2011 6:22 pm    Post subject: Reply to: About the solution of running ISPF in batch
Reply with quote

should not take long to test with different GROUP(<something>) tokens !
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Wed May 04, 2011 6:48 pm    Post subject: Reply to: About the solution of running ISPF in batch
Reply with quote

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
View user's profile Send private message
anatol

New User


Joined: 20 May 2010
Posts: 99
Location: canada

PostPosted: Thu May 05, 2011 1:36 am    Post subject:
Reply with quote

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
View user's profile Send private message
anatol

New User


Joined: 20 May 2010
Posts: 99
Location: canada

PostPosted: Thu May 05, 2011 3:57 am    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu May 05, 2011 4:22 am    Post subject: Reply to: About the solution of running ISPF in batch
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu May 05, 2011 4:46 am    Post subject: Reply to: About the solution of running ISPF in batch
Reply with quote

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
View user's profile Send private message
anatol

New User


Joined: 20 May 2010
Posts: 99
Location: canada

PostPosted: Thu May 05, 2011 5:22 am    Post subject:
Reply with quote

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
View user's profile Send private message
anatol

New User


Joined: 20 May 2010
Posts: 99
Location: canada

PostPosted: Thu May 05, 2011 5:24 am    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu May 05, 2011 5:31 am    Post subject: Reply to: About the solution of running ISPF in batch
Reply with quote

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 icon_cool.gif

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
View user's profile Send private message
Srileka

New User


Joined: 21 Jun 2007
Posts: 19
Location: India

PostPosted: Mon May 09, 2011 6:57 pm    Post subject: Reply to: About the solution of running ISPF in batch
Reply with quote

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
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 985
Location: Oostende, Belgium

PostPosted: Mon May 09, 2011 7:30 pm    Post subject:
Reply with quote

Add a
Code:
DROP LSTID

after the LMDFREE.
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 -> TSO/ISPF All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
This topic is locked: you cannot edit posts or make replies. MIPS reduction for Batch job Virendra Shambharkar All Other Mainframe Topics 8 Mon Nov 07, 2016 4:02 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts ISPF program to set SCRNAME prino TSO/ISPF 5 Fri Sep 30, 2016 2:18 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm


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