Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

CMDWCC Check wildcard syntax and perform pattern matching

&pagelevel(5)&pagelevel

The CMDWCC macro can be used to check a predefined wildcard pattern for correct syntax and to perform pattern matching. Examples demonstrating the use of CMDWCC can be found on "CMDWCC Check wildcard syntax and perform pattern matching"

  • Operation

Operands

CMDWCC

ACTION = list-poss(2): *CHECK / *MATCH

,PAT@ = <var: pointer>

,PATL = <var: int:4>

,INP@ = NULL / <var: pointer>

,INPL = 0 / <var: int:4>

,FGG = *NO / *YES / <var: bit:1>

,PART_Q = *NO / *YES / <var: bit:1>

,SYNTAX = *BS2000 / *POSIX

,WORK@ = NULL / <var: pointer>

,PREFIX = C / <char:1>

,MACID = MDW / <char:3>

,MF = D / C / L / M / E

,PARAM = <var: pointer>

ACTION =
Defines if only the wildcard syntax is checked or if pattern matching is also performed.

*CHECK
The wildcard pattern is checked for correct syntax.

*MATCH
The wildcard pattern is matched with the string specified by INP@. The syntax of the pattern should always be verified with *CHECK beforehand or at the same time.

PAT@ = <var: pointer>
Address of the wildcard pattern.

PATL = <var: int:4>
Length of the wildcard pattern.

INP@=
Only for ACTION=*MATCH:
Specifies the address of a string to be matched with the wildcard

NULL
No string is specified for comparison.

<var: pointer>
Address of a string.

INPL=<var: int:4>
Length of the string (only for ACTION=*MATCH).

FGG=
Specifies whether file generation groups are supported when matching the wildcard pattern with the input string.

*NO
File generation groups are not supported.

*YES
File generation groups are supported.

<var: bit:1>


Bit variable:


bit = 0: file generation groups are not supported.
bit = 1: file generation groups are supported.


PART_Q =
Specifies whether partially qualified file names are supported when matching the wildcard pattern with the input string.

*NO
Partially qualified file names are not supported.

*YES
Partially qualified file names are supported.

<var: bit(1)>


Bit variable:


bit = 0: partially qualified file names are not supported.
bit = 1: partially qualified file names are supported.


SYNTAX =
Defines which type of wildcard syntax is used.

*BS2000
The complete BS2000 wildcard syntax may be used.

*POSIX
The POSIX wildcard syntax is used.

WORK@=
Only for ACTION=*MATCH.
Specifies the address of a working area for comparing the input string with the wildcard search pattern.

NULL
Specifies no work area.

<var: pointer>
the input string with the wildcard pattern. The work area must have a minimum length of (5*PATL/4 + 5)*4 bytes and must be aligned on a word boundary.

For a description of the parameters PREFIX, MACID, MF and PARAM: see section “Macrotypes”.

Return information and error flags

The return code is passed in the standard header of the parameter area.

Standard header


cc: Subcode 2 (SC2)
bb: Subcode 1 (SC1)
aaaa: Maincode
(SC2)

SC1

Maincode

Meaning

00
00
00
00
01

00
40
40
01
00

0000
0001
0002
0008
0000

No errors
Syntax error in pattern
Input string does not match pattern
Parameter error
No wildcard in pattern

Notes

  • The data type of a pattern for file names can be <filename> or <partial-filename>.

  • A partially qualified file name may also be used as a wildcard pattern.

  • The following table must be taken into consideration when matching a wildcard pattern with file names that have generation numbers. The table contains the currently applicable cases in which a match is possible.

    For more information on file generation groups (fgg), see the “Introductory Guide to DMS” [7 (Related publications)].

    INPUT string

    PATTERN string

    Match possible?

    without fgg

    without fgg
    with fgg

    yes
    no

    with absolute fgg
    (abs_fgg (*nnnn))

    without fgg
    with abs_fgg (*nnnn)
    with rel_fgg (+/-nn)

    yes
    yes if (*nnnn) matches
    no

    with relative fgg
    (rel_fgg (+/-nn)

    without fgg
    with abs_fgg (*nnnn)
    with rel_fgg (+/-nn)

    yes
    no
    yes if (+/-nn) matches

    abs_fgg :

    absolute file generation group (*nnnn), 0001<=nnnn<=9999

    rel_fgg :

    relative file generation group (+/-nn), 0<=nn<=99

This table may be rendered obsolete by future system extensions and should hence not be treated as a guaranteed interface.

Examples of the use of CMDWCC

EXWCC   START
        BASR  10,0
        USING *,10
*
* HOW TO USE CMDWCC
*
*
* EXAMPLE 1: PL1 IS INITIALIZED USING MF=L
*
EX1     LA 1,PL1
        CMDWCC MF=E,PARAM=PL1
        B EX2
PL1     CMDWCC MF=L,PAT@=A(PAT),PATL=8,INP@=A(INP),INPL=8,             *
               SYNTAX=*BS2000,ACTION=*MATCH,WORK@=A(WA)
*
* EXAMPLE 2: PL2 IS INITIALIZED USING MF=L WITH DUMMY VALUES
*            AND MODIFIED USING MF=M BEFORE EXECUTION 
* NOTE: MF=M ASSUME THAT THE PARAMETER AREA IS POINTED BY REGISTER 1 
*
EX2     LA 1,PL2
        USING CWCC_MDL,1
        CMDWCC MF=M,PATL=PATL,INPL=INPL,PAT@=A(PAT),INP@=A(INP),       *
               WORK@=A(WA)
        CMDWCC MF=E,PARAM=PL2
        B EX3
PL2     CMDWCC MF=L,PAT@=A(0),PATL=0,INP@=A(0),INPL=0,                 *
               SYNTAX=*BS2000,ACTION=*MATCH,WORK@=A(0)
*
* EXAMPLE 3: PL3 IS INITIALIZED USING MF=L WITH DUMMY VALUES
*            AND MODIFIED USING MF=M BEFORE EXECUTION IN ANOTHER WAY
* NOTE: MF=M ASSUME THAT THE PARAMETER AREA IS POINTED BY REGISTER 1 
*
EX3     LA 1,PL3
        USING CWCC_MDL,1
        LA     2,PAT
        ST     2,PATADD
        LA     2,INP
        ST     2,INPADD
        LA     2,WA
        ST     2,WAADD
        CMDWCC MF=M,PATL=PATL,INPL=INPL,PAT@=PATADD,INP@=INPADD,       *
               WORK@=WAADD
        CMDWCC MF=E,PARAM=PL3
        TERM 
PL3     CMDWCC MF=L,PAT@=A(0),PATL=0,INP@=A(0),INPL=0,                 *
               SYNTAX=*BS2000,ACTION=*MATCH,WORK@=A(0)
PATADD  DS     A
INPADD  DS     A
WAADD   DS     A
*
* PATTERN AND INPUT
*
PAT     DC     C'PATTERN*         ' 
PATL    DC     F'8'
INP     DC     C'PATTERNA         ' 
INPL    DC     F'8'
WA      DS     0A
        DS     XL1000
        CMDWCC MF=D
        END