Page 1 of 2

JCL to execute PL/I w ISPF tables & DB2 tables

PostPosted: Fri Oct 22, 2010 7:36 am
by pucca71
Hello all !

I am looking for a sample JCL to execute a PL/I program which uses ISPF tables and also DB2.
I was looking all around but only got examples for REXX or CLISTs.

My main concerns are:
- Where to place my load.
- What to code on the SYSTSIN.

I appreciatte your help on this. :shock:

Re: JCL to execute PL/I w ISPF tables & DB2 tables

PostPosted: Fri Oct 22, 2010 9:11 am
by dick scherrer
Hello,

I believe you need to post more of the specifics of what you are trying to accomplish.

How does ispf tables relate to db2/sql?

When one uses ispf in batch, an ispf environment must be established. With or without db2/sql.

Suggest you talk with your support people as to what is needed on your system to run ispf in a batch job. They will know the specifics.

Possibly there is somehting i misunderstand.

Re: JCL to execute PL/I w ISPF tables & DB2 tables

PostPosted: Fri Oct 22, 2010 8:27 pm
by pucca71
Hi Dick !
Thanks for your prompt response.

DB2 & ISPF dont' interact in this case.
The logic of the program is to read some ISPF tables, storeaged on files, and update them with data selected from a DB2 table.
So after reading a keyed ISPF table, the program will inquiry a db2 table, looking for a value, and then, will update the tables but writing them on other dataset.

It is like a copy from one place to another but with additions.

There is no more than that.
Please, let me know if you need more details.
Thank a lot !

Re: JCL to execute PL/I w ISPF tables & DB2 tables

PostPosted: Fri Oct 22, 2010 8:35 pm
by Akatsukami
The library containing the load module will be added to the STEPLIB concatenation.

SYSTSIN will (assuming that there are no unmentioned requirements) be coded like:
DSN SYSTEM(your-DB2-subsystem) RETRY(0) TEST(0)
RUN PROGRAM(your-program-name) PLAN(your-plan-name)

Re: JCL to execute PL/I w ISPF tables & DB2 tables

PostPosted: Sat Oct 23, 2010 3:07 am
by pucca71
Thanks Aka !

I thought it would be more complicated :roll: .
I'll try and let you know. ;)

Re: JCL to execute PL/I w ISPF tables & DB2 tables

PostPosted: Fri Oct 29, 2010 1:01 am
by pucca71
Hi,
I'm back again.
I've tried the suggestion. Well, it seems to work, but it doesn't show any of the puts to the sysprint file, I tought I had to open it explicitly, so I tried that, but, although it is ending with RC=0, it is not showing anything. I cannot trace the program.

Does anyone have any idea ? Am I communicating with ISPF services this way ?
I am posting the JCL I am using:

//*-------------------------------------------------               
//* EXECUTION                                                     
//*-------------------------------------------------               
//ST01 EXEC PGM=IKJEFT01                                           
//STEPLIB  DD  DSN=LIQUIDL.PLI.LOAD,DISP=SHR                       
//SYSPROC  DD  DSN=DSN2.NEW.SDSNCLST,DISP=SHR                     
//         DD  DSN=CEE.SCEELKED,DISP=SHR                           
//         DD  DSN=DSN2.SDSNLOAD,DISP=SHR                         
//         DD  DSN=ISP.SISPLOAD,DISP=SHR                           
//         DD  DSN=DSN2.RUNLIB.ENTPL1.LOAD,DISP=SHR               
//ISPLLIB  DD  DSN=LIQUIDL.PLI.LOAD,DISP=SHR                       
//ISPPLIB  DD  DSN=&&ISPPLIB,                                     
//             UNIT=SYSDA,SPACE=(TRK,(5,1,1)),                     
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=23440)               
//         DD  DSN=ISP.SISPPENU,DISP=SHR                           
//ISPMLIB  DD  DSN=&&ISPMLIB,                                     
//             UNIT=SYSDA,SPACE=(TRK,(5,1,1)),                     
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=23440)               
//         DD  DSN=ISP.SISPMENU,DISP=SHR                           
//ISPTLIB  DD  DSN=&&ISPTLIB,                                 
//             UNIT=SYSDA,SPACE=(TRK,(1,1,1)),               
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=32000)         
//         DD  DSN=LIQUIDL.CSP.CPTABL,DISP=SHR               
//         DD  DSN=ISP.SISPTENU,DISP=SHR                     
//ISPSLIB  DD  DSN=&&ISPSLIB,                                 
//             UNIT=SYSDA,SPACE=(TRK,(5,1,1)),               
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=23440)         
//         DD  DSN=ISP.SISPSENU,DISP=SHR                     
//ISPPROF  DD SPACE=(CYL,(1,1,5),RLSE),UNIT=SYSDA,           
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=23440)         
//CPTABL   DD DSN=LIQUIDL.CSP.CPTABL,DISP=SHR                 
//CSPPGDR$ DD DSN=LIQUIDL.CSP.CPTABL(CSPPGDR$),DISP=SHR       
//DPTABL   DD DSN=LIQUIDL.CSP.DPTABL,DISP=SHR                 
//MPTABL   DD DSN=LIQUIDL.CSP.MPTABL,DISP=SHR                 
//NPTABL   DD DSN=LIQUIDL.CSP.NPTABL,DISP=SHR                 
//INPROD   DD DSN=LIQUIDL.ISPTLIB,DISP=SHR                   
//PTABL    DD DSN=LIQUIDL.LIQUID.PTABL,                       
//            DISP=(,CATLG,DELETE),                                   
//            DCB=(LRECL=80,BLKSIZE=6160,RECFM=FB),                   
//            SPACE=(CYL,(1,1,5),RLSE)                               
//SYSEXEC  DD DSN=LIQUIDL.PLI.LOAD,DISP=SHR                           
//SYSTSPRT DD SYSOUT=*                                               
//SYSPRINT DD SYSOUT=*                                               
//PPDPRINT DD DSN=LIQUIDL.PPDPRINT,                                   
//            DISP=(NEW,CATLG,DELETE),                               
//            UNIT=SYSDA,SPACE=(TRK,(5,1)),                           
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=23440)                   
//SYSTSIN  DD *                                                       
  DSN SYSTEM(DSN)                                                     
  RUN  PROGRAM(CSPXXXX) PLAN(CSPXXXX)                               
//*                                                               
   


Please HELP ! :!:

Re: JCL to execute PL/I w ISPF tables & DB2 tables

PostPosted: Sun Oct 31, 2010 8:12 pm
by NicC
You should never open SYSPRINT explicitly. It may already have been opened by the PL/1 environment before it starts your program. If you OPEN in you program the dataset pointer can be reset to the start of file thus losing any messages already output.

As you do not seem to be getting any messages to SYSPRINT, add some debug to the program which is written to a file. If that does not show then maybe you are executing the wrong version of the program.

Re: JCL to execute PL/I w ISPF tables & DB2 tables

PostPosted: Mon Nov 01, 2010 7:54 am
by pucca71
Hi.
The SYSPRINT issue was solved.
Here is my JCL:
//*-------------------------------------------------               
//* EXECUTION                                                     
//*-------------------------------------------------               
//ST01 EXEC PGM=IKJEFT01                                           
//STEPLIB  DD DSN=LIQUIDL.PLI.LOAD,DISP=SHR                       
//SYSPROC  DD DSN=DSN2.NEW.SDSNCLST,DISP=SHR                       
//         DD DSN=CEE.SCEELKED,DISP=SHR                                 
//         DD DSN=DSN2.SDSNLOAD,DISP=SHR                                 
//         DD DSN=ISP.SISPLOAD,DISP=SHR                                 
//         DD DSN=DSN2.RUNLIB.ENTPL1.LOAD,DISP=SHR                       
//*- - ALLOCATE PROFILE, PANELS, MSGS, PROCS, AND TABLES -*/             
//ISPPROF  DD SPACE=(CYL,(1,1,5),RLSE),UNIT=SYSDA,                       
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=23440)                     
//ISPPLIB  DD DSN=ISP.SISPPENU,DISP=SHR                                 
//ISPMLIB  DD DSN=ISP.SISPMENU,DISP=SHR                                 
//ISPSLIB  DD DSN=ISP.SISPSENU,DISP=SHR                                 
//         DD DSN=ISP.SISPSLIB,DISP=SHR                                 
//ISPTLIB  DD DSN=LIQUIDL.CSP.CPTABL,DISP=SHR                           
//         DD DSN=ISP.SISPTENU,DISP=SHR                                 
//*        DD DSN=LIQUIDL.CSP.DPTABL,DISP=SHR                           
//*        DD DSN=LIQUIDL.CSP.NPTABL,DISP=SHR                           
//*        DD DSN=LIQUIDL.ISPTLIB,DISP=SHR                               
//[color=#FF0080]ISPTABL  DD DSN=LIQUIDL.LIQUID.PTABL,       [/color]                           
//            DISP=(,CATLG,DELETE),                                     
//            DCB=(LRECL=80,BLKSIZE=6160,RECFM=FB),                     
//            SPACE=(CYL,(1,1,5),RLSE)                             
//*- - ALLOCATE ISPF LOG DATA SET  - - - - - - - - - - - -*/       
//ISPLOG   DD DSN=LIQUIDL.PLI.ISPF.LOG,DISP=OLD                     
//*                                                                 
//*- - ALLOCATE DIALOG PROGRAM AND TSO COMMAND LIBRARIES -*/       
//ISPLLIB  DD DSN=LIQUIDL.PLI.LOAD,DISP=SHR                         
//SYSEXEC  DD DSN=LIQUIDL.PLI.LOAD,DISP=SHR                         
//SYSTSPRT DD DSN=LIQUIDL.PLI.SYSTSPRT,                             
//            DISP=OLD                                             
//*           DISP=(NEW,CATLG,DELETE),                             
//*           SPACE=(CYL,(5,15),RLSE),                             
//*           DCB=(DSORG=PS,RECFM=VBA,BLKSIZE=0,LRECL=133)         
//SYSPRINT DD DSN=LIQUIDL.PLI.SYSPRINT,                             
//            DISP=OLD                                             
//*           DISP=(NEW,CATLG,DELETE),                             
//*           SPACE=(CYL,(5,15),RLSE),                             
//*           DCB=(DSORG=PS,RECFM=VBA,BLKSIZE=0,LRECL=133)         
//SYSTSIN  DD *                                                     
  ISPSTART PGM(CSPTABML)                                           


Now, I have 2 questions:
1) JCL related:
- This JCL is pure PL/I ISPF. How can I execute a DB2 plan also ? I need to code some SQL sentences within my PL/I-ISPF program.
2) ISPF services related:
- I have to create an ISPF table in the DSN=LIQUIDL.LIQUID.PTABL (ISPTABL).
I have coded the following:
CALL ISPLINK('LIBDEF ',ISPTABL ,'DATASET ',('LIQUIDL.LIQUID.PTABL'));
CALL ISPLINK('TBCREATE','CSPPGDR$','CSPPROD$',
'(CSPDIRN$ CSPTITL$)','WRITE ',' ',ISPTABL);
It compiles ok but at runtime, it displays the message error:
"Invalid dsname length - Data set name specification cannot exceed 44 characters."

What's wrong here ?

I will appreciatte a lot your help on this.

Re: JCL to execute PL/I w ISPF tables & DB2 tables

PostPosted: Mon Nov 01, 2010 9:13 am
by NicC
1 - I do not ever recall seeing a combination of PL/1, ISPF and DB2. I have done Rexx, ISPF and DB2 but that was in foreground.
2 - Having looked at the PL/1 models for LIBDEF and TBCREATE your statements appear to be correct. With which statement is the error message associated? And are you absolutely certain - PUT SKIPS before and after each?

Re: JCL to execute PL/I w ISPF tables & DB2 tables

PostPosted: Mon Nov 01, 2010 9:16 am
by dick scherrer
Hello,

You highlighted what is wrong in red. . .

Correct the dataset name specified so that it is both correct and less than 45 characters . . .

Why did you not post the problem dataset name?