Hello,
I want to combine two dataset: PL and PLC vertically,
so I use the
data all;
set PL PLC;
run;
I hope the output will show: a title for PL and a title for PLC in one dataset , does anyone know how and where can I add that please?
Thank you
Titles don't exist within a dataset, only for reports.
Look at Example 2
You will need a variable to differentiate the datasets, look at the INDSNAME option to capture the name of the dataset.
Data all;
length source dsname $50.;
set pl plc INDSNAME=source;
dsname=source;
run;
Titles don't exist within a dataset, only for reports.
Look at Example 2
You will need a variable to differentiate the datasets, look at the INDSNAME option to capture the name of the dataset.
Data all;
length source dsname $50.;
set pl plc INDSNAME=source;
dsname=source;
run;
Reeza's tools can help, but you may need some programming as well. You may need to add a variable to the data set that holds the text you want to insert into the title (possibly the entire text, as in this example below).
data want;
set PL (in=in1) PLC (in=in2);
length title_text $ 50;
if in1 then title_text = 'I want to use this title for the PL observations';
else title_text = 'Exceptions were also added by the PLC observations';
run;
Then you can use this text as titles by adding a BY statement and #BYVAL:
proc print data=want;
by title_text notsorted;
title '#BYVAL1';
run;
So SAS isn't really built to do what you ask, but you can work around that even without using ODS.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.