You use the SET command to establish an environment variable that identifies the data set to be associated with a PL/I file, and, optionally, provide additional characteristics of that data set. This information provided by the environment variable is called data definition (or DD) information.
The syntax of the DD:ddname environment variable is:
|
Blanks are acceptable within the syntax. In addition, the syntax of the statement is not checked at the time the command is entered. It is verified when the data set is opened. If the syntax is wrong, UNDEFINEDFILE is raised with the oncode 96.
If you use an alternate ddname, and it is longer than 31 characters, only the first 31 characters are used in forming the environment variable name.
The AMTHD option specifies the access method that is to be used to access the data set.
.-FSYS----. >>-AMTHD--(-+-DDM-----+-)-------------------------------------->< +-ISAM----+ +-BTRIEVE-+ '-REMOTE--'
For Windows, the name of the file needs to be qualified by the LU alias or the fully-qualified SNA network name
FSYS is used by default if you do not specify the AMTHD option and if you do not apply one of the following ENVIRONMENT options:
If you specify any of the above options, AMTHD(ISAM)is the default on Windows while AMTHD(DDM) is the default on AIX.
The APPEND option specifies whether an existing data set is to be extended or re-created.
.-Y-. >>-APPEND--(-+-N-+-)-------------------------------------------><
The APPEND option applies only to OUTPUT files. APPEND is ignored if:
The ASA option applies to printer-destined files. This option specifies when the ANS control character in each record is to be interpreted.
.-N-. >>-ASA--(-+-Y-+-)----------------------------------------------><
If the file is not a printer-destined file, the option is ignored. Printer-destined files are described in Printer-destined files.
The BUFSIZE option specifies the number of bytes for a buffer.
|
RECORD output is buffered by default and has a default value for BUFSIZE of 64k. STREAM output is buffered, but not by default, and has a default value for BUFSIZE of zero.
If the value of zero is given to BUFSIZE, the number of bytes for buffering is equal to the value specified in the RECSIZE or LRECL option.
The BUFSIZE option is valid only for a consecutive binary file. If the file is used for terminal input, you should assign the value of zero to BUFSIZE for increased efficiency.
This version of the CHARSET option applies only to consecutive files using record I/O. It gives the user the capability of using EBCDIC data files as input files, and specifying the character set of output files.
.-ASIS---. >>-CHARSET--(-+-EBCDIC-+-)------------------------------------->< '-ASCII--'
Choose a suboption of CHARSET based on what form the file has (input) or what form you want the file have (output).
CHARSET(ASIS) is the default.
This version of the CHARSET option applies for stream input and output files. It gives the user the capability of using EBCDIC data files as input files, and specifying the character set of output files. If you attempt to specify ASIS when using stream I/O, no error is issued and character sets are treated as ASCII.
.-ASCII--. >>-CHARSET--(-+-EBCDIC-+-)-------------------------------------><
Choose a suboption of CHARSET based on what form the file has (input) or what form you want the file to have (output).
CHARSET(ASCII) is the default.
The DELAY option specifies the number of milliseconds to delay before retrying an operation that fails when a file or record lock cannot be obtained by the system.
|
The default value for DELAY is 0. .
The DELIMIT option specifies whether the input file contains field delimiters or not. A field delimiter is a blank or a user-defined character that separates the fields in a record. This is applicable for sort input files only.
.-N-. >>-DELIMIT--(-+-Y-+-)------------------------------------------><
The sort utility distinguishes text files from binary files with the presence of field delimiters. Input files that contain field delimiters are processed as text files; otherwise, they are considered to be binary files. The library needs this information in order to pass the correct parameters to the sort utility.
The LRECL option is the same as the RECSIZE option.
|
If LRECL is not specified and not implied by a LINESIZE value (except for TYPE(FIXED) files, the default is 1024.
The LRMSKIP option allows output to commence on the nth (n refers to the value specified with the SKIP option of the PUT or GET statement) line of the first page for the first SKIP format item to be executed after a file is opened.
.-N-. >>-LRMSKIP--(-+-Y-+-)------------------------------------------><
If n is zero or 1, output commences on the first line of the first page.
The PROMPT option specifies whether or not colons should be visible as prompts for stream input from the terminal.
.-N-. >>-PROMPT--(-+-Y-+-)-------------------------------------------><
PROMPT(N) is the default.
The PUTPAGE option specifies whether or not the form feed character should be followed by a carriage return character. This option only applies to printer-destined files. Printer-destined files are stream output files declared with the PRINT attribute, or record output files declared with the CTLASA environment option.
|
The RECCOUNT option specifies the maximum number of records that can be loaded into a relative or regional data set that is created during the PL/I file opening process.
|
The RECCOUNT option is ignored if PL/I does not create, or re-create, the data set. If the RECCOUNT option applies and is omitted, the default is 50 for regional and relative files.
The RECSIZE option specifies the length, n, of records in the data set.
|
For regional and fixed-length data sets, RECSIZE specifies the length of each record in the data set; for all other data set types, RECSIZE specifies the maximum length records may have.
The default for n is 512.
The RETRY option specifies the number of times an operation should be retried when a file or record lock cannot be obtained by the system.
|
The default value for RETRY is 10. This option is applicable only to DDM files.
The SAMELINE option specifies whether the system prompt occurs on the same line as the statement that prompts for input.
.-N-. >>-SAMELINE--(-+-Y-+-)-----------------------------------------><
The following examples show the results of certain combinations of the PROMPT and SAMELINE options:
|
prompt(y), sameline(y) prompt(n), sameline(y) prompt(y), sameline(n) prompt(n), sameline(n) |
ENTER: (cursor) ENTER: (cursor) ENTER: (cursor) ENTER: (cursor) |
|
prompt(y), sameline(y) prompt(n), sameline(y) prompt(y), sameline(n) prompt(n), sameline(n) |
ENTER: (cursor) ENTER (cursor) ENTER : (cursor) ENTER (cursor) |
The SHARE option specifies the level of file sharing to be allowed.
.-NONE-. >>-SHARE--(-+-READ-+-)----------------------------------------->< '-ALL--'
This option is valid only with DDM files.
To enable record-level locking, specify SHARE(ALL) and declare the file as an update file. This is recommended when running CICS applications.
The UNDEFINEDFILE condition is raised if the requested or default level of file sharing cannot be obtained.
The SKIP0 option specifies where the line cursor moves when SKIP(0) statement is coded in the source program. SKIP0 applies to terminal files that are not linked as PM applications.
.-N-. >>-SKIP0--(-+-Y-+-)--------------------------------------------><
The following example shows how you could make the output to the terminal skip zero lines so that the cursor moves to the beginning of the current output line:
set dd:sysprint=stdout:,SKIP0(Y) set dd:sysprint=con,SKIP0(Y)
The TERMLBUF option specifies the maximum number of lines in the window of a PL/I Presentation Manager (PM) terminal.
|
If the file is not associated with a PM terminal, the option is ignored. The default is 512 lines.
The TYPE option specifies the format of records in a native file.
.-CRLF-----. >>-TYPE--(-+-LF-------+-)-------------------------------------->< +-TEXT-----+ +-FIXED----+ +-VARLS----+ +-VARLS4X4-+ +-VARMS----+ +-LL-------+ +-LLZZ-----+ +-CRLFEOF--+ '-U--------'
The data set must not contain any record that is longer than the value determined for the record length of the data set.
This is the default for ISAM and BTRIEVE.
The data set must not contain any record that is longer than the value determined for the record length of the data set.
All characters in a TYPE(FIXED) file are considered as data, including control characters if they exist. Make sure the record length you specify reflects the presence of these characters or make sure the record length you specify accounts for all characters in the record.
TYPE(VARLS) data sets provide the fastest way to use PL/I to read and write data sets containing records of variable length and arbitrary byte patterns. This is not possible with TYPE(CRLF) data sets because when a record is read that was written containing the bit string '0d0a'b4, a misinterpretation occurs.
Type(VARLS4X4) data sets provide a way to handle FORTRAN sequential unformatted files.
TYPE(VARMS) data sets provide a way to read SCALARVARYING files downloaded from the mainframe.
TYPE(LL) data sets provide a way to read files downloaded from the mainframe with a tool (see VRECGEN.PLI sample program) that appends two bytes.
The LLZZ suboption provides a way to read and write data sets which contain records of variable length and arbitrary byte patterns which cannot be done with TYPE(CRLF) data sets. Under CRLF, a written record containing the bit string '0d0a'b4 is misinterpreted when it is read.
A TYPE(LLZZ) data set must not contain any record that is longer than the value determined for the record length of the data set.
The TYPE option applies only to CONSECUTIVE files, except that it is ignored for printer-destined files with ASA(N) applied.
If your program attempts to access an existing data set with TYPE(FIXED) in effect and the length of the data set is not a multiple of the logical record length you specify, PL/I raises the UNDEFINEDFILE condition.
When using non-print files with the TYPE(FIXED) attribute, SKIP is replaced by trailing blanks to the end of the line. If TYPE(CRLF) is being used, SKIP is replaced by CRLF with no trailing blanks.