IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Pass a parameter to Pgm. Cobol(DB2) from CLIST


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Celia Barossi

New User


Joined: 28 Nov 2005
Posts: 1

PostPosted: Mon Nov 28, 2005 9:47 pm
Reply with quote

I need to verify that is necessary to insert on program Cobol at linkage section any characters of control, before my parameters.
I'm trying to call a program with parameters by clist, and I saw that parameters are wrong, when it are displayed.

--PGM
Code:

  LINKAGE SECTION.                                                       
  01           WE000-LINKAGE       PIC X(00020).                         
  01           WE000-LINKAGE-R     REDEFINES     WE000-LINKAGE.         
      05       WE000-INPUT-PARMS.
       10      WE000-ANO           PIC X(00004).                         
       10      WE000-TMA           PIC X(00004).                         
       10      WE000-IMC           PIC X(00003).                         
      05       WE000-OUTPUT-PARMS.                                       
       10      WE000-MESSAGENO     PIC X(00006).                         
       10      FILLER              PIC X(00003).                         


-- CLIST
Code:

WRITE ### CHAMADA DO SUBPGM ###                                                 
DSN  SYSTEM(DB2B)                                                               
RUN  PROGRAM(WE000C00) LIB('AXG.LOAD')  +                                       
     PARMS('2005ABC WWWAAAAAAFFF')                                             
END                                                                             
WRITE ### RETORNO DO SUBPGM ###                                                 
END                                                                             


-- CLIST EXECUTION

### CHAMADA DO SUBPGM ###
DSN SYSTEM(DB2B)
RUN PROGRAM(WE000C00) LIB('AXG.LOAD') PARMS('2005ABC WWWAAAAAAFFF')
***--- VOU INICIALIZAR O PROGRAMA ---***
:20 / 05AB / C W
**ERRO***
**WE000-MESSAGENO 999993
### RETORNO DO SUBPGM ###
END
***
icon_question.gif icon_question.gif icon_question.gif
Back to top
View user's profile Send private message
John_Deal

New User


Joined: 28 Nov 2005
Posts: 4
Location: Montgomery, AL, USA

PostPosted: Mon Nov 28, 2005 11:49 pm
Reply with quote

You forgot the 4 bytes that are used for the LENGTH of the linkage section... Try adding 4 bytes to the front of your linkage section... icon_smile.gif
icon_cool.gif
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Dec 01, 2005 4:42 am
Reply with quote

The Length of the string is two bytes, not four. Define as PIC 999 COMP

From the COBOL Reference
Quote:

Specify run-time options in the PARM parameter of the EXEC statement that
starts execution. Code the PARM parameter as follows:

PARM='[user-parameter][/execution-options]'

user-parameter
Parameter to be passed to the VS COBOL II program being executed.
This parameter is then accessed by a USING phrase in your application
program.

If the user-parameter in the list contains a slash, add a trailing
slash. All data following this second slash is considered to be COBOL
run-time options. The last slash and the data following it are passed
to the program when the data following the last slash does not contain
any valid COBOL run-time options. In this case, the entire PARM
parameter is passed to the program and the COBOL run-time message
IGZ019I is sent. If there are no run-time options, failure to add the
trailing slash will cause the user-parameter data to the right of the
last slash to be treated (erroneously) as run-time options.

The Linkage Section record (level-01) that is to receive the
user-parameter data passed by the PARM string must be defined, taking
into account the halfword length field inserted in front of the string
by the system.
The program can test this field length for nonzero, to verify that
PARM-string data has in fact been passed. For example:

LINKAGE SECTION.
01 PARMDATA.
05 STRINGLEN PIC 999 USAGE COMP.
05 STRINGPARM PIC X(6).
PROCEDURE DIVISION USING PARMDATA.
IF STRINGLEN > 0 . . .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top