Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Removing tapes from the library with JCL
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 6471
Location: Brussels once more ...

PostPosted: Fri Jul 03, 2009 4:12 pm    Post subject:
Reply with quote

Quote:

"ADDRESS ISPEXEC "LIBDEF ISPSLIB DATASET ID()""
"ADDRESS ISPEXEC "LIBDEF ISPSLIB DATASET ID('XXXXXXXX')" STACK"
Why is STACK used at the end of the statement? And why is the first line necessary?

The first line clears any pre existing LIBDEF statements
Can not recall why I used STACK but it is explained in the manuals.
The manuals are easily reached from the sticky at the top of the forum topics in the REXX/CLIST forum.

Quote:

"ISPEXEC FTINCL TEST00"
How is TEST00 processed? It says FTINCL is an ISPF command for processing skeleton's, but TEST00 is never declared?

TEST00 is a JCL skeleton stored in the ISPSLIB referenced by the LIBDEF.

Quote:

Could you please explain a bit the ERR procedure? Why are there two identical statements at the beginning? What does it do to the trapped synthax errors? (Outputs the faulty line?)

Two identical statements - originally for foreground use, issue the error message twice - bit more of an eye catcher.

Basically the procedure executes the line in error as the last thing before the exec stops - but uses TRACE I which is the most informative form of the TRACE command and shows all of the substitutions as they happen giving maximum info about the failure.
Back to top
View user's profile Send private message
References
Ivan P

New User


Joined: 08 Jun 2009
Posts: 47
Location: Europe

PostPosted: Fri Jul 03, 2009 4:38 pm    Post subject:
Reply with quote

expat wrote:
Can not recall why I used STACK but it is explained in the manuals.
I've been reading mostly REXX Reference and Users's Guide, and haven't been able to find it there. In the REXX Reference book, under ADDRESS there is no mention of STACK, just the environment and the expression, but it's clear that STACK is outside the expression here.
expat wrote:
TEST00 is a JCL skeleton stored in the ISPSLIB referenced by the LIBDEF.
Does it mean LIBDEF creates this skeleton with the ISPEXEC command at the beginning? (because it doesn't exist in ISP.SISPSLIB by default)
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 6471
Location: Brussels once more ...

PostPosted: Fri Jul 03, 2009 4:44 pm    Post subject:
Reply with quote

Quote:
I've been reading mostly REXX Reference and Users's Guide, and haven't been able to find it there. In the REXX Reference book, under ADDRESS there is no mention of STACK, just the environment and the expression, but it's clear that STACK is outside the expression here.

Take a look in the ISPF services manual, it explains LIBDEF in more detail.

Quote:
Does it mean LIBDEF creates this skeleton with the ISPEXEC command at the beginning? (because it doesn't exist in ISP.SISPSLIB by default)

No, the skeleton is created by you. The LIBDEF only tells ISPF which library to search for the skeleton before the normal ISPF concatenation.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 5391
Location: italy

PostPosted: Fri Jul 03, 2009 4:49 pm    Post subject: Reply to: Removing tapes from the library with JCL
Reply with quote

Quote:
I've been reading mostly REXX Reference and Users's Guide, and haven't been able to find it there. In the REXX Reference book, under ADDRESS there is no mention of STACK, just the environment and the expression, but it's clear that STACK is outside the expression here.


STACK is not REXX related, is a parm/option related to ISPF LIBDEF
so the explanation would rather be in the ISPF manual
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 47
Location: Europe

PostPosted: Fri Jul 03, 2009 5:20 pm    Post subject:
Reply with quote

expat wrote:
No, the skeleton is created by you. The LIBDEF only tells ISPF which library to search for the skeleton before the normal ISPF concatenation.
Oh, I misunderstood... I thought XXXXXXX is a sequential data-set, not a library, sorry! (newbie...)
So, TEST00 is a member in XXXXXXX dataset. Hope I got it right this time. icon_rolleyes.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 6471
Location: Brussels once more ...

PostPosted: Fri Jul 03, 2009 5:23 pm    Post subject:
Reply with quote

100% correct icon_biggrin.gif
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 47
Location: Europe

PostPosted: Tue Jul 07, 2009 6:38 pm    Post subject: Reply to: Removing tapes from the library with JCL
Reply with quote

Ran into some trouble... Maybe this is more suitable for the REXX sub-forum now?

Here's the situtation:

2 DS are used:
MYUSER.DITTO.RES - sequential DS, contains just the VOLSERs list
MYUSER.PRIVLIB - PDS with members: DITTOJCL, DITTOREX, REXXEXEC

DITTOJCL - skeleton
DITTOREX - REXX code
REXXEXEC - JCL for running REXX

DITTOJCL skelton
Code:
//Z0DT&JNM. JOB NOTIFY=MYUSER,CLASS=S,MSGCLASS=X
//DITTO1   EXEC PGM=DITTO
//SYSPRINT DD  SYSOUT=*
//TAPE1    DD  UNIT=&UNIT.,DISP=SHR,LABEL=(,BLP),VOL=SER=&VOLSER.
//SYSIN    DD *
$$DITTO ERT OUTPUT=TAPE1
$$DITTO EOJ
//

DITTOREX code (thnx to expat)
Code:
SIGNAL ON SYNTAX NAME ERR                                             
                                                                     
ADDRESS ISPEXEC "LIBDEF ISPSLIB DATASET ID()"                         
ADDRESS ISPEXEC "LIBDEF ISPSLIB DATASET ID('MYUSER.PRIVLIB')" STACK
                                                                     
SYSUID = SYSVAR(SYSUID)                                               
"FREE  FI(ISPFILE,INDD)"                                             
"ALLOC FI(INDD) DA('MYUSER.DITTO.RES') SHR"                       
"DEL  '"SYSUID".ISPFILE'"                                             
"ALLOC FI(ISPFILE) DA('"SYSUID".ISPFILE') NEW TRACKS SPACE(10 10)     
       RECFM(F B) LRECL(80)"                             
JNM = 1                                                               
"EXECIO * DISKR INDD ( STEM STNAME. "                                 
DO AA = 1 TO STNAME.0                                                 
  PARSE VAR STNAME.AA VOLSER                                         
  VOLSER = STRIP(VOLSER)                                             
  UNIT = "A00"                                                       
  "ISPEXEC FTOPEN"                                                   
  "ISPEXEC FTINCL DITTOJCL"                                           
  "ISPEXEC FTCLOSE"                                                   
  "SUBMIT '"SYSUID".ISPFILE'"                                         
  JNM = JNM + 1                                                       
  IF JNM = 4 THEN JNM = 1                                             
END                                                                   
"FREE  FI(ISPFILE,INDD)"                                             
"DEL  '"SYSUID".ISPFILE'"                                             
EXIT                                                                 
ERR:                                                                 
  SIGNAL OFF SYNTAX                                                   
  SAY "ERROR ROUTINE OUTPUT STARTING"                                 
  SAY "ERROR ROUTINE OUTPUT STARTING"                                 
  SAY "   "                                                           
  SAY RIGHT(SIGL,6) ">>>" SOURCELINE(SIGL)                           
  SAY "   "                                                           
  TRACE I                                                             
  INTERPRET SOURCELINE(SIGL)

(UNIT is intentionally left as a fixed value in this version...)

REXXEXEC (without the JOBCARD)
Code:
//REXX1    EXEC PGM=IKJEFT01
//SYSEXEC  DD  DSN=MYUSER.PRIVLIB,DISP=SHR
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  *
 %DITTOREX
/*
//


And the REXX related output in SDSF...
Code:
     6 *-* ADDRESS ISPEXEC "LIBDEF ISPSLIB DATASET ID()"                         
       +++ RC(-3) +++                                                           
     7 *-* ADDRESS ISPEXEC "LIBDEF ISPSLIB DATASET ID('MYUSER.PRIVLIB')" STACK
       +++ RC(-3) +++                                                           
IKJ56247I FILE ISPFILE NOT FREED, IS NOT ALLOCATED                               
IKJ56247I FILE INDD NOT FREED, IS NOT ALLOCATED                                 
IDC3012I ENTRY MYUSER.ISPFILE NOT FOUND+                                       
IDC3009I ** VSAM CATALOG RETURN CODE IS 8 - REASON CODE IS IGG0CLEG-42           
IDC0551I ** ENTRY MYUSER.ISPFILE NOT DELETED                                   
IDC0014I LASTCC=8
......
IKJ56265I INPUT DATA SET MYUSER.ISPFILE NOT USABLE+
IKJ56265I THE DATA SET IS EMPTY
......
IKJ56861I  FILE INDD NOT FREED, DATA SET IS OPEN                                 
IDC0550I ENTRY (A) MYUSER.ISPFILE DELETED                                       
READY                                                                           
END

"......" means those two messages are repeated as many times as there are VOLSERs in the RES data set.
First few messages are harmless, but I guess the "NOT USABLE" message is critical - it means the generated JCL isn't saved to the ISPFILE?

Any thoughts? icon_smile.gif

EDIT: fixed typo
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 6471
Location: Brussels once more ...

PostPosted: Tue Jul 07, 2009 6:49 pm    Post subject:
Reply with quote

You are running ISPF under TSO, and will need to allocate the required ISPF libraries to your batch job.

TSO ISRDDN on the command line will show all of the alllocated ISPF libraries for your foreground session. These will need to be replicated in your JCL.

Here is what I usually use. Although there may be some subtle differences from site to site, this should suffice almost anywhere.
Code:

//ISPFBAT  EXEC PGM=IKJEFT01,DYNAMNBR=256                 
//PROFLIST DD DSN=&&TEMPPROF,DISP=(,PASS,DELETE),         
//            SPACE=(TRK,(45,45,44)),                     
//            RECFM=FB,LRECL=80                           
//SYSLBC   DD DSN=SYS1.BRODCAST,DISP=SHR                 
//SYSPROC  DD DSN=My REXX library,DISP=SHR                       
//         DD DSN=Concatenation from ISRDDN
//SYSEXEC  DD DSN=My.REXX library,DISP=SHR                       
//         DD DSN=Concatenation from ISRDDN
//ISPPLIB  DD DSN=Concatenation from ISRDDN
//ISPMLIB  DD DSN=Concatenation from ISRDDN
//ISPSLIB  DD DSN=My ISPSLIB,DISP=SHR                       
//         DD DSN=Concatenation from ISRDDN
//ISPTLIB  DD DSN=*.PROFLIST,DISP=SHR,VOL=REF=*.PROFLIST 
//         DD DSN=Concatenation from ISRDDN
//ISPTABL  DD DSN=*.PROFLIST,DISP=SHR,VOL=REF=*.PROFLIST 
//         DD DSN=Concatenation from ISRDDN
//MSGTABL  DD DSN=Concatenation from ISRDDN
//ISPPROF  DD DSN=*.PROFLIST,DISP=SHR,VOL=REF=*.PROFLIST 
//ISPCTL0  DD DISP=(NEW,DELETE),SPACE=(TRK,(10,10)),UNIT=VIO,
//            RECFM=FB,LRECL=80,DSORG=PS                     
//ISPCTL1  DD DISP=(NEW,DELETE),SPACE=(TRK,(10,10)),UNIT=VIO,
//            RECFM=FB,LRECL=80,DSORG=PS                     
//ISPWRK1  DD DISP=(NEW,DELETE),SPACE=(TRK,(10,10)),UNIT=VIO,
//            RECFM=FB,LRECL=80,DSORG=PS                     
//ISPLIST  DD SYSOUT=*                                       
//ISPLST1  DD DISP=(NEW,DELETE),SPACE=(TRK,(10,10)),         
//            RECFM=VB,LRECL=133,DSORG=PS                   
//ISPLOG   DD SYSOUT=*,                                     
//            RECFM=FB,LRECL=120,DSORG=PS                   
//SYSOUT   DD SYSOUT=*                                       
//SYSPRINT DD SYSOUT=*                                       
//SYSTSPRT DD SYSOUT=*                                       
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//SYSTSIN  DD DUMMY                                         
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 47
Location: Europe

PostPosted: Wed Jul 08, 2009 1:28 pm    Post subject: Reply to: Removing tapes from the library with JCL
Reply with quote

The concatenation from ISRDDN is quite long for some libs...
I guess all those datasets aren't really necessary in this case...?
For example, isn't SYSPROC and SYSEXEC concatenation useless here, because the only exec is in my REXX lib?

I tried the example you provided, but didn't put all the datasets from ISRDDN (didn't use some with unusual HLQ), and it's still the same error (ISPFILE isn't populated with the generated job).

Is there a shorter allocation of libs in this case? 3 or 4 maybe on which to focus on?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 6471
Location: Brussels once more ...

PostPosted: Wed Jul 08, 2009 1:47 pm    Post subject:
Reply with quote

Have you tried running with TRACE R or TRACE I to get an idea of exactly what happens during your exec ?
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 47
Location: Europe

PostPosted: Wed Jul 08, 2009 2:08 pm    Post subject: Reply to: Removing tapes from the library with JCL
Reply with quote

Here's the relevant part of the output:
Code:
    22 *-*  UNIT = "A00"
       >L>    "A00"
    23 *-*  "ISPEXEC FTOPEN"
       >L>    "ISPEXEC FTOPEN"
       +++ RC(20) +++
    24 *-*  "ISPEXEC FTINCL DITTOJCL"
       >L>    "ISPEXEC FTINCL DITTOJCL"
       +++ RC(20) +++
    25 *-*  "ISPEXEC FTCLOSE"
       >L>    "ISPEXEC FTCLOSE"
       +++ RC(20) +++
    26 *-*  "SUBMIT '"SYSUID".ISPFILE'"
       >L>    "SUBMIT '"
       >V>    "MYUSER"
       >O>    "SUBMIT 'MYUSER"
       >L>    ".ISPFILE'"
       >O>    "SUBMIT 'MYUSER.ISPFILE'"
IKJ56265I INPUT DATA SET MYUSER.ISPFILE NOT USABLE+
IKJ56265I THE DATA SET IS EMPTY

icon_confused.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 6471
Location: Brussels once more ...

PostPosted: Wed Jul 08, 2009 2:18 pm    Post subject:
Reply with quote

try changing
Code:

//REXX1    EXEC PGM=IKJEFT01
//SYSEXEC  DD  DSN=MYUSER.PRIVLIB,DISP=SHR
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  *
 %DITTOREX
/*
//

to
Code:

//REXX1    EXEC PGM=IKJEFT01
//SYSEXEC  DD  DSN=MYUSER.PRIVLIB,DISP=SHR
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  *
 ISPSTART CMD(%DITTOREX)
/*
//
Back to top
View user's profile Send private message
Ivan P

New User


Joined: 08 Jun 2009
Posts: 47
Location: Europe

PostPosted: Wed Jul 08, 2009 4:04 pm    Post subject: Reply to: Removing tapes from the library with JCL
Reply with quote

After adding ISPPROF, ISPPLIB, ISPSLIB, ISPTLIB and ISPMLIB statements to the JCL, it works. \o/

But, if I switch back to:
//SYSTSIN DD *
%DITTOREX

it doesn't work... so it seems ISPSTART CMD() is crucial.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 6471
Location: Brussels once more ...

PostPosted: Wed Jul 08, 2009 4:06 pm    Post subject:
Reply with quote

Oh yes, and I should have thought about it earlier ...........

If you invoke ISPF services within your REXX code, you must use ISPSTART.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 HoursGoto page Previous  1, 2
Page 2 of 2