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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.