Announcement

Collapse
No announcement yet.

Add a program path and name in footnote

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Add a program path and name in footnote

    Add a program path and name in footnote.
    Often is useful to place the program path and name in the footnote. The first step is to create a macro variable PGMLOC containing the stand alone saved program path and the program name in a pre-processing program.

    1. Use the LIBNAME the Study-set up defines such as (PGM_SAF) to get the path and use the template name as the program name.

    Code:
     
     
    %let template=T001;


    In WINDOWS environment:

    Code:
    %let pgmloc=%sysfunc(pathname(pgm_saf))\&template..sas;


    In UNIX environment:

    Code:
    %let pgmloc=%sysfunc(pathname(pgm_saf))/&template..sas;

    In ClinPlus Report V3.11 the macro variable for TEMPLATE is not available at the template loading time so we have to put “%let template=template name” before creating PGMLOC macro variable. In the next version we make the system macro variables like SOURCE, PROJECT, STUDY, TEMPLATE etc. available at template loading time.

    There are two methods to add this macro variable to the footnote.
    1. Place the macro variable directly in the footnote: Footnote=&pgmloc

    2. Make a regular variable in a data step from the macro variable: pgmloc=”&pgmloc”; and place this regular variable in footnote: footnote=!pgmloc.

    There are points to consider before deciding which method you will use:





    Windows environment:
    · In WINDOWS the path has a backward slash which is also a key-word used in %DZSTABLE\%DZSLIST macro calls titles and footnote parameter as line break.


    · At the same time in RTF (Rich Text Format Markup Language) the back-slash is also a key-word for starting a new command – therefore only the beginning of the path will show.


    If you use the first method you can use %NRSRT to make the macro variable resolve later when the backslashes are only text. This would solve the problem with %DZSTABLE\%DZSLIST titles and footnote parameter line-break key-words. However at the same time the use of %NRSTR will negatively impact the RTF output (the length of the footnote is determined at the beginning of the execution for the RTF Engine and because the macro variable is not resolved then yet the length of the footnote will be false and the resulting text in RTF will be cut short.)



    The best solution is to use the second method with the data set variable as PGMLOC. However you still need to double up the back-slashes in order to eliminate the problem with the RTF mark-up back-slash key-words:

    Code:
     
     
    data mydata; length pgmloc $80; set mydata;
     
    **Create the variable for the program location.**;
     
    **Function TRANWRD will double up the back-slashes**;
     
    pgmloc="&pgmloc";
     
    pgmloc=tranwrd(pgmloc,'\','\\');


    UNIX environment:
    The Unix environment uses forward slashes instead of back-slashes therefore there is no problem in using the first method which places the macro variable PGMLOC directly into the footnote:

    Code:
     
     
    Footnote=&pgmloc.. 
    Last edited by Stella Scafidi; 05-11-2006, 11:46 AM.
Working...
X