Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CALL USING Syntax Question 1

Status
Not open for further replies.

rasETL

IS-IT--Management
May 28, 2003
213
US
Can the "USING" area of a Subroutine CALL be an 05 OR 10 Level working storage area within a Table?
I am developing a process that will CALL a Subroutine based on the Subroutine name found in an identifier. I'd like to customize the area based on the subroutine. I would like each area defined in a Table so all I have to do is change the index/subscript to match the subroutine's area and issue the call as...
CALL identifier USING WS-COMM-AREA (SUB or INDEX)

Haven't tried to run this through a compiler yet, so anyone care to comment?
 
Hi R,

I've never tried it, bu I can't see why it won't work, as long as the USING items are elementary items. If it doesn't work just move the indexed items to flat fields in the mainline just before issuing the CALL.

Regards, Jack.
 
Hi,

I used it many times. It works. But why don't you just try it out? It won't hurt anyone :)

Regards,

Crox
 
You don't tell us which compiler you are using.

In any ANSI/ISO '85 Standard compiler, there are two options that are always valid in the USING phrase

- an 01 or 77 level
- ANY elementary item

It is *NOT* valid to pass a non-01-level group item, e.g.

01 Top-Level.
05 Not-Top-Group.
10 Elem1 Pic X.
10 Elem2 Pic 9.

One may pass TOP-LEVEL or ELEM1 or ELEM2 - but may not pass Not-Top-Group.

HOWEVER, many (possibly most) compilers DO allow one to pass non-01-level groups - as an EXTENSION to the ANSI/ISO Standard. Furthermore, the recently approved 2002 ISO Standard also allows this (as an enhancement in the new Standard)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top