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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 436 views
  • 1 like
  • 3 in conversation