SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ramtejdasari
Calcite | Level 5

Hi Users,

 

I am trying to add an asterisk to the implausible values in the SAS output. I concatenate the asterisk in the dataset but when I use proc report  for the output , the outputs doesn't show asterisk because it is in character format. Is there any option  in the  proc report to concatenate asterisk to the specific values. Here I am trying to concatenate asterisk to (Descriptive stats)Max values  

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  Using SASHELP.CLASS, and a PICTURE format, you can specify a way to alter the display of a value. In this example, for any age that is 15, I want to have an asterisk appended to the variable value. The PICTURE format is not only available to use with PROC REPORT, you can use this type of format with other procedures too:

Cynthia_sas_0-1610155509514.png

 

Cynthia

View solution in original post

6 REPLIES 6
Cynthia_sas
SAS Super FREQ

Hi:

  Using SASHELP.CLASS, and a PICTURE format, you can specify a way to alter the display of a value. In this example, for any age that is 15, I want to have an asterisk appended to the variable value. The PICTURE format is not only available to use with PROC REPORT, you can use this type of format with other procedures too:

Cynthia_sas_0-1610155509514.png

 

Cynthia

ramtejdasari
Calcite | Level 5

Thank you so much. I got the expected output.

ballardw
Super User

@Cynthia_sas's approach is where I would start.

With simple range of values it is easy. But, implausible for one record/group might be plausible for another.

Consider a measurement of people like height. If your data includes children to adults then a value of 6 feet might be "implausible" for a 5 year but quite plausible for a 30 year old male.

 

So if your range of "plausible" varies based on the values of one or more other characteristics then you should provide such description/examples. In such cases I would expect to have to summarize the data before displaying the result.

Cynthia_sas
SAS Super FREQ

Yes, @ballardw makes a fair point. If you need to do some kind of highlighting based on the values or interaction between 2 or more columns, then you would need to move to a COMPUTE block with PROC REPORT as shown below:

Cynthia_sas_0-1610243220990.png

 


Cynthia

ramtejdasari
Calcite | Level 5

@Cynthia_sas  Hi , I have a follow up question , I assign the asterisk using the picture format. I need this format for only one treatment arm(180mg) , but its getting duplicated other values. Please find the attached pdf output  

Cynthia_sas
SAS Super FREQ

Hi:
Without seeing ALL of your code and having some test data, it is impossible to make a constructive comment. The one thing that I can think might cause the behavior you describe, is if you might have an ACROSS variable on your report? If so, then a simple format won't work in that case. You'll have to use CALL DEFINE, as I showed in my last posted example, where I tested height and weight. But with an ACROSS item, the code gets a bit more complex. You'll have to use absolute column numbers in the CALL DEFINE. I could not open your PDF file because it got an error.


  Here's an ACROSS example where I only want to add an asterisk for the WEIGHT value under the M Across column:

Cynthia_sas_0-1610503141494.png


  Here's a paper that talks more about using ACROSS items with PROC REPORT http://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf

 
. Of course, if I guessed wrong, then you'll need to explain in more detail providing code and data. Or work with Tech Support on this. Tech Support can look at ALL your data and ALL your code and answer your question.
Cynthia

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 3265 views
  • 3 likes
  • 3 in conversation