Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

FIND-ELEMENT

The FIND-ELEMENT statement uses a specified search string to search for textual members in the member records, and logs the members it finds, optionally with or without the hit records.

FIND-ELEMENT

ELEMENT = *LIB RARY -ELEM ENT (...)


*LIBRARY-ELEMENT(...)



|

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



|


*LINK(...)



|



|

LINK-NAME = <structured-name 1..8> / <filename 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 / *ALL / <alphanum-name 1..8 with-wild(20)>



|

,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 with-wild(20)>


|



|

,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>

,PATTERN = <c-string 1..256> / *LOWER-CASE(...)


*LOWER-CASE(...)



|

PATTERN = <c-string 1..256 with-low>

,SHOW-RECORDS = *Y ES (...) / *NO


*YES(...)



|

RECORD-NUMBER = *NO / *YES

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

TEXT-OUTPUT = *LOGGING-PAR AMETERS / *NONE / *SYSOUT / *SYSLST(...) / *EDT(...)


*SYSLST(...)



|

SYSLST-NUMBER = *STD / <INTEGER 1..99>


*EDT(...)



|

WRITE-MODE = *EXTEND / *REPLACE

,STRUCTURE-OUTPUT = *SYSINF / *NONE / <composed-name 1..255>(...)


<composed-name 1..255>(...)



|

WRITE-MODE = *REPLACE / *EXTEND

ELEMENT = *LIBRARY-ELEMENT(...)
Specifies the member to be searched.

LIBRARY = *STD / <filename 1..54 without-vers> / *LINK(...)
Specifies the library to be searched.

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.

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

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

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 searched.

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

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=*.

TYPE = *LMS-DEFAULT / *ALL / <alphanum-name 1..8 with-wild(20)>Type of the member to be searched.

USER-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)Date given by the user.

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

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

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

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

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

TO = *TODAY / <date 8..10 with-compl>
End 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 of 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 the search.

EXCEPT-ELEMENT = *ELEMENT(...)
Specifies the members that are to be excluded from the search. 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.

PATTERN = <c-string 1..256> / *LOWER-CASE(...)
Character string (regular expression) on which the search is based (see the „C Library Functions (BS2000/OSD) for POSIX Applications“ manual [16 (Related publications)]). The use of upper and lower case characters is ignored.

PATTERN = *LOWER-CASE(...)
No conversion of lower case characters.

PATTERN = <c-string 1..256 with-low>
Character string as described above, but in this case the use of upper and lower case characters is distinguished.

SHOW-RECORDS = *YES(...) / *NO
Specifies whether the hit records are shown or not.

SHOW-RECORDS = *YES(...)
The hit records are shown. Every member found is output in a header, followed by the records in which it was found (similar to the SHOW-ELEMENT output). The number of records found and the number of records searched are also displayed for each member. Finally, the number of members found and the number of members searched are output.

RECORD-NUMBER = *NO / *YES
Specifies whether or not the record numbers are output.

RECORD-NUMBER = *NO
No record numbers are output.

RECORD-NUMBER = *YES
The record numbers are also output.

SHOW-RECORDS = *NO
The hit records are not shown. The members found are output as with SHOW-ELEMENT-ATTRIBUTES ... INFORMATION=*MEDIUM. The number of members found and the number of members searched are also output.

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

The section of the member which is to be searched.

INFORMATION = *STD
Has the same effect as *TEXT for text members, otherwise as *ALL.

INFORMATION = *ALL
The whole member, i.e. record types 1-159 and 164, is searched.

INFORMATION = *TEXT
The text itself, i.e. record type 1, is searched.

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

TEXT-OUTPUT = *LOGGING-PARAMETERS / *NONE / *SYSOUT / *SYSLST(...) / *EDT(...)
Controls the log output.

TEXT-OUTPUT = *LOGGING-PARAMETERS
The log is output to the output medium specified using
//MODIFY-LOGGING-PARAMETERS, TEXT-OUTPUT=.

TEXT-OUTPUT = *NONE
The log output is suppressed, except for any error messages.

TEXT-OUTPUT = *SYSOUT
The output is written to SYSOUT.

TEXT-OUTPUT = *SYSLST(...)
The output is written to SYSLST.

SYSLST-NUMBER = *STD / <integer 1..99>
Determines the SYSLST file to which output is to be written.

SYSLST-NUMBER = *STD
The system file SYSLST is used.

SYSLST-NUMBER = <integer 1..99>
The system file with the specified number from the set SYSLST01 through SYSLST99 is used.

TEXT-OUTPUT = *EDT(...)
The output is written to work file 9 of EDT. In the event of a error during log output, the system switches to the default log stream (SYSOUT).

WRITE-MODE = *EXTEND / *REPLACE
Write mode of the output in relation to the contents of work file 9.

WRITE-MODE = *EXTEND

If data exists in work file 9, the output is added to this data. If not, then the oputput will be written starting at the beginning of the work file.

WRITE-MODE = *REPLACE
Output is written at the beginning of work file 9. Any data already contained in the work file will be replaced.

STRUCTURE-OUTPUT = *SYSINF / *NONE / <composed-name 1..255>(...)Structured output of the members found.

STRUCTURE-OUTPUT = *SYSINF
The structured output is placed in the SYSINF stream assigned by /ASSIGN-STREAM (see the “SDF-P“ manual [12]).

STRUCTURE-OUTPUT = *NONE
There is no structured output.

STRUCTURE-OUTPUT = <composed-name 1..255>(...)
Specifies the S variable in which the structured output is to be placed. This variable must be declared as a dynamic list variable.
(Command: /DECLARE-VARIABLE NAME=...(TYPE =*STRUCTURE),MULTIPLE-ELEMENTS =*LIST)

WRITE-MODE    = *REPLACE / *EXTEND
Specifies whether the list variable is to be overwritten or extended.

WRITE-MODE = *REPLACE
The existing contents of the list variable are overwritten.

WRITE-MODE = *EXTEND
The new list members are appended to the existing list.

Statement return code

(SC2)

SC1

Maincode

Meaning


2

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

CMD0001
LMS0129
CMD0230
LMS1002
LMS0302
LMS1003
LMS1004
PLA0229
LMS0041
LMS0411
LMS0412
LMS0413

No error
Statement aborted by user
Syntax error
Internal error
Member not found
Error during wildcard processing with at least one member or file
Other error
No access right for the member
System address space exhausted
Library locked
Member locked
Type locked

Required access rights

For 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.

Examples

  • The members of library X are to be searched for the string “abc”.

    //FIND-ELEMENT *LIB(LIB=X,ELEM=*,TYPE=S),PATTERN='abc',SHOW-RECORDS=*YES
    INPUT  LIBRARY= :1OSQ:$USER.X
    INPUT  ELEMENT= (S)FIND/@(0001)/2012-10-09
     abc is in this record.
    This is a record with abcdefg.
           2 OUT OF      127 RECORD(S) FOUND
    INPUT  LIBRARY= :1OSQ:$USER.X
           1 OUT OF        2 (S)-ELEMENT(S) FOUND
    //FIND-ELEMENT *LIB(LIB=X,ELEM=*,TYPE=S),PATTERN='abc', -
    SHOW-RECORDS=*YES(,RECORD-NUMBER=*YES)
    INPUT  LIBRARY= :1OSQ:$USER.X
    INPUT  ELEMENT= (S)FIND/@(0001)/2012-10-09
          #7  > abc is in this record.
        #123  >This is a record with abcdefg.
           2 OUT OF      127 RECORD(S) FOUND
    INPUT  LIBRARY= :1OSQ:$USER.X
           1 OUT OF        2 (S)-ELEMENT(S) FOUND
    //FIND-ELEMENT *LIB(LIB=X,ELEM=*,TYPE=S),PATTERN='abc',SHOW-RECORDS=*NO
    INPUT  LIBRARY= :1OSQ:$USER.X
    TYP NAME VER (VAR#) DATE
    (S) FIND @   (0001) 2012-10-09
           1 OUT OF        2 (S)-ELEMENT(S) FOUND
    
  • L-type member LLM from library X is to be searched for the string ’SYSLNK’ and 5 characters in front of the hit, together with all characters after the hit, are to be displayed (one screen line maximum).

    //FIND-ELEMENT *LIB(LIB=X,ELEM=LLM,TYPE=L),PATTERN='.....SYSLNK.*'
    INPUT  LIBRARY= :1SOSQ:$USER.X
    INPUT  ELEMENT= (L)LLM/@(0001)/2012-10-09
    RECORD-TYPE: 160
       $.SYSLNK.LMS.036
    MSLMSSYSLNK.LMS
           2 OUT OF        7 RECORD(S) FOUND
    INPUT  LIBRARY= :1OSQ:$USER.X
           1 OUT OF        1 (L)-ELEMENT(S) FOUND