BookmarkSubscribeRSS Feed
bbenbaruch
Quartz | Level 8

,EG automatically generates footnotes to certain outputs. From my perspective, the automatic footnotes are half useless.  I don't want the technical information about the platform, server, and software that generated the report.  But information regarding the specific dataset from which the report was generated would be extremely useful.  So I have two questions:

Is there a way to change the values of the text that is automatically generated in EG titles and footnotes?  Or would I have to ALWAYS change the defaults manually?

Is there a way to have the FOOTNOTE automatically output the name of the SAS dataset used for input?

I am assuming that SAS somehow "knows" something about the previous dataset referenced.  For example, if I issue a PROC FREQ statement without specifying DATA= SAS "knows" enough to use the dataset I just created in a DATA step.  Is there some way of having EG automatically put that information into the FOOTNOTE?


8 REPLIES 8
Astounding
PROC Star

The very smallest piece of the puzzle is available.  There is an automatic macro variable &SYSLAST which contains the name of the most recently created SAS data set.  It won't give you the complete path ... merely the name in the typical SAS form LIBNAME.DATASET.  So you would need to do further work if you wanted to know which folder held the data set.

Breaking into the E.G. report templates is going to be the harder part.

Good luck.

bbenbaruch
Quartz | Level 8

&SYSLAST will work if and only if the dataset in the procedure is the last dataset created.  In the kind of work I do, this is rarely the case.  The EG process flow will allow me to visually see which dataset was used to generate results -- but only if the procedure is invoked by a task node or I draw a link between a SAS code node and the dataset.  The real reason for generating footnotes that tell me the source file of the data is that I need to be able to read a report some time after the analysis was completed and be able to track down the EXACT source of the report.

TomKari
Onyx | Level 15

One way you can customize your footnote is to create a "task template" from the task, with the desired changes saved. From then on, whenever you run the template task, you'll get the revised footnote.

Tom

ChrisHemedinger
Community Manager

You can change the "default footnote" text in Tools->Options->Tasks.  This is an application-level setting that will affect all tasks (that generate footnotes).  It won't affect tasks that you've already added to your project -- just those that you create from then on.

Tom's suggest about Task Templates is also a very good idea, especially if you want to apply this to just certain types of tasks.

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
TomKari
Onyx | Level 15

Chris's comment is much the better solution...I thought that facility existed, but I couldn't find it quickly.

Tom

bbenbaruch
Quartz | Level 8

The EG process flow will allow me to visually see which dataset was used to generate results -- but only if the procedure is invoked by a task node or I draw a link between a SAS code node and the dataset.  The real reason for generating footnotes that tell me the source file of the data is that I need to be able to read a report some time after the analysis was completed and be able to track down the EXACT source of the report.

The only way I see of using your suggestion for this purpose is to do something like insert "Generated from the file &file on ....".  But this will only work if I ALSO always manually modify the code with a %LET statement.  At this point, I might just as well manually modify the footnote.

As far as I can discern, there is no way to automatically have a footnote generated that tells me what dataset was used in the procedure.

Doc_Duke
Rhodochrosite | Level 12

&SYSLAST is the dataset that you would work for your initial example.  Other that that I don't think that the SAS Server knows the data set in a PROC unless you tell it.  The connections in EG are part of EG and never make it to the server.

The connections indicate links from files to tasks, but they do not determine them.  You can link any icon to another and that just determines the precedence order for sending programs to the server (EG usually tells you if you have a recursive link.).

Quentin
Super User

Hi,

I think it would be fair to make your suggestion as a SAS ballot idea.

I haven't used the automatic variable &SYSPROCNAME , but it contains the name of the current proc being processed by the "SAS Language Processor".  (I guess the SAS Language Processor is a logical name for whatever controls word scanning/tokenization and sending tokens off to the appropriate compiler.)

With it you can do:

proc print data=sashelp.class;
  title "Current procedure is: &sysprocname";
run;
title;

proc means data=sashelp.class;
  title "Current procedure is: &sysprocname";
run;
title;

Personally, I don't like that style of TITLE statements (I like them before the PROC).  But since &SYSPROCNAME was implemented (I think in a fairly recent version), seems fair to ask for &SysCurrentDSN  (&SYSDSN already exists, but it is like &SYSLAST).

Without that, I would suggest either wrapping your PROC calls in a macro, so that the macro could generate the title for you, or creating a %MakeFootnote(data=) macro, where you pass it a dataset name and it makes footenote like "Run on dataset &data by &user on %now()".  But those would be more programming solutions, not sure how they would feel to an EG task user.

On the other hand, for the general purpose (linking a report back to its source), if you keep the EG project, then there are automatic macro variables that could be used in the footnote to provide the name of the EG project file that generated the report.  For many purposes, having the names of the project file / code is more useful than having the name of the data set.

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 8 replies
  • 1704 views
  • 6 likes
  • 6 in conversation