MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » October 2012

Re: Obtaining a value from within a string using CL



fixed

Not hard in CL. Much better and easier in CLLE.

Just wondering if C functions could be used in CLLE.

But, really not hard enough in CL or CLLE to need to use RPG.

I have a CL program I wrote in 1999 that retrieves a list of files
from a VAX system, searches for a specific date on a directory list,
then retrieves the file. Just used SUBSTR and a couple of loops.
Would have been a lot better in CLLE as the looping would have been
cleaner.

For anybody who might not know how a VAX directory listing looks,
their are some quirks.

Filename cane have 32 characters to the left and 32 characters to the
right of a period. Following the characters to the right of the
period, there is a semicolon, followed by a left justified file
version number. The file name could also appear on the second line,
depending on the width of the returned line. So, I had to locate the
leftmost character of the filename, (fixed location, so not an issue),
the period, and the semicolon. Extract characters from the left up to
the semicolon. I may have used QCLSCAN. Don't remember. Either CLLE
was not available, or was not allowed.

John McKee

On Wed, Oct 3, 2012 at 5:56 PM, Pete Hall <pete@xxxxxxxxxxxxxx> wrote:
I think you'll need to step through it character by character looking for
delimiters, then extract the value based on the location of the
delimiters. I had to do a ton of that sort of stuff way back when. It's a
royal pain, but it does work. Much easier in a higher level language. If
you're doing a lot of that, check out rexx. I'm pretty sure it can do
that a lot more easily, but I haven't worked with it in 15 years, so I
really can't help you with it.

On Wed, 03 Oct 2012 16:48:56 +0000, Alan Shore wrote:

Hi everyone And before I forget (as I normally do) we are on V5r4.
Within CL, is there a way to obtain a string from the following
examples.

1. /weborders/PP91055370.txt From the above, I am looking for the
value PP91055370
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact