Calling Formats

Here are the calling formats for all the supported languages:

General Format

Read syntax diagramSkip visual syntax diagramCALLrtnnameDirect Call ParametersDMSCSLDMSCSL Parameters

VS COBOL II

Read syntax diagramSkip visual syntax diagramCALL"rtnname"  USINGDirect Call Parameters"DMSCSL" USINGDMSCSL Parameters

VS FORTRAN

Read syntax diagramSkip visual syntax diagramCALLrtnname1(Direct Call Parameters)DMSCSL(DMSCSL Parameters)
Notes:
  • 1 VS FORTRAN cannot use the longer-style routine names, such as StackBufferCreate, to make direct calls. It must use the shorter name, such as DMSSTKC.

VS Pascal

Read syntax diagramSkip visual syntax diagramrtnname(Direct Call Parameters);DMSCSL(DMSCSL Parameters);

PL/I

Read syntax diagramSkip visual syntax diagramCALLrtnname(Direct Call Parameters);DMSCSL(DMSCSL Parameters);

C

Read syntax diagramSkip visual syntax diagramrtnname(Direct Call Parameters);DMSCSL(DMSCSL Parameters);

Assembler

Read syntax diagramSkip visual syntax diagramCALL(reg),(Direct Call Parameters)DMSCSL,(DMSCSL Parameters),VL
Note:
  1. When the long form of a routine’s name is used in a direct call, the routine’s address must be passed in a register, for example:
    L     R15,=A(STACKQUERY) 
    CALL  (15),(RC,RE,BUFNUM,LINES,HIGH),VL
  2. For the Assembler language, addresses used with CSL routines are 32-bit fields. The high-order bit is not used for addressing and must be zero, except that it must be set to one when it designates the end of a parameter list. Specifying VLon the routine call sets the high-order bit to 1. If you build the parameter list yourself and provide only the address of the list in the routine call, you must set the high-order bit of the last address in the list (see the information on programming language binding files in the z/VM: CMS Callable Services Reference ).

Ada

Read syntax diagramSkip visual syntax diagramCALLrtnname(Direct Call Parameters);DMSCSL(DMSCSL Parameters);

Direct Call Parameters

Read syntax diagramSkip visual syntax diagramretcode,parm

DMSCSL Parameters

Read syntax diagramSkip visual syntax diagramrtnname,retcode,parm
Calling CSL routines is different in REXX/VM. Routines can be called as functions or they can be called as routines with the CALL instruction or the ADDRESS OPENVM instruction:

REXX function call

Read syntax diagramSkip visual syntax diagramCSL('rtnnameretcodeparm')

REXX CALL instruction

Read syntax diagramSkip visual syntax diagramCALL CSL'rtnnameretcodeparm'

REXX ADDRESS OPENVM instruction

Read syntax diagramSkip visual syntax diagramADDRESS OPENVM'rtnnameparm'
Note: OPENVM type CSL routines can be called from REXX only by using the ADDRESS OPENVM interface. OPENVM routines may not follow the usual CSL conventions, such as providing return and reason codes as the first two parameters. For more information about the ADDRESS OPENVM interface, see the z/VM: REXX/VM Reference. To determine if a CSL routine is an OPENVM routine, you can use the CSLMAP or CSLLIST command. For information about these commands, see the z/VM: CMS Commands and Utilities Reference.