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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.