BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
EC27556
Quartz | Level 8

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).

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
AMSAS
SAS Super FREQ

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

 

 

PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 4 replies
  • 1303 views
  • 1 like
  • 3 in conversation