@Nasser_DRMCP wrote:
Hello,
I need to obtain 2 new column, one column named begin_1 that holds 2018 and one column named begin_2 that holds 201808
because 201802 is the first begining of periode B and 201808 is the begining of the second periode B
thanks a lot in advance for your help
Nasser
Why do you need new variables? Assuming that by 201802 you mean the variable classe_201802 you already have the variable. And since you are only asking to add new variables with apparently the existing value then there is not reason to add variables.
Also your subject line says "changing between columns". So what do you want to check for changing? What does the expected output for example data look like?
And your macro is almost certainly not needed. A simple
array begin (12) $6. ;
do I= 1 to dim(array_classe);
if array_classe(ii) ne "B" and array_classe(I+1) eq "B" then begin(I) = substr(vname(array_classe(I+1)),8,6);
end;
Though you should be able to calculate the value of begin from the value of the I index variable as well.