BookmarkSubscribeRSS Feed
NJGIRL
Obsidian | Level 7

Dear all,

here is an example:

%let client = ABC PHARM;

%let study = 123;

 

title1 "&client &study" ;

proc print;

run;

 

how do I get a space between client and study in the title? thanks so much!

4 REPLIES 4
mkeintz
PROC Star

I ran this version of your program and got the result you want:

 

%let client = ABC PHARM;
%let study = 123;

title1 "&client &study" ;
proc print data=sashelp.class (obs=1);
run;

 

producing ...

                                                     ABC PHARM 123                         09:41 Thursday, June 29, 2017   3

                                        Obs     Name     Sex    Age    Height    Weight

                                          1    Alfred     M      14      69       112.5

 

 

Do you not get the same results?

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

--------------------------
NJGIRL
Obsidian | Level 7
Hi thanks --


I am not getting a space between 'Pharm' and '123'

Thanks 🙂
ballardw
Super User

@jill1 wrote:
Hi thanks --


I am not getting a space between 'Pharm' and '123'

Thanks 🙂

I agree with @mkeintz, I get a space in the title.

 

You may have to show the log including and ODS destination and options. If so please post the log in a code box opened using the forum {i} menu icon to prevent the message window from reformatting text.

Quentin
Super User

I can't imagine how it could be that you don't get a space.

 

Just for curiosity, and to remove ODS from the process,  what to you get from:

 

%let client = ABC PHARM;
%let study = 123;
title1 "&client &study" ;

proc sql;
  create table mytitle as 
  select text 
  from dictionary.titles;
quit;


data _null_;
  set mytitle;
  if text="ABC PHARM 123" then do;
    put "Confirmed: title has a space! " text=;
  end;
  else do;
    put "ERROR: No space! " text=;
  end;
run;

?

 

 

In the log, I get:

Confirmed: title has a space! text=ABC PHARM 123
BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 974 views
  • 1 like
  • 4 in conversation