Relative Content

Tag Archive for sas

How do I print formated text in a barchart segment using sgrender/sgplot?

I´d like to make a barchart in SAS using proc sgplot/sgrender and be able to adjust the font color according to the fill color or the perticular segment value. The fill color could go from dark to light as the font at some value the font color switches from white to black to get a good contrast.

SAS Base: KEEP Statement and KEEP = Option

Hi I am new to SAS and I came across a SAS Base Programming Reference Sheet. In the section of The Data Step: Controlling Variable Output, the example code in the box confuses me.

How to retain days and stop in conditional situation and then keep going?

I am trying to count the duration of medication use. I would like to count days that every outpatient visit if they are not exceed 90 days between every visit.
The med_date is the date of every outpatient visit. I first use lag function to count the days between each visit(variable diff).
And I want to retain them and stop if the diff>90.
Then keep going with another id.
My code would stop if the diff>90, but I have no idea how to keep going

Issues while converting dates into SAS format

I have a big dataset with dates in the char format dd/mm/yyyy (e.g., 07/06/2014) I would like to convert into SAS format. I tried using input (variable_name, MMDDYY10.) but with the following issues: