Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

EDIT-ELEMENT

The EDIT-ELEMENT statement calls the file editor EDT in order to create, correct or view text member (see also [10 (Related publications)] and [11 (Related publications)]).

The source and target base types may differ.

Creating and correcting text members

The EDIT-ELEMENT statement calls EDT and reads the specified member from the assigned library into work file 0. The contents of work file 0 are deleted beforehand. When EDT is terminated, the corrected or newly generated member is written to the assigned library.

LMS supports EDT versions higher than V16.2A.

As of EDT V16.4A, XHCS is supported. When it is called, LMS passes the coded-characterset name of the relevant member to EDT and writes the member back with the value set in EDT. If no input member is specified, “no code” is assumed as the input CCSN.

In the case of EDT-versions < V16.4A, the CCSN of the input member is entered as the CCSN of the target member. If no input member is specified, the target member is given the CCSN “no code”.

Editing is not possible if RECORD-FORMAT=FIXED, KEY-POSITION > 5 or KEY-LENGTH > 8 has been stored in the attribute record (record type 164) of the input member.

For the editing of Unicode members EDT V17.0 or higher is necessary.

Scratch file

When EDT is called, LMS generates a scratch file with the link name EDTISAM if the member contains ISAM keys.

Name of the scratch file:

S.LMS.TSNnnnn.date.time-of-day.member

where “member” can be up to 9 characters long. Member names exceeding this limit are truncated after the first 9 characters. If the “member” suffix would result in an illegal BS2000 file name (e.g. ’.’ as the ninth character), LMS forms a scratch file name without the member name:

Editor run

  • LMS passes the member records on to EDT. The member is then available in virtual memory.

  • If ISAM keys are stored in the member, the line number displayed by EDT gives the first six digits of the ISAM keys.

  • The member being processed is locked to other users.

Termination of the EDT run

RETURN from work file 0:

If not empty, work file 0 is added as a member to the output library. The EDT data (files in virtual memory, variables, etc.) remains intact. This data is released only in the case of a severe EDT error.

HALT from work file 0:

The following query is issued:

LMS0420: EDITED ELEMENT (type)membername/version[(variantnumber)]/date TO

BE ADDED? REPLY (Y=YES, N=NO or R=RETURN TO EDITOR)?

The response determines whether the current work file is added as a member or returned to EDT. The EDT data remains intact. This data is released only in case of a severe EDT error.

HALT/RETURN from work file != 0:

The following query is issued:

LMS0420: EDITED ELEMENT (type)membername/version[(variantnumber)]/date TO

BE ADDED? REPLY (Y=YES, N=NO or R=RETURN TO EDITOR)?

If ’N’ is entered, the member is not added. If the reply is ’Y’, the following dialog is then conducted with the user:

LMS0421: WORKFILE TO BE ADDED (0 = WORKFILE(0),.., N = NONE)

If the reply is ’N’, LMS returns to the EDT work file currently being processed.

EDT in batch mode

@RETURN:

The corrected member is added from work file 0 to the output library, provided that the output library is not empty.

@HALT:

The corrected member is not added to the output library.

Displaying information from EDT on the member being edited

RETURN ? / HALT ?

EDT displays the names of the target library and the target member, along with the version and type of the member being edited in work file 0. EDT also displays part of the member which was edited. Editing then resumes.
If ELEMENT=*NONE or TO-ELEMENT=*NONE are specified, RETURN ? and HALT ? have no effect.

EDIT-ELEMENT

ELEMENT = *NONE / *LIBRARY-ELEMENT(...)


*LIBRARY-ELEMENT(...)



|

LIBRARY = *STD / <filename 1..54 without-vers> / *LINK(...)



|


*LINK(...)



|



|

LINK-NAME = <structured-name 1..8>



|

,ELEMENT = *ALL(...) / <composed-name 1..64 with-under with-wild(132)>(...)



|


*ALL(...)



|



|

VERSION = *HIGH EST -EXIST ING / *ALL / *UPPER-LIMIT /



|



|


<composed-name 1..24 with-under with-wild(52)>



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>



|


<composed-name 1..64 with-under with-wild(132)>(...)



|



|

VERSION = *HIGH EST -EXIST ING / *ALL / *UPPER-LIMIT /



|



|


<composed-name 1..24 with-under with-wild(52)>



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>



|

,TYPE = *LMS-DEFAULT / <alphanum-name 1..8>


|

,USER-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)


|


*INTERVAL(...)


|



|

FROM = 1900-01-01 / <date 8..10 with-compl>


|



|

,TO = *TODAY / <date 8..10 with-compl>


|

,CREATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)


|


*INTERVAL(...)


|



|

FROM = 1900-01-01 / <date 8..10 with-compl>


|



|

,TO = *TODAY / <date 8..10 with-compl>


|

,MODIFICATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)


|


*INTERVAL(...)


|



|

FROM = 1900-01-01 / <date 8..10 with-compl>


|



|

,TO = *TODAY / <date 8..10 with-compl>


|

,EXCEPT-ELEMENT = *NONE / *ELEMENT(...)


|


*ELEMENT(...)


|



|

ELEMENT = *ANY (...) / <composed-name 1..64 with-under with-wild(132)>(...)


|



|


*ANY(...)


|



|



|

VERSION = *ANY / *HIGHEST-EXISTING / *UPPER-LIMIT /


|



|



|


<composed-name 1..24 with-under with-wild(52)>


|



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>


|



|


<composed-name 1..64 with-under with-wild(132)>(...)


|



|



|

VERSION = *ANY / *HIGHEST-EXISTING / *UPPER-LIMIT /


|



|



|


<composed-name 1..24 with-under with-wild(52)>


|



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>


|



|

,TYPE = *ANY / *LMS-DEFAULT / <alphanum-name 1..8>


|



|

,USER-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)


|



|


*INTERVAL(...)


|



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>


|



|



|

,TO = *TODAY / <date 8..10 with-compl>



|



|

,CREATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)



|



|


*INTERVAL(...)



|



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>



|



|



|

,TO = *TODAY / <date 8..10 with-compl>



|



|

,MODIFICATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)



|



|


*INTERVAL(...)



|



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>



|



|



|

,TO = *TODAY / <date 8..10 with-compl>

,TO-ELEMENT = *LIBRARY-ELEMENT (...) / *NONE


*LIBRARY-ELEMENT(...)



|

LIBRARY = *STD / *BY-SOURCE / <filename 1..54 without-vers> / *LINK(...)



|


*LINK(...)



|



|

LINK-NAME = <structured-name 1..8>



|

,ELEMENT = *BY-SOUR CE (...) / <composed-name 1..132 with-under with-wild-constr>(...)



|


*BY-SOURCE(...)



|



|

VERSION = *LMS-DEF AULT / *BY-SOURCE / *HIGHEST-EXISTING / *INCREMENT /



|



|





*UPPER-LIMIT / <composed-name 1..52 with-under with-wild-constr>



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>



|


<composed-name 1..132 with-under with-wild-constr>(...)



|



|

VERSION = *LMS-DEF AULT / *BY-SOURCE / *HIGHEST-EXISTING / *INCREMENT /



|



|





*UPPER-LIMIT / <composed-name 1..52 with-under with-wild-constr>



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>



|

,TYPE = *BY-SOUR CE / *LMS-DEFAULT / <alphanum-name 1..8>



|

,USER-DATE = *TODAY / *BY-SOURCE / <date 8..10 with-compl>



|

,STORAGE-FORM = *LMS-DEF AULT / *STD / *FULL / *DELTA

,EDT-MODE = *STD / *COMPATIBLE / *UNICODE

,EDITOR-COMMANDS = *NONE / <c-string 1..251> / *LOWER-CASE(...)


*LOWER-CASE(...)



|

EDITOR-COMMANDS = <c-string 1..251 with-low>

,INFORMATION = *TEXT / list-poss(2): *TEXT / *COMMENT

,WRITE-MODE = *LMS-DEF AULT / *CREATE / *REPLACE / *EXTEND / *ANY

,DIALOG-CONTROL = *LMS-DEF AULT / *NO / *YES / *ERROR

ELEMENT = *NONE / *LIBRARY-ELEMENT(...)

Specifies the member to be edited.

ELEMENT = *NONE
No input member is specified. The member to be edited is created as a new member, or overwritten with new data.

ELEMENT = *LIBRARY-ELEMENT(...) Specifies the desired member designation.

LIBRARY = *STD / <filename 1..54 without-vers> / *LINK(...)Specifies the library from which the member is to be edited.

LIBRARY = *STD
The library opened by OPEN-LIBRARY.

LIBRARY = <filename 1..54 without-vers>
Name of the library from which the member is to be taken.

LIBRARY = *LINK(...)
The library assigned via the link name.

LINK-NAME = <structured-name 1..8>
Link name of the library; this name was defined by means of a /ADD-FILE-LINK command prior to calling LMS.

ELEMENT = *ALL(...) / <composed-name 1..64 with-under with-wild(132)>(...) Name of the member to be edited.

VERSION = *HIGHEST-EXISTING / *ALL / *UPPER-LIMIT /<composed-name 1..24 with-under with-wild(52)>
Version of the member to be edited.

VERSION = *HIGHEST-EXISTING
The member with the highest existing version with reference to BASE is used.

VERSION = *UPPER-LIMIT
The highest possible version X’FF’ in the library under the specified TYPE and name is edited.

VERSION = <composed-name 1..24 with-under with-wild(52)>Explicitly specifies the version of the member to be edited.

BASE = *STD / <composed-name 1..24 with-under with-wild>
Prefix for the version selection. In conjunction with VERSION= *HIGHEST- EXISTING , it is then possible to use a certain prefix to reference the highest existing version. BASE=*STD has the same effect as BASE=*. For further information concerning specification of the base, see "Version designations".

TYPE = *LMS-DEFAULT / <alphanum-name 1..8>Type of the member to be edited.

USER-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)

Date given by the user.

USER-DATE = *ANY
The member to be edited has any date.

USER-DATE = *TODAY
The member with the current date is edited.

USER-DATE = <date 8..10 with-compl>
The member whose date is entered explicitly in the form [YY]YY-MM-DD is edited.

USER-DATE = *INTERVAL(...)
All members lying in the specified interval are edited.

FROM = 1900-01-01 / <date 8..10> with-complBeginning of interval.

TO = *TODAY / <date 8..10> with-complEnd of interval.

CREATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)Creation date of the member. For a description of the operands, see the USER-DATE operand of this statement.

MODIFICATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...) Date of the last modification to the member. For a description of the operands, see the USER-DATE operand of this statement.

EXCEPT-ELEMENT = *NONE / *ELEMENT(...)
Specifies the members to be excluded from the above selection.

EXCEPT-ELEMENT = *NONE
No members are excluded from editing.

EXCEPT-ELEMENT = *ELEMENT(...)
Specifies the members that are not to be excluded from editing. A member is excluded when all the fields of the EXCEPT-ELEMENT structure that are not set to *ANY identify the member as a hit. If all the fields of the EXCEPT-ELEMENT structure are set to *ANY, then all members will be excluded.
For a description of the operands, see *LIBRARY-ELEMENT.

TO-ELEMENT = *LIBRARY-ELEMENT(...) / *NONE
Specifies the destination to which and the name under which the member is to be written back.

TO-ELEMENT = *LIBRARY-ELEMENT(...)Specifies the desired member designation.

LIBRARY = *STD / *BY-SOURCE / <filename 1..54 without-vers> / *LINK(...)

Specifies the library to which the member is to be added.

LIBRARY = *STD
The library opened by OPEN-LIBRARY.

LIBRARY = *BY-SOURCE
The member is added to the library from which it was taken.

LIBRARY = <filename 1..54 without-vers>
Name of the library to which the file is to be added as a member. If the library does not yet exist, it will be created.

LIBRARY = *LINK(...)
The library assigned via the link name.

LINK-NAME = <structured-name 1..8>
Link name of the library; this name was defined by means of a /ADD-FILE-LINK command prior to calling LMS.

ELEMENT = *BY-SOURCE(...) /
<composed-name 1..132 with-under with-wild-constr>(...)Name that the new member to be added is to receive.

ELEMENT = *BY-SOURCE(...)
The new name is the same as the old name.

VERSION = *LMS-DEFAULT / *BY-SOURCE / *HIGHEST-EXISTING / *INCREMENT / *UPPER-LIMIT /
<composed-name 1..52 with-under with-wild-constr>
Version that the new member to be added is to receive.

VERSION = *BY-SOURCE
The new member receives the same version as the original member. If the original member has no version specification, the new member receives X’FF’ as the version specification.

VERSION = *HIGHEST-EXISTING
Depending on the convention applicable for the type, this overwrites the highest existing version with reference to BASE among the members of the same type and name; otherwise a default version is generated.

VERSION = *INCREMENT
Depending on the convention applicable for the type, this generates a new, higher version among existing members having the same type and name; otherwise a default version is generated (see also "Version designations").

VERSION = *UPPER-LIMIT
The highest possible version X’FF’ is generated.

VERSION = <composed-name 1..52 with-under with-wild-constr>

The text specified here is interpreted as the version designation.

BASE = *STD / <composed-name 1..24 with-under with-wild>
Defines the base for the target member. For further information concerning specification of the base, see "Version designations".

ELEMENT = <composed-name 1..132 with-under with-wild-constr>(...)
Name of the new member to be added. It can also be entered using wildcards.

VERSION = *LMS-DEFAULT / *BY-SOURCE / *HIGHEST-EXISTING / *INCREMENT / *UPPER-LIMIT /
<composed-name 1..52 with-under with-wild-constr>
Version that the new member to be added is to receive.
For description of operands, see above.

BASE = *STD / <composed-name 1..24 with-under with-wild>
Defines the base for the target member. For further information concerning specification of the base, see "Version designations".

TYPE = *BY-SOURCE / *LMS-DEFAULT / <alphanum-name 1..8>Type that the new member to be added is to receive.

TYPE = *BY-SOURCE
The new member receives the same type designation as the original member.

USER-DATE = *TODAY / *BY-SOURCE / <date 8..10 with-compl> Date given by the user.

USER-DATE = *TODAY The current date is given.

USER-DATE = *BY-SOURCE
The new member is given the same as the source member.

USER-DATE = <date 8..10 with-compl>
The date must be entered in the form [YY]YY-MM-DD.

STORAGE-FORM = *LMS-DEFAULT / *STD / *FULL / *DELTA
Storage form for the member being added. The storage form must not contradict the settings made by means of the MODIFY-TYPE-ATTRIBUTES or MODIFY-LIBRARY-ATTRIBUTES statements, and all members of a given type and name must have the same storage form.

STORAGE-FORM = *STD
The member is generated in accordance with the storage form required for the member scope. Contradictory requirements result in errors. If nothing is specified, full storage is selected.

STORAGE-FORM = *FULL

The new member is generated as a full member (if this is not possible, an error message is issued).

STORAGE-FORM = *DELTA
The new member is generated as a delta member (if this is not possible, an error message is issued). This entry is permissible for member types: S, P, D, J, M, X and members types derived from them.

TO-ELEMENT = *NONE
The edited member is not written back.

EDT-MODE = *STD / *COMPATIBLE / *UNICODE Specifies the mode that EDT is to be called in.

EDT-MODE = *STD
EDT is called in the mode specified by the MODIFY-LMS-DEFAULTS statement, but is allowed to switch modes if necessary.

EDT-MODE = *COMPATIBLE
EDT is called in compatibility mode.

EDT-MODE = *UNICODE
EDT is called in Unicode mode.

EDITOR-COMMANDS = *NONE / <c-string 1..251> / *LOWER-CASE(...)Specifies a sequence of editor commands.

EDITOR-COMMANDS = *NONE
No sequence of editor commands is specified.

EDITOR-COMMANDS = <c-string 1..251>
Sequence of editor commands which are to be executed after EDT is called. In the entry, the commands must be separated from one another by a semicolon (;). With the exception of EDIT and RETURN, it is possible to specify any commands which are permitted both in F mode and in L mode of EDT. The EDIT command is permitted only in the form EDIT ONLY. It should be noted that the HALT command in a sequence of EDT commands causes EDT to terminate and so also causes the EDT data to be released (files in virtual memory, variables, etc.).
Following execution of this sequence of EDT commands, the generated or edited member is written back directly.
Lowercase letters are converted to uppercase.

EDITOR-COMMANDS = *LOWER-CASE(...)

Lowercase letters are not converted to uppercase.

EDITOR-COMMANDS = <c-string 1..251 with-low>
Sequence of editor commands as described above, except that lowercase letters are not converted to uppercase.

Example of an EDT command

EDITOR-COM = ́ON&C ́ ́A ́ ́TO ́ ́B ́ ́ ́

Example of an EDT command without conversion of lowercase letters

EDITOR-COM = ( ́(LOWER ON;ON&C ́ ́a ́ ́TO ́ ́b ́ ́ ́)

INFORMATION = *TEXT / list-poss(2): *TEXT / *COMMENTThe section of the member which is to be edited.

INFORMATION = *TEXT
The text itself, i.e. record type 1, is to be edited.

INFORMATION = *COMMENT
The separately stored comment, i.e. record type 2, is to be edited.

WRITE-MODE = *LMS-DEFAULT / *CREATE / *REPLACE / *EXTEND / *ANYOverwriting of a member having the same name.
If the source member is the same as the target member, the WRITE-MODE operand is ignored.
If the member to be stored is a delta member, it is necessary to ensure that the member is a leaf of the delta tree. Only leaves of a delta tree may be overwritten.

WRITE-MODE = *CREATE
The target member must not yet exist and is created as a new member.

WRITE-MODE = *REPLACE
The target member must already exist and is replaced.

WRITE-MODE = *EXTEND
The target member is extended if it already exists. Otherwise it will be created as a new member. *EXTEND is not permitted for delta members,

WRITE-MODE = *ANY
The target member is replaced if it already exists. Otherwise it will be created as a new member.

DIALOG-CONTROL = *LMS-DEFAULT / *NO / *YES / *ERROR

This operand determines whether or not a dialog is to be conducted with the user during execution of a statement.

For more detailed information on dialog control, see the MODIFY-LMS-DEFAULTS statement.

Statement return code

(SC2)

SC1

Maincode

Meaning


2
2

0
0
0
1
32
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
130
130
130
130

CMD0001
LMS0129
LMS0163
CMD0230
LMS1002
LMS0020
LMS0213
LMS0214
LMS0302
LMS0509
LMS0510
LMS1003
LMS1004
PLA0223
PLA0224
PLA0229
PLA0233
PLA0475
PLA0476
PLA0478
LMS0041
LMS0411
LMS0412
LMS0413

No error
Statement aborted by user
At least one record truncated
Syntax error
Internal error
Target member or target file does not exist
Name exists as delta member
Name exists as full member
Member not found
Target member or target file already exists
Base not found
Error during wildcard processing with at least one member or file
Other error
Only leaves of a delta tree can be overwritten
Storage form not allowed
No access right for the member
Borrow status prevents member access
Function violates version automation
Version does not match applicable convention
Increase causes version overflow
System address space exhausted
Library locked
Member locked
Type locked

Required access rights

For LIBRARY-ELEMENT: read authorization for LIBRARY and ELEMENT

If more than one member is affected by the statement, members without read authorization are excluded from the statement.

For TO-ELEMENT: read and write authorization for LIBRARY

Administer authorization where the specified member designation is new. Otherwise, only write authorization for the member existing under the specified member designation (administer authorization no longer required).

For STORAGE-FORM=*DELTA, read authorization must be granted for the member defined by BASE.

If WRITE-CONTROL is active and a base version exists, the user ID of the user must be entered as the HOLDER of the member specified by BASE. Only if write authorization has been granted can a new version be generated or this base version overwritten. In this case, administer authorization is no longer required.

Notes

  • See note under CALL-EDT.

  • When creating a member, be sure to take into account the convention applicable to the member type.

  • Specifying a list for INFORMATION results in each of the list entries being edited in work file 0, i.e. the individual sections of the member are edited one after the other. The EDT run continues until the last selected section has been edited and a decision has been made as to whether the edited member (all of the selected sections) is to be added to the library.

  • If WRITE-CONTROL is active in the output library, the access method adds a comment (record type 2) to the member which is to be written. The comment logs the HOLDER, DATE and TIME of the operation. The record is written as the first record of the record type. Any existing comment records or those which have been edited by means of INFORMATION *COMMENT are copied after it. If, in addition, the member is written to the base of a different version (i.e. not the first version under a name), the member attributes STATE and HOLDER and all the rights of the base version are adopted for the new version. The CCSN is adopted from the source file. The USER-DATE is determined anew.

  • If an EDT-MODE is specified explicitly in the EDIT-ELEMENT statement, but EDT cannot start in the specified mode, the statement is aborted and the message LMS0297 is output.

  • If no EDT-MODE is specified explicitly in the EDIT-ELEMENT statement, EDT starts in the default EDT mode, but can switch modes by itself if necessary. The default EDT mode is COMPATIBLE at the beginning of the LMS run and can be changed by the MODIFY-LMS-DEFAULTS statement.

Examples

The member test4 is to be edited with EDT:

//edit-elem *lib(elem=test4,type=s)

The member test4 is to be edited with EDT, whereby the string 'old_word' becomes the string ’new_word’:

//edit-elem *lib(elem=test4,type=s),ed-com=*low-case('on 1-10

c''old_word''t''new_word''')

The member test4 is to be viewed with EDT but not written back:

//edit-elem (elem=test4,type=s),to-elem=*none

In the library LIBCCSN, the member UTFE is in the character set UTFE.
The member LONG-LINES is in the standard 7-bit character set EDF03IRV, but has lines that are longer than 256 characters. The default EDT mode is COMPATIBLE.

//modify-lms-defaults edt-mode=*compatible
//open-lib libccsn,*upd
//edit-elem (libccsn,utfe,s),edt-mode=*compatible
% LMS0297 CHANGE OF EDT OPERATING MODE NOT POSSIBLE ———————————————————  (1) 

//edit-elem (libccsn,utfe,s)   ———————————————————————————————————— (2)

//edit-elem (libccsn,long-lines,s),edt-mode=*unicode ——————————————— (3)

(1)

EDT fails to start because Unicode character sets are not supported in compatibility mode.

(2)

EDT automatically switches to Unicode mode

(3)

Unicode mode is specified explicitly