How do I add a zero before the decimal when formatting a pvalue?
data pvalue;
p = 0.00000;
run;
proc print data=pvalue;
format p pvalue6.3;
run;
format pvalue6.3 outputs "<.001" but I want the output to read as "<0.001"
One way is to create your own format:
proc format; value mypval low -< 0.001 = '<0.001' other =[pvalue6.3] ; run; data example; x=0.000032; format x mypval6.3; run;
you will need to make sure the format is available in each session you want to use it.
One way is to create your own format:
proc format; value mypval low -< 0.001 = '<0.001' other =[pvalue6.3] ; run; data example; x=0.000032; format x mypval6.3; run;
you will need to make sure the format is available in each session you want to use it.
A little experimentation seems to lead me to the conclusion that this is not possible with the PVALUE format.
I think you can create a PICTURE format for this. Example: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/proc/n1cfmr7vkts0wen1uy3mdge44phy.htm
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 25. 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.