Hello,
I have 3 key figures and I would like to print with a specifiq format.
each figure has an old label (measure_label_from) and a new label (measure_label_to).
what I try to do is to translate the label of the figure by using a format.
It works for 2nd and the 3rd figure but NOT for the first. I don't know why.
thanks in adance for your help
Nasser
Data T_indicateurs ;
infile datalines dsd;
input figures ~ $50. amount ;
datalines ;
'Mont DDT sans cumul M0' , 9999
'Mont LRA sans cumul M0' , 1234
'Taux DDT ECR sans cumul M0' , 0.65
run ;
Data T_indicateurs ;
Set T_indicateurs ;
figures = compress(figures,"'") ;
Run ;
Data T_indic_transco ;
infile datalines dsd;
input measure_label_from ~ $50. measure_label_to ~ $50. ;
datalines ;
'Mont DDT sans cumul M0' , 'ENTREE MENS DDT&SU'
'Mont LRA sans cumul M0' , 'ENTREE MENS EN RA'
'Taux DDT ECR sans cumul M0' , 'TX DE SORTIE DDT&SU / Encours'
run ;
Data T_indic_transco_format (Drop = measure_label_from measure_label_to) ;
Set T_indic_transco ;
Retain FMTNAME '$f_measure_label' ;
START = Compress(measure_label_from,"'") ;
LABEL = Compress(measure_label_to,"'") ;
Run ;
Proc format CNTLIN = T_indic_transco_format ; run;
proc print data=T_indicateurs ;
format figures $f_measure_label. ;
run ;
please, run this code and you will notice that only the first row is not translated
Just to make sure: copy/paste the code from your original post back into SAS and run it.
What encoding are you using for your SAS session?
Running your code gives me this result:
Beob. figures amount 1 ENTREE MENS DDT&SU 9999.00 2 ENTREE MENS EN RA 1234.00 3 TX DE SORTIE DDT&SU / Encours 0.65
Looks fine to me, all "figures" values were re-formatted.
Thanks Kurt. for me It doesn't work. running the code gives me this result.
Just to make sure: copy/paste the code from your original post back into SAS and run it.
What encoding are you using for your SAS session?
I have copy/paste the code from my original post into sas and then it works now.
thanks a lot Kurt !!!
Then it's most probable that posting here filtered out an invisible mis-type contained in your code.
Yes Kurt,
I noticed that in the step "datalines" I put some tabulation between values and I noticed that it does NOT work for each lines (transco) that hold a TABULATE and it works for all lines without tabulate.
so by replacing all tabulations by just space, every lines work !!!
thanks kurt !
I have my EG enhanced editor set to always replace all tabs (entered or read from file) with spaces. This also does away with problems caused by different tab spacings (ie 2 in EG, but 8 on UNIX).
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.