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