The &FILE ADD verb adds a file record.
This verb has the following format:
&FILE ADD ID=fileid
[ KEY=key | KEYVAR=keyvar ]
[ OPT={ TRUNCATE | NOTRUNCATE } ]
[ { ARGS | VARS=prefix* } [ RANGE=(start,end) ] |
VARS={ var | ( var1,var2,...,varn )|
DATA=data | MDO=mdoname ]
[ PRTCNTL=opt | (opt1,opt2 [ ,opt3,opt4 ] ) ]
Operands:
Identifies the file.
Specifies the full key value to set for the file. The key value (after substitution) is in one of several forms:
01SMITH
For unquoted strings, the key consists of displayable characters only, and the first blank delimits it.
'01SMITH J.' “03JONES PETER A” “LU A0123BC2”C 'A. B. O''MALLEY'C
The usual quote rules apply. Either single quotes (') or double quotes (”) are acceptable. Quotes must be paired and of the same type. A double quote is treated as a single quotation character when included within a string.
'0012001F'X
“0123456789ABCDEF”X
If there are no characters following the closing quote, a character string is assumed. If a single character follows the closing quote then it must be either 'C' (designating a character string), or 'X' (designating a hexadecimal string). For quoted hexadecimal strings, all characters must be valid hexadecimal characters (that is, 0 through 9 and A through F).
The user is responsible to understand the file key structure and determine which form of key designation is most appropriate.
Note: The &ZQUOTE built-in function can assist when building quoted strings, and that the KEYVAR operand provides a suitable alternative.
Provides an alternative way to nominate the full key value. keyvar is the name of a user or system variable, the contents of which are taken unchanged as the key value for the file set operation. The ampersand (&) is not required—if the & is coded, then the contents of the variable specified are assumed to contain the name of the variable containing the key.
If both the KEY and KEYVAR operands are omitted, the current file key value is used.
Specifies whether to allow truncation of data on an &FILE ADD. If NOTRUNCATE is specified (or defaulted), the procedure ends, with an error message, if the data exceeds the maximum record length of the file. When TRUNCATE is specified, a file return code of 1 is set if truncation occurs.
Nominates the NCL variables for the ADD operation. NCL variables are validly used as the source of the ADD operation when the file format is DELIMITED or UNMAPPED, and when the format is MAPPED and MAP=$NCL. How the variable appears on the file depends upon the current processing mode (format). If the format is UNMAPPED, then the variables are simply concatenated to form the record. If the format is DELIMITED, the variables are placed on the file separated by X'FF' separators.
Specifies the list of variables to write to the file. NCL variables are validly used as the source of the ADD operation when the file format is DELIMITED or UNMAPPED, and when the format is MAPPED and MAP=$NCL.
Data is allowed for DELIMITED or UNMAPPED format files only, and specifies a string of data for the file record. Substitution occurs on the specified string of data, and then the data is placed on the record as is.
Nominates the MDO for the ADD operation. An MDO is the source of the data record on an ADD operation only when the file format is MAPPED.
If FILE ADD writes to OS/VS SYSOUT data sets, use PRTCNTL to specify carriage control options to control print formatting. Print format categories are as follows:
One option from each of these categories is specified.
Note: Multiple options are specified, but they must be enclosed in parentheses and separated by commas. For example:
PRTCNTL=(NEWPAGE,USCORE1,CENTER,BOLD)
Does not advance the paper before writing the record.
Advances the paper one line before writing the record. When writing records to OS/VS SYSOUT data sets, this value is the default if the PRTCNTL operand is omitted.
Advances the paper two lines before writing the record.
Advances the paper three lines before writing the record.
Skips to a new page before writing the record.
Indicates that the first text character contains the carriage control character for controlling the print options for printing this record. If machine control characters are used (instead of ANSI control characters), DATA is the only carriage control option allowed.
Underlines the text for this record (excluding blanks between words).
Underlines the text for this record including blanks between words.
Aligns the text for this record to the left of the paper.
Aligns the text for this record to the right of the paper.
Centers the text for this record. The record width, and therefore the location of the center, is determined from the logical record length of the file. The length is specified in the LRECL operand of the ALLOC command (for z/OS or MSP).
Prints the text in bold form. Bold is achieved by overprinting the same characters.
Return Codes:
On completion of the operation, the &FILERC system variable is set as follows:
record added successfully
record added, truncation has occurred
record exists
error during processing of ADD request
NCL or Mapping Services processing error
Check &SYSMSG for details. The &VSAMFDBK system variable contains the VSAM completion code. For &FILERC=8, the &VSAMFDBK system variable is tested to determine the cause of the error. These error codes are explained in detail in your VSAM documentation. The &VSAMFDBK variable is always returned as a two-character value.
The &SYSMSG variable can also be set to contain error message details.
For mapped format files, the &ZMDORC and &ZMDOFDBK system variables are also set.
| Copyright © 2009 CA. All rights reserved. |
|