View previous topic :: View next topic
|
Author |
Message |
yugendran
New User
Joined: 14 Dec 2007 Posts: 51 Location: indore
|
|
|
|
Hi,
I just tried to run a code to call ISPLINK from cobol to get a variable using VGET.. But it ended with RC 20.. I have just got the code from web..
Code: |
IDENTIFICATION DIVISION.
PROGRAM-ID. COBISPF.
DATA DIVISION.
WORKING-STORAGE SECTION.
ISPF SERVICES
01 ISPLINK PIC X(8) VALUE 'ISPLINK '.
01 TCCSID PIC X(05).
01 LCCSID PIC S9(8) COMP VALUE 5.
01 VDEFINE PIC X(8) VALUE 'VDEFINE '.
01 ZTERMCID PIC X(8) VALUE 'ZTERMCID'.
01 CHAR PIC X(4) VALUE 'CHAR'.
01 VGET PIC X(8) VALUE 'VGET '.
01 SHARED PIC X(8) VALUE 'SHARED '.
PROCEDURE DIVISION.
MAIN-PARA.
CALL 'ISPLINK' USING
VDEFINE ZTERMCID TCCSID CHAR LCCSID.
DISPLAY RETURN-CODE UPON SYSOUT.
CALL ISPLINK USING
VGET ZTERMCID SHARED.
DISPLAY RETURN-CODE UPON SYSOUT.
DISPLAY TCCSID UPON SYSOUT.
MAIN-EXIT.
STOP RUN. |
I am not sure why it is ended with RC 20.. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
How did you run it? JCL or called in an ISPF environment? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
while you were surfing the web for solutions,
this link:z/OS V1R7.0 ISPF Services Guide which describes the VDEFINE, VGET, and VPUT services, my have been of more help.
can't get what is not there.
as well as which service, VDEFINE or VGET returned the rc_20? |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Try this :
Code: |
01 CHAR PIC X(8) VALUE 'CHAR '.
|
|
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
And this :
Code: |
01 ZTERMCID PIC X(10) VALUE '(ZTERMCID)'.
|
|
|
Back to top |
|
|
yugendran
New User
Joined: 14 Dec 2007 Posts: 51 Location: indore
|
|
|
|
Hi,
I am running it using JCL..
//STEP01 EXEC PGM=COBISPF
//SYSLST DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
Sysout:
0020
0020
@Peter,
I did what u suggested, still its returning RC-20. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
What is COBISPF, a compile procedure? You need an ISPF environment to run it.
Something like this :
ISPEXEC SELECT PGM(APCS1000) NEWAPPL(APT) PARM(&P) PASSLIB |
|
Back to top |
|
|
yugendran
New User
Joined: 14 Dec 2007 Posts: 51 Location: indore
|
|
|
|
Peter,
I have just compiled and linked this cobol program and created the load module COBISPF.. and I am running that load with the above JCL..
Thanks,
Yuge |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
yugendran,
are you a bit slow? That will never work, you need to use the ISPEXEC interface, in other words CLIST/REXX have to be used.
Read the : ISPF Services Guide |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
no you do not need to use clist/rexx.
all he has to do is allocate in his JOBLIB/STEPLIB statment, the required libraries to support the CALL and the routines.
the same libraries that would be required if you did write a clist/rexx routine to accomplish the same as the COBOL program is attempting to do. |
|
Back to top |
|
|
yugendran
New User
Joined: 14 Dec 2007 Posts: 51 Location: indore
|
|
|
|
Peter,
Using REXX/CLIST, I have done this before.. I recently came to know that it is also possible in to do VDEFINE & VGET in batch..
If we use MODEL command in edit mode, it shows the examples of invoking VDEFINE in cobol program..
eg:
CALL "ISPLINK" USING ISPF-SERVICE ISPF-NAME-LIST
ISPF-VARIABLE-LIST ISPF-FORMAT-LIST
ISPF-LENGTH-LIST ISPF-OPTION-LIST
ISPF-UDATA-VALUE ISPF-OPTION1.
I have used first four parms and others are optional.. But not able to succeed in it..
Thanks
Yuge |
|
Back to top |
|
|
yugendran
New User
Joined: 14 Dec 2007 Posts: 51 Location: indore
|
|
|
|
Hi dbz,
Is there any way to find what are all the required libraries to be allocated to run this apart from my load library?
Thanks. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Dick,
as far as i know if you use batch, then it has to be a TSO (IKJEFT01) batch, with beside the steplib for the cobol pgm also needs the ISPF libraries. |
|
Back to top |
|
|
yugendran
New User
Joined: 14 Dec 2007 Posts: 51 Location: indore
|
|
|
|
Hi,
I just tried,
/* REXX */
Address TSO
"CALL 'TEST.LOADLIB(COBISPF)'"
It worked.. But running in JCL, it gives error.. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Peter,
you are correct, it failed to register that he was invoking the COBOL program directly from MVS.
He does need to invoke the program via IKJEFTnn.
yugendran wrote: |
It worked.. But running in JCL, it gives error.. |
that is because when you invoke the REXX Script in the foreground,
all the required libraries are already allocated to your ISPF session.
now,
either - search the forum (there have been several threads concerning this in this website
- search google for invoking ISPF in batch
- or do a TSO LISTALC and for every dsn allocated to your ISPF and ISREX dd names, make an entry in your JOBLIB/STEPLIB statement
the last will be overkill, but if you are too lazy to do a little research and learning about your environment,
you will just have to do it that way. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
PeterHolland wrote: |
Dick,
as far as i know if you use batch, then it has to be a TSO (IKJEFT01) batch, with beside the steplib for the cobol pgm also needs the ISPF libraries. |
Do you know offhand if he could establish a TSO environment and then start ISPF?
(I admit: I'm too damned lazy to write the program at 15:30 WULT ) |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
Back to top |
|
|
|