|
SUBSTRINGName:
where <sout> is the name of the resulting string; <sorg> is the name of the original string; <nstart> is the start position in <sorg>; and <nstop> is the stop position in <sorg>.
LET SOUT = SUBSTRING S1 3 8
In this case, FNAME will now contain the substring rather than the original string.
you need to do
LET FNAME = SUBSTRING SORG 5 6 The start and stop position can be either a parameter or a numeric value. However, it cannot be a numeric expression. So
LET FNAME = SUBSTRING SORG NSTART NSTOP are both allowed but
is not allowed. You would need to enter this as
LET FNAME = SUBSTRING FNAME NSTART NSTOP
LET STRING S1 = file23.dat
LET NSTOP = STRING LENGTH S1
LET NSTART = STRING INDEX S1 SPERIOD
LET SEXT = SUBSTRING S1 NSTART NSTOP
LET NSTOP = NSTART - 1
LET NSTART = 1
LET SBASE = SUBSTRING S1 NSTART NSTOP
The resulting strings SEXT and SBASE will contain
file23
Date created: 12/4/2008 |