regarding call statements



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

regarding call statements

Postby pradeepgowda » Mon Mar 29, 2010 1:15 pm

suppose there are two programmes PROGRAMA and PROGRAMB. both program call PROGRAMC.

if i want to call PROGRAMC from PROGRAMB using a field of PIC X(25) AND i want to call PROGRAMC from PROGRAMA using
PIC X(100). is it possible. if not why, what will be the error and how to meet the above requirement

Program A:
WS-FIELDA PIC X(100).

CALL PROGRAMC USING WS-FIELDA

Program B:
WS-FIELDB PIC X(25).

CALL PROGRAMC USING WS-FIELDB
pradeepgowda
 
Posts: 40
Joined: Mon Jan 04, 2010 4:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: regarding call statements

Postby Robert Sample » Mon Mar 29, 2010 5:16 pm

Of course it is possible to do this -- why would you not think so?

Your PROGRAMC, however, will need to be aware of how long the passed data is and not attempt to access the last 75 bytes when only 25 bytes were passed to it. Attempting to access those bytes could easily result in a S0C4 abend.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post