Page 1 of 1

Error in executing SYSDSN in batch mode

PostPosted: Tue Nov 20, 2012 12:34 pm
by swetha489
I have a Rexx which has to check the availability of a dataset (which is as used as input) before proceeding.

Following is the snippet of the code that performs this function:
CHECKAVAIL:                                                       
   'TS'                                                           
   STROBEDS = "'" || USERID() || ".STROBES.INPUT.PHASE2" || "'"   
   SAY SYSDSN(STROBEDS)                                           
   IF SYSDSN(STROBEDS) <> 'OK' THEN DO                           
      SAY "STROBE INPUT NOT FOUND."                               
      EXIT                                                       
   END                                                           
   RETURN                                                         
                                                                 

The dataset AAAA.STROBES.INPUT.PHASE2 is available. And this particular code works perfectly when executed in online mode.
However, when executed in batch, this code fails.

Here is the trace output when executed in Batch:
READY                                                                     
  ISPSTART CMD(EXEC 'AAAA.STROBE.PHASE2.TOOL.BACKUP(PHASE2)')           
    47 *-*   STROBEDS = "'" || USERID() || ".STROBES.INPUT.PHASE2" || "'" 
       >>>     "'AAAA.STROBES.INPUT.PHASE2'"                             
+++ Interactive trace.  TRACE OFF to end debug, ENTER to continue. +++     
    48 *-*   SAY SYSDSN(STROBEDS)                                         
       >>>     "DATASET NOT FOUND"                                         
DATASET NOT FOUND                                                         
    49 *-*   IF SYSDSN(STROBEDS) <> 'OK'                                   
       >>>     "1"                                                         
       *-*    THEN                                                         
       *-*    DO                                                           
    50 *-*     SAY "STROBE INPUT NOT FOUND."                               
       >>>       "STROBE INPUT NOT FOUND."                                 
STROBE INPUT NOT FOUND.                                                   
    51 *-*     EXIT                                                       


The JCL:
//TSOEXEC  JOB (TEST),'TEST2',MSGLEVEL=(1,1),CLASS=A,
//         MSGCLASS=A,NOTIFY=&SYSUID
//STEP0010 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSPROC  DD DSN=AAAA.STROBE.PHASE2.TOOL.BACKUP,DISP=SHR
//ISPPROF  DD DSN=&&ISPPROF,DISP=(,DELETE),
//            UNIT=SYSDA,SPACE=(CYL,(1,1,10),RLSE),
//            RECFM=FB,LRECL=80
//*ISPTLIB  DD DSN=&&ISPPROF,DISP=(,DELETE),
//*            UNIT=SYSDA,SPACE=(CYL,(1,1,10),RLSE),
//*            RECFM=FB,LRECL=80
//*        DD DSN=SYNA2.ISPF.ISPPROF.ST06,DISP=SHR
//ISPTLIB  DD DSN=SYS2.TCS.TABLE,DISP=SHR
//         DD DSN=ISP.SISPTENU,DISP=SHR
//         DD DSN=IMSV10.IMS1010.SDFSTLIB,DISP=SHR
//         DD DSN=ISF.SISFTLIB,DISP=SHR
//         DD DSN=SYS1.SBPXTENU,DISP=SHR
//         DD DSN=EOY.SEOYTENU,DISP=SHR
//         DD DSN=FMN.SFMNTENU,DISP=SHR
//         DD DSN=SYS1.SERBTENU,DISP=SHR
//ISPPLIB  DD DSN=SYS2.TCS.PANEL,DISP=SHR
//         DD DSN=ISF.SISFPLIB,DISP=SHR
//         DD DSN=IMSV10.IMS1010.SDFSPLIB,DISP=SHR
//         DD DSN=ISP.SISPPENU,DISP=SHR
//         DD DSN=SYS1.SBPXPENU,DISP=SHR
//         DD DSN=EOY.SEOYPENU,DISP=SHR
//         DD DSN=FMN.SFMNPENU,DISP=SHR
//         DD DSN=SYS1.SERBPENU,DISP=SHR
//ISPMLIB  DD DSN=SYS2.TCS.MSG,DISP=SHR
//         DD DSN=ISF.SISFMLIB,DISP=SHR
//         DD DSN=IMSV10.IMS1010.SDFSMLIB,DISP=SHR
//         DD DSN=ISP.SISPMENU,DISP=SHR
//         DD DSN=EOY.SEOYMENU,DISP=SHR
//         DD DSN=SYS1.SBPXMENU,DISP=SHR
//         DD DSN=DSN810.SDSNSPFM,DISP=SHR
//         DD DSN=FMN.SFMNMENU,DISP=SHR
//         DD DSN=SYS1.SERBMENU,DISP=SHR
//ISPSLIB  DD DSN=SYS2.TCS.SKEL,DISP=SHR
//         DD DSN=ISP.SISPSENU,DISP=SHR
//         DD DSN=ISP.SISPSLIB,DISP=SHR
//         DD DSN=DSN810.SDSNSPFS,DISP=SHR
//         DD DSN=FMN.SFMNSLIB,DISP=SHR
//ISPLOG   DD SYSOUT=*,DCB=(LRECL=125,RECFM=VBA)
//SYSTSIN  DD *
  ISPSTART CMD(EXEC AAAA.STROBE.PHASE2.TOOL.BACKUP(PHASE2)')



I went through the forum for similar posts, and came across one here: http://ibmmainframes.com/about54723.html
The topic starter mentioned the use of DYNMNBR parameter helped him, so I tried this
//STEP0010 EXEC PGM=IKJEFT01,DYNMNBR=30

But of no use.

Could anyone help me out with this? Please could you tell me where I am wrong.

Re: Error in executing SYSDSN in batch mode

PostPosted: Tue Nov 20, 2012 12:55 pm
by Pandora-Box
Please show the trace output when executing in foreground

Re: Error in executing SYSDSN in batch mode

PostPosted: Tue Nov 20, 2012 1:24 pm
by mongan
Maybe you are missing the ISPF libraries?
//ISPPLIB DD DSN=ISP.SISPPENU,DISP=SHR
//ISPTLIB DD DSN=ISP.SISPTENU,DISP=SHR
//ISPMLIB DD DSN=ISP.SISPMENU,DISP=SHR
//ISPSLIB DD DSN=ISP.SISPSLIB,DISP=SHR

Re: Error in executing SYSDSN in batch mode

PostPosted: Tue Nov 20, 2012 1:50 pm
by swetha489
Pandora-Box and Mongan, thanks a lot for taking some time to reply.

This might seem absolutely silly. I ran the job again, and it executed perfectly. I didn't make a single change to the JCL or the Rexxes or the input file. Sorry for wasting your time.

Re: Error in executing SYSDSN in batch mode

PostPosted: Tue Nov 20, 2012 2:33 pm
by enrico-sorichetti
the REXX script should check the existance of a dataset and proceed acordingly

You complained about a <normal> event :mrgreen: