Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
LMPUT—write a logical record to a data set z/OS ISPF Services Guide SC19-3626-00 |
|
The LMPUT service writes one logical record to the data set associated with a given data ID. The first LMPUT writes the first logical record to the data set, and later invocations write succeeding records. The LMINIT service with ENQ(EXCLU), ENQ(SHRW), ENQ(MOD), and the LMOPEN service with the OUTPUT option must be completed before you can use the LMPUT service. If the data set is an ISPF library or MVS™ partitioned data set, the LMMADD or LMMREP service must be invoked after the last LMPUT to update the directory and to write the last physical record. If the data set is sequential, the LMCLOSE service must be invoked after the last LMPUT to write the last physical record and to close the data set. When MODE(MULTX) is used, the write operation occurs in segments (rather than in single records), with each segment comprising multiple records. Each record is prefixed by a 2-byte binary integer field containing its length. The maximum size of each segment written is 32 000 bytes. LMPUT requires data in the dataloc-var to be in this format:
The LMPUT service writes records to a data set as is. That is, the LMPUT service does not pack data before writing it if the data is in unpacked format. In order to pack data before writing it, use Edit with the pack option. Command invocation formatCall invocation formatParameters
Return codesThese return codes are possible:
ExampleThis example invokes the LMPUT service to write a data record, with a length of 80 bytes, contained in variable DATAVAR into the data set associated with the data ID in variable DDVAR. Command invocation
Call invocation
Set the program variable BUFFER to contain:
Set the program variable BUFLEN to the length of the variable BUFFER. Issue the command:
Note: Null variables must be defined to have a length greater than
zero. Programs containing definitions of null variables must specify
VDEFINE with the NOBSCAN option. Null variables defined in CLISTs
should be initialized with the &STR built-in function. Null variables
defined in REXX should be initialized by setting them to ' '. For
example, if x is the name of a variable: x = ' '
Example (MULTX)This REXX example invokes the LMPUT service to process a data set
in MULTX mode, writing blocks of data in segments no larger than 32 000
bytes. LMPUT pads records that are too short with blanks and truncates
records that are too long for the target data set.
|
Copyright IBM Corporation 1990, 2014
|