Previous Topic Next topic Print topic


C$NARG

This routine returns the number of parameters passed to the current program.
Note: This ACUCOBOL-GT library routine is available in this COBOL version. Any compatibility issues in this COBOL system are in the Compatibility Issues section at the end of the topic.

Usage

CALL "C$NARG" 
    USING NUM-PARAM

Parameter

NUM-PARAM COMP-1  

Description

This routine must be called with one USING parameter that must be a COMP-1 data item. This data item is filled in with the number of parameters. If the calling program is a subprogram, then this will be the number of USING items in the CALL statement that initiated the program. If the calling program is a main program, then this will be the number of CHAINING parameters passed from the runcbl command line or the CHAIN statement that initiated the program. C$NARG works only when the program is a called subroutine. It does not work with the "CALL RUN" form of the CALL verb.

Compatibility Issues

  • This routine is not supported in managed COBOL.
  • Set the Compiler directive COMP1(BINARY) to set ACUCOBOL-GT behavior for COMP-1 data items.
  • The "CALL RUN" statement is not supported in this COBOL system.
  • In ACUCOBOL-GT COBOL, the number of parameters passed is calculated by the number of parameters specified in the USING phase of the CALL statement in the calling program. In this COBOL system, the number of parameters passed is calculated by the number of parameters the calling program actually receives.
Previous Topic Next topic Print topic