BookmarkSubscribeRSS Feed
thanikondharish
Fluorite | Level 6

data s ;
wishes='happy new year
                  happy birthday
                         congrats my baby ' ;
run;

 

if we run above program it gives record keep in two lines but i want to data keep in three line as we give data data in three line and same

 structure one by one line

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

As I praised in your other thread, I really like that you provide usable example data in the form of data steps. 

 

However, the rest of your question, including the title of your question, makes very little sense to me? Please elaborate and specify what you want your desired result to look like.

PGStats
Opal | Level 21

SAS character variables hold character strings, not lines. You may have seen your variable represented on two lines in the dataset viewer, but expand the field and you will see that it is realy only one line of text.

If you want separate lines, you must read them as such.

 

data s;
wishes_1='happy new year';
wishes_2='happy birthday';
wishes_3='congrats my baby';
run;

/* OR */

data s;
wishes='happy new year'; output;
wishes='happy birthday'; output;
wishes='congrats my baby'; output;
run;
PG

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
  • 2 replies
  • 921 views
  • 0 likes
  • 3 in conversation