Substring Expressions
Posted: December 3rd, 2012, 11:45 pm
Dear all,
I'm trying to use the substring expression in preproc to advance in a nth character in a alpha(20) item.
for exemple, i would like that operators change only the 00i in the event where only 00i is incremented in the abdbfg00i string.
If the abdbfg001 is already write the operator in a previous item (such as CODE1(i)), i write this code:
PROC CODAGE
Preproc
numeric i;
if CODE1(i) <>"" then CODAGE(i)=CODE1(i) and
advance to CODAGE[length (CODAGE)7:1];//the first character after the abdbfg string in the alpha (20) item.
else reenter CODE1(i);
endif;
or
PROC CODAGE
Preproc
numeric i
Preproc
if CODE1(i) <>"" then CODAGE(i)=CODE1(i) and
advance to CODAGE[7:1];//the first character after the abdbfg string in the alpha (20) item.
else next;
endif;
but unfortunately, the compiler send:" Expecting ';' or operator near line 2 in CODAGE procedure"
Thanks in advance for answers,
I'm trying to use the substring expression in preproc to advance in a nth character in a alpha(20) item.
for exemple, i would like that operators change only the 00i in the event where only 00i is incremented in the abdbfg00i string.
If the abdbfg001 is already write the operator in a previous item (such as CODE1(i)), i write this code:
PROC CODAGE
Preproc
numeric i;
if CODE1(i) <>"" then CODAGE(i)=CODE1(i) and
advance to CODAGE[length (CODAGE)7:1];//the first character after the abdbfg string in the alpha (20) item.
else reenter CODE1(i);
endif;
or
PROC CODAGE
Preproc
numeric i
Preproc
if CODE1(i) <>"" then CODAGE(i)=CODE1(i) and
advance to CODAGE[7:1];//the first character after the abdbfg string in the alpha (20) item.
else next;
endif;
but unfortunately, the compiler send:" Expecting ';' or operator near line 2 in CODAGE procedure"
Thanks in advance for answers,