Version 4.2.6 for Mainframes
 —  Operations  —

Natural under VM/CMS

This document contains special considerations that apply when running Natural under VM/CMS.

The following topics are covered:


Issuing CP and CMS Commands from Natural

You can use the Natural system command CMS to issue CP and CMS commands; for example, CMS FLIST * DATA B or CMS CP SPOOL PRT *.

If you enter CMS without parameters, a menu prompts you for a CP/CMS command. To exit from the menu enter a period (.) in the first position.

To issue CP or CMS commands from within a Natural program, code the following statement:

CALL 'CMS' command rc

where:

command is either an alphanumeric variable or a constant,
rc is a variable (format/length I4) which receives the return code from the CP or CMS command.

The second parameter (rc) is optional. Full command resolution is provided just as in normal CMS interactive command mode.

Top of page

Reading the CMS Program Stack

To read a line from the CMS program stack into a Natural variable, code the following:

CALL 'CMSREAD' line

where line is an alphanumeric variable.

The line read from the program stack is either truncated or padded with blanks to fit the length of the variable.

If the program stack is empty, CMSREAD returns the character string *EOD*.

Top of page

Hardcopy Function

The hardcopy function of the Natural CMS Interface is enabled by specifying parameter

HCAM=CMS

either in NATPARM ASSEMBLE, or dynamically when invoking Natural.

The Natural terminal command %H sends output to your virtual printer. Specifying %HL produces a file called NATURAL LISTING A.

Top of page

Applying Fixes to Natural

Software AG provides fixes in the form of Zaps to remedy problems which are discovered after your Natural installation tape was shipped.

For more information about NATZAP, type HELP NATZAP in the Natural installation user ID.

Top of page

Natural in Batch Mode under CMS

See Natural in Batch Mode (All Environments) and Natural in Batch under CMS.

Top of page

Using TCP/IP Communication

The Natural statement REQUEST DOCUMENT is used to connect to an http server to retrieve HTML or XML files. The file TCPIP DATA contains configuration information for TCP/IP client programs. This file resides on the TCP/IP client minidisk and is typically accessed by the command

VMLINK TCPIP

If you are planning to use REQUEST DOCUMENT, include in a Rexx program to invoke Natural the line:

EXEC VMLINK TCPIP

Top of page

Calling Natural Subprograms from Rexx

In a Rexx program, you can use the CALLNAT function to execute a Natural subprogram and pass parameters to it. The Rexx program must be executed while Natural is active, for example, by a CALL statement in a Natural program:

CALL 'CMS' 'EXEC MYREXX'

MYREXX can then execute a Natural subprogram with the CALLNAT function:

result = callnat('MYNAT',parm1,parm2)

MYNAT should reside in the same Natural library as the Natural program that called the Rexx program. Upon successful execution of MYNAT, the Rexx variable result will contain the name of the called subprogram, padded with blanks to a length of 8 (that is, in this example: result='MYNAT   '). If an error was encountered, result will contain the Natural error number prefixed with "NAT", for example: NAT0082.

To exchange data between Rexx and Natural, you can use the statements READ WORK FILE and WRITE WORK FILE, preceded by

DEFINE WORK FILE n 'STEM rexxstem.'

The work file must be declared using the parameter macro NTWORK or the profile parameter WORK with AM=CMS. See also Print File and Work File Support.

Top of page