Don Poitras wrote:
Steve Comstock wrote:
Jim McAlpine wrote:
I'm trying to convert the following pseudo code to run under COBOL -
DCL TCCSID CHAR(5); /* TERMINAL CCSID */
CALL ISPLINK('VDEFINE','ZTERMCID',TCCSID,'CHAR',
LENGTH(TCCSID));
CALL ISPLINK('VGET ','ZTERMCID','SHARED ');
and I've come up with -
WORKING-STORAGE SECTION.
01 TCCSID PIC X(5).
01 LCCSID PIC S9(8) 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.
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
GOBACK.
Items have to be in a specified order; for VDEFINE its:
VDEFINE - the verb; you're OK there
name-list - you have ZTERMCID, looks OK
variable - you have TCCSID, 5 byte area where value is to
be placed; looks OK
format - you have CHAR; OK
length - you have LCCSID; this must be a fullword
binary integer; you have 8 bytes of
display;
Try chaning LCCSID to be defined as:
LCCSID pic s9(8) binary value 5.
I find that using the ISPF 'MODEL' command is useful when writing ISPF
programs. Make sure you're editting a PDS with a name such as
MYNAME.TEST.COBOL and then issue 'MODEL WORKSTORE' and the 'a' line
command where you would like the working storage fields entered. Then go
down to the procedure division and to a 'MODEL VDEFINE' for a sample and
=NOTE= comments. Same for the other ISPF services. Do 'MODEL' by itself
to bring up a list of all the services.
Excellent suggestion, Don. I second that approach.
Kind regards,
-Steve Comstock
The Trainer's Friend, Inc.
303-393-8716
http://www.trainersfriend.com
z/OS Application development made easier
* Our classes include
+ How things work
+ Programming examples with realistic applications
+ Starter / skeleton code
+ Complete working programs
+ Useful utilities and subroutines
+ Tips and techniques
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html