SET

Description

Assign a value to a local variable, global variable or system variable. You cannot assign a value to a dynamic variable.

The values assigned with SET are only valid for the current Entire Connection session.

Using the command line or terminal emulation keys, you can only assign values to global variables and system variables.

Syntax

SET variable {string|variable}...

Examples

  • Set the system variable LOGON to YES:

    SET LOGON YES
  • Set the global variable +PARM1 to LOGON = YES:

    SET +PARM1 'LOGON = YES'
  • Set the file name for PCFILE 5 to Test.ncd:

    SET PCFILE 5 DOWN DATA Test.ncd
  • Set the XSL stylesheet type and the name of the stylesheet for download to XML:

    SET PCFILE 7 DOWN CONVERT text/xsl http://PCxyz/xml/employ2.xsl

    See also: Specifying a File Name Using the SET Command in the Terminal Emulation documentation.

  • Set the local variable #PARM1 to the value which occurs on the terminal emulation screen, starting at row 2, column 1 for a length of 80 characters:

    SET #PARM1 *SCREEN 2 1 80

    The syntax for *SCREEN is:

    *SCREEN [row column length]

    row is a value between 1 and 25.

    column is a value between 1 and 80.

    length is a value between 1 and 80.

  • Set the local variable #ENVIRONMENT to the value of the DOS environment parameter PATH:

    SET #ENVIRONMENT PATH

Procedure File Example

Findfile.ncp

Variables Returned

None

Rules for SET PCFILE

The file extension defined with SET PCFILE indicates the type of dynamic format conversion that is to be used.

Format Extension
ASCII Any other extension not included in this table (e.g. *.ncd, *.ncs, *.ncm, *.ncr etc.)
Basic *.prn
Binary Any binary file with any extension. The transfer format for Natural is one record with a single binary field.
COBOL *.ncc
dBase III *.dbf
Data Interchange Format *.dif
Encryption *.enc
Excel *.xls or *.xlsx (depending on the Excel version)
HTML *.htm or *.html. This is a specific HTML format that can also be opened with Excel.
Lotus *.wks, *.wk1, *.wkl
XML *.xml

System-Generated File Names (Download only)

A file name is automatically generated, if you specify ~~RANDOM instead of a file name in the SET PCFILE statement. The file name is then generated as follows:

ddhhmmss.xxx

dd is the current day of the month as determined by the system date.

hhmmss is the current time as determined by the system time.

xxx is one of the following file extensions:

  • ncd, if an extension was not provided for data. Example:

    SET PCFILE 5 DOWN DATA ~~RANDOM
  • ncr, if an extension was not provided for a report. Example:

    SET PCFILE 5 DOWN REPORT ~~RANDOM
  • The extension that was specified with ~~RANDOM. Example:

    SET PCFILE 5 DOWN DATA ~~RANDOM.XYZ

Related Commands

DECR, INCR, RESET, SHIFT

Usage

Procedure File: Yes
Command Line: Yes - depends on the type of variable. There are restrictions for system variables concerning whether and where the SET command can be used.
Key: Yes
API: Yes