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

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.