Easier would be to use custom format
proc format;
value $fmt 'Yes'="L'utilisateur marche bien" 'No','N/A'=' ';
run;
data want;
set have;
format a--q $fmt.;
run;
The reason your code won't work without modification is that A--Q has a length of 3 characters, this doesn't change when assigning the value L'utilisateur marche bien, you only get the first 3 characters. You would need use a LENGTH statement to change this.
length a--q $ 25;
because the text you want is 25 characters. But really, use the easier approach which is PROC FORMAT above.
Easier would be to use custom format
proc format;
value $fmt 'Yes'="L'utilisateur marche bien" 'No','N/A'=' ';
run;
data want;
set have;
format a--q $fmt.;
run;
The reason your code won't work without modification is that A--Q has a length of 3 characters, this doesn't change when assigning the value L'utilisateur marche bien, you only get the first 3 characters. You would need use a LENGTH statement to change this.
length a--q $ 25;
because the text you want is 25 characters. But really, use the easier approach which is PROC FORMAT above.
@Idi Please don't write followup questions in the field for tags. Please write your followup question by clicking on "Reply".
Then you will need different formats for each variable.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.