I have date variables that are formatted dd/mm/yyyy.
Is it possible to character variables where the values are equal to dd/mm/yyyy?
(Context: I am trying to run a proc report and the date values are not showing up correctly (missing out the "/"s and each part is on a separate line. I'm hoping that by using character variables it might resolve this issue).
If you are running a report (via PROC REPORT or PROC TABULATE), you DO NOT need character strings.
In PROC REPORT, you can use the option
proc report split='~';
and now the / character is not interpreted as a line-break.
If you are running a report (via PROC REPORT or PROC TABULATE), you DO NOT need character strings.
In PROC REPORT, you can use the option
proc report split='~';
and now the / character is not interpreted as a line-break.
Can you provide some sample code.
I just attempted the following and my dates aren't being split
data have ;
format date ddmmyy6. ;
do date=today() to today()+3 ;
dateC=putn(date,"DDMMYY10.") ;
output ;
end ;
run ;
proc report split='/';
column date datec ;
run ;
Output:
date | dateC |
---|---|
100522 | 10/05/2022 |
110522 | 11/05/2022 |
120522 | 12/05/2022 |
130522 | 13/05/2022 |
I think the issue (I'm speculating) is that dates as column headers have the problem. Dates in the rest of the table shouldn't have the problem.
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.