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
 

 

Calling ISPLINK from COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
yugendran

New User


Joined: 14 Dec 2007
Posts: 51
Location: indore

PostPosted: Thu May 19, 2011 4:11 pm    Post subject: Calling ISPLINK from COBOL
Reply with quote

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

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu May 19, 2011 4:30 pm    Post subject:
Reply with quote

How did you run it? JCL or called in an ISPF environment?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu May 19, 2011 4:39 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu May 19, 2011 5:06 pm    Post subject:
Reply with quote

Try this :

Code:

01  CHAR     PIC X(8)  VALUE 'CHAR    '.   
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu May 19, 2011 5:12 pm    Post subject:
Reply with quote

And this :

Code:

01  ZTERMCID PIC X(10)  VALUE '(ZTERMCID)'.
Back to top
View user's profile Send private message
yugendran

New User


Joined: 14 Dec 2007
Posts: 51
Location: indore

PostPosted: Thu May 19, 2011 5:42 pm    Post subject: Reply to: Calling ISPLINK from COBOL
Reply with quote

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

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu May 19, 2011 5:47 pm    Post subject:
Reply with quote

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

New User


Joined: 14 Dec 2007
Posts: 51
Location: indore

PostPosted: Thu May 19, 2011 5:55 pm    Post subject: Reply to: Calling ISPLINK from COBOL
Reply with quote

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

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu May 19, 2011 5:58 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu May 19, 2011 6:03 pm    Post subject:
Reply with quote

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

New User


Joined: 14 Dec 2007
Posts: 51
Location: indore

PostPosted: Thu May 19, 2011 6:08 pm    Post subject: Reply to: Calling ISPLINK from COBOL
Reply with quote

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

New User


Joined: 14 Dec 2007
Posts: 51
Location: indore

PostPosted: Thu May 19, 2011 6:11 pm    Post subject: Reply to: Calling ISPLINK from COBOL
Reply with quote

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

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu May 19, 2011 6:15 pm    Post subject:
Reply with quote

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

New User


Joined: 14 Dec 2007
Posts: 51
Location: indore

PostPosted: Thu May 19, 2011 6:19 pm    Post subject: Reply to: Calling ISPLINK from COBOL
Reply with quote

Hi,

I just tried,

/* REXX */
Address TSO
"CALL 'TEST.LOADLIB(COBISPF)'"

It worked.. But running in JCL, it gives error..
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu May 19, 2011 6:35 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Fri May 20, 2011 1:56 am    Post subject:
Reply with quote

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 icon_smile.gif )
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri May 20, 2011 11:37 am    Post subject:
Reply with quote

Akatsukami,

Maybe by using IKJEFTSR, IKJTSOEV and other routines, see :

http://publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.ikjb700/newtsf.htm
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm


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