×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx> wrote on 03/06/2018
12:13:38 PM:
Since this is fixed length and the only variable is the value of the
timestamp, I'm wondering if it would be overkill to test with regex as
opposed to substringing the timestamp elements and testing those values.
For fixed-length data with a fixed format I would not bother with
REGEX. I would also avoid %SST, though, by using the new ability to
redefine CL variables -- which basically means creating a data structure
format with subfields for the different parts of your string. For
example:
DCL VAR(&FILENAME) TYPE(*CHAR) LEN(40)
DCL VAR(&F_PREFIX) TYPE(*CHAR) LEN(19) STG(*DEFINED) DEFVAR(&FILENAME 1)
DCL VAR(&F_MO) TYPE(*CHAR) LEN( 2) STG(*DEFINED) DEFVAR(&FILENAME 20)
DCL VAR(&F_MO_DOT) TYPE(*CHAR) LEN( 1) STG(*DEFINED) DEFVAR(&FILENAME 22)
DCL VAR(&F_DD) TYPE(*CHAR) LEN( 2) STG(*DEFINED) DEFVAR(&FILENAME 23)
DCL VAR(&F_DD_DOT) TYPE(*CHAR) LEN( 1) STG(*DEFINED) DEFVAR(&FILENAME 25)
DCL VAR(&F_YY) TYPE(*CHAR) LEN( 2) STG(*DEFINED) DEFVAR(&FILENAME 26)
DCL VAR(&F_YY_ULN) TYPE(*CHAR) LEN( 1) STG(*DEFINED) DEFVAR(&FILENAME 28)
DCL VAR(&F_HH) TYPE(*CHAR) LEN( 2) STG(*DEFINED) DEFVAR(&FILENAME 29)
DCL VAR(&F_MM) TYPE(*CHAR) LEN( 2) STG(*DEFINED) DEFVAR(&FILENAME 31)
DCL VAR(&F_SUFFIX) TYPE(*CHAR) LEN( 4) STG(*DEFINED) DEFVAR(&FILENAME 33)
DCL VAR(&F_EXTRA) TYPE(*CHAR) LEN( 4) STG(*DEFINED) DEFVAR(&FILENAME 37)
Sincerely,
Dave Clark
As an Amazon Associate we earn from qualifying purchases.