Hi!
I would like SAS 9.4 to put automatically the name of the data set I'm running on the title of SAS output/results viewer. How to do it?
This is an example of the code I'm running:
libname Experiment 'O:\MAINFOLDER\SUBFOLDER\SAS library';
PROC IMPORT OUT= Experiment.measurements DATAFILE= "O:\MAINFOLDER\SUBFOLDER\filename.xlsx"
DBMS=XLSX REPLACE;
SHEET="SAS";
GETNAMES=YES;
RUN;
PROC PRINT data=Experiment.measurements;
title 'Data set Experiment.measurements all observations';
run;
So how do I make SAS automatically to change the title text marked with red to match the current data set I'm running? It's to time consuming to change all the titles manually when changing from one data set to another!
Thanks for any help
Maybe i missed something, but aren't libref limited to 8 chars and datasets to 32 chars?
SAS saves the name of the last dataset created by datastep or proc in the macro-variable SYSLAST. So changing the title-statement to
title "Dataset &SYSLAST all obs";
should solve the problem.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.