Hello,
Note that instructions in a data step are executed for each iteration of the data step.
Since the macrovariable name you declare in the call symputs are not observation dependant,
&status. will be overwritten at each iteration and will eventually be equal to the value
for the last observation of the dataset. If you really want the value for the last observation,
you don't need to read the whole dataset. See for instance :
https://communities.sas.com/t5/SAS-Programming/How-to-output-last-observation-of-a-SAS-data-set/td-p/8404
Alternatively, if you want to create one macrovariable per observation, youcan suffix their
names with the observation number :
call symputx(cats('statut_',_N_), Make);
Note that i used symputx instead of symput as it strips the string in argument before exporting it
into a macrovariable, which is generally what is wanted.
In your test, since you are comparing strings, you can upcase them to avoid rejection
because of case differences :
if upcase(Make)='VOLKSWAGEN' ...
Edit : A last advice is to carefully check the spelling, which i should have done before writing 'WOLKSWAGEN' 😀
... View more