BookmarkSubscribeRSS Feed
mmkr
Quartz | Level 8

I am trying to combine two columns and add a enter or next line the values , can you help me ?

 

data test;
x="himom";
y="hidad";
;
run;


data want;
set test ;
length D $50 ;
d = catx('0D0A'x,x,y);
run;

proc print data=want;run;

 

Result i want :

 

newcolumn

-----------

himom

hidad

4 REPLIES 4
ballardw
Super User

Where do you expect this to appear? It might be possible for some ODS destinations but it may be that the approach is different for different file types.

And basically isn't going to appear in a data set view.

mmkr
Quartz | Level 8
in Proc report i would like to sipaly
mkeintz
PROC Star

I don't think there is a way for PROC PRINT to honor linefeed/carriage returns within the value of a single Cell.

 

I wonder if there are any PROC REPORT honchos seeing this question can provide a solution.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
Tom
Super User Tom
Super User

ENTER is a KEY, not a CHARACTER.  I suppose the character you might want is a LINEFEED, '0A'x, or CARRIAGE RETURN, '0D'x.

 

But you are probably better off inserting something that PROC REPORT will recognize as a line break.

 

See this thread for example.  https://communities.sas.com/t5/SAS-Procedures/Multiple-lines-in-a-PROC-REPORT-cell/td-p/312811

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 237 views
  • 1 like
  • 4 in conversation