The SCANSTR() function scans a text string for complex patterns.
{0|1} = SCANSTR(pattern,string,[vldc],[fldc])
Parameters
If the specified pattern is present in the scanned string, a 1 is returned. If the string is not found, a 0 is returned.
Pattern character string to be searched for. The pattern is composed of any combination of characters and placeholders (VLDCs and FLDCs).
Text string to be scanned for the pattern.
(Variable-Length Do not-Care) A character that, when appearing in the pattern, is taken to represent an arbitrary string of any length (including zero).
Default: & (ampersand)
(Fixed-Length Do not-Care) A character that, when appearing in the pattern, is taken to represent exactly one arbitrary character.
Default: * (asterisk)
All usage notes assume that the VLDC character is & and the FLDC character is *.
ARG n MISSING OR INVALID
SCAN PATTERN TOO LONG OR COMPLEX
Example
/* Unpack a julian date from ISPF statistics format */ 1 == scanstr('&cat&','cats and dogs') 1 == scanstr('&c*t&','dogs and cats') 0 == scanstr('&Cat&','cats and dogs') 1 == scanstr('&CAT&',translate('Cats and Dogs')) 1 == scanstr('&cat&dog&','cats and dogs' 1 == scanstr('cat&d**s','cats and dogs') 1 == scanstr('&cat&dog&','complete catalog of doggerel')
Copyright © 2014 CA Technologies.
All rights reserved.
|
|