z/OS ISPF Services Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


LMMOVE—move members of a data set

z/OS ISPF Services Guide
SC19-3626-00

The LMMOVE service moves members of a partitioned data set or an entire sequential data set. Once the data has been moved, the "from" data set or members are deleted. Packing data, replacing members, and automatic truncation are optional. Only fixed-length and variable-length data sets can be packed.

Completion of the LMINIT service is required before you invoke LMMOVE. You must specify ENQ(MOD) with the LMINIT service if you want to use LMMOVE to append records to the "to-data-id". See LMINIT—generate a data ID for a data set for information that can help prevent some common I/O errors that might occur when using the LMMOVE service. LMMOVE requires that the "to-data-id" be closed before invocation. The "from-data-id" must also be closed when moving sequential data sets.
Note:
  1. FROMID and TODATAID can refer to the same data set but they cannot have the same data-id.
  2. LMMOVE does not support the copying of unmovable data sets (data set organization POU or PSU).
  3. If the ALIAS option is in effect, LMMOVE automatically processes alias members as follows:
    • Either the main member or any alias member may be selected to move the main member and all of its aliases. This will occur even if some of the members are not displayed in the current member selection list.
    • Alias members are moved for both load and non-load data sets as well as for PDS and PDSE data sets.

    Moving to the same data set is not supported when aliases are automatically selected, as it would result in the "from" and "to" member names being the same.

  4. If the NOALIAS option is in effect, LMMOVE does not move alias members unless either:
    • All members of the data set are selected.
    • A member pattern is used and both the main member and the alias member are included in that pattern.

    If the NOALIAS option is in effect, moving an alias member by itself will result in a new member being created, even if the main member has already been moved.

  5. If from-data-id represents an empty sequential data set, LMMOVE performs the copy but sets the return code to 4 as a warning.

Command invocation format

Read syntax diagramSkip visual syntax diagram
>>-ISPEXEC--LMMOVE--FROMID(from-data-id)------------------------>

>--+---------------------------+--TODATAID(to-data-id)---------->
   '-FROMMEM(from-member-name)-'                         

>--+-----------------------+------------------------------------>
   '-TOMEM(to-member-name)-'   

>--+---------+--+------+--+-------+--+------------------+------->
   '-REPLACE-'  '-PACK-'  '-TRUNC-'  '-SCLMSET(-+-Y-+-)-'   
                                                '-N-'       

   .-ALIAS---.   
>--+---------+-------------------------------------------------><
   '-NOALIAS-'   

Call invocation format

Read syntax diagramSkip visual syntax diagram
>>-CALL--ISPLINK--('LMMOVEbb'--,from-data-id--,----------------->

>--+-from-member-name-+--,to-data-id--,--+-to-member-name-+----->
   '-'b'--------------'                  '-'b'------------'   

>--,--+-'REPLACEb'-+--,--+-'PACKbbbb'-+--,--+-'TRUNCbbb'-+--,--->
      '-'b'--------'     '-'b'--------'     '-'b'--------'      

                      .-'ALIASbbb'-.       
>--+-'b'--------+--,--+-'b'--------+--);-----------------------><
   +-'YESbbbbb'-+     '-'NOALIASb'-'       
   '-'NObbbbbb'-'                          

or

Read syntax diagramSkip visual syntax diagram
>>-CALL--ISPEXEC--(buf-len,buffer);----------------------------><

Parameters

from-data-id
Specifies the data ID name associated with the data set to be moved. The data ID has been generated by the LMINIT service. The maximum length of this parameter is 8 characters.
from-member-name
The member name or pattern of the members to be moved. An asterisk (*) indicates that all members are to be moved. If the "from" data set is partitioned, this parameter is required. If it is sequential, this parameter is not allowed. The maximum length of this parameter is 8 characters.
to-data-id
Specifies the data ID name associated with the data set being moved to. The data ID has been generated by the LMINIT service. The maximum length of this parameter is 8 characters.
to-member-name
The name of the member being moved to the "to" data set. If a name is not specified, the name of the member in the "from" data set is used. If the "from" data set is sequential and the "to" data set is partitioned, this parameter is required. If the "to" data set is sequential, this parameter is not allowed. The maximum length of this parameter is 8 characters.
REPLACE
Specifies whether like-named members in the "to" data set are to be replaced. If "replace" is not specified and the members exists in the "to" data set, then the move will not be performed and a return code of 20 is issued.

If a list of members is being moved and one cannot be replaced, processing stops and a message is issued indicating how many members were moved.

PACK
Data is stored in the "to" data set in packed format. If this parameter is not specified, data is copied and stored as unpacked.
TRUNC
Specifies that truncation is to occur if the logical record length of the "to" data set is less than the logical record length of the "from" data set. If truncation is not specified and the logical record length of the "to" data set is less than the logical record length of the "from" data set, the move is not performed and a return code of 16 is issued.
SCLMSET
ISPF maintains a bit in the PDS directory to indicate whether a member was last modified using SCLM or some function outside of SCLM. The SCLMSET value indicates how to set this bit. YES indicates to set the bit ON. NO indicates the bit should be OFF. If you want to keep the current setting for a certain member, omit the SCLMSET parameter.
ALIAS|NOALIAS
With ALIAS in effect, either the main member or any alias member may be selected to move the main member and all of its aliases. This will occur even if a single member is specified or if some of the members are not displayed in the current member selection list.

With NOALIAS in effect, aliases must be moved manually to maintain the correct alias relationship. That is, the main member must be moved first followed by the aliases.

buf-len
Specifies a fullword fixed binary integer containing the length of buffer.
buffer
Specifies a buffer containing the name of the service and its parameters in the same form as they would appear in an ISPEXEC invocation for a command procedure.

Return codes

 0
Successful completion.
 4
Either:
  • "From" data set is empty.
  • No member matched the pattern in the "from" data set.
 8
"From" member not found.
10
No data set is associated with given data ID.
12
One of these:
  • A like-named member already exists in the “to” data set and the Replace option was not specified.
  • One or more members of the 'TO' or 'FROM' data sets are "in use" by you or another user and could not be moved.
  • Invalid data set organization.
  • Data set attribute invalid for packed data.
  • Open error.
16
A truncation error occurred.
20
Severe error; unable to continue.

Example

This example invokes the LMMOVE service to move member MYPROG in the data set associated with the data ID in variable DDVAR to the data set associated with the data ID in variable DDVAR2. If MYPROG already exists, replace it.

Command invocation

ISPEXEC LMMOVE FROMID(&DDVAR) FROMMEM(MYPROG)        +
                TODATAID(&DDVAR2) REPLACE

Call invocation

CALL ISPLINK('LMMOVE  ',DDVAR,'MYPROG ',DDVAR2,' ','REPLACE ');
OR
 
Set the program variable BUFFER to contain:
BUFFER = 'LMMOVE FROMID(&DDVAR) FROMMEM(MYPROG)
                 TODATAID(&DDVAR2) REPLACE';
Set the program variable BUFLEN to the length of the variable BUFFER. Issue the command:
CALL ISPEXEC (BUFLEN, BUFFER);

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014