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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.