Published on :
Général CREATION_INTERNE

Sans titre

This code is also available in: Español Français
This macro declares a global variable 'sasfile'. It resets the page number to 1 via the 'pageno' option. Conditional logic checks if the environment is interactive (FORE) and if the SAS© version is older than 7 to clear log and output windows via Display Manager (dm) commands. Finally, it extracts the root of the program name provided as an argument.
Data Analysis

Type : CREATION_INTERNE


The script does not manipulate external data, only macro variables and system options.

1 Code Block
MACRO
Explanation :
Definition of the 'newsas' macro taking a 'program' argument. It initializes the environment and extracts the SAS file name into a global variable. The 'dm' part is conditional on older SAS versions.
Copied!
1%global sasfile;
2%macro newsas(program);
3 /* title: Restart page numbers, clear windows under SAS Display Mgr */
4 /* Set the name of the current program & restore page numbers */
5 options pageno=1;
6 
7 %IF &sysenv = FORE and &sysver < 7 %THEN %DO;
8 dm 'clear log';
9 dm 'clear output';
10 %END;
11 
12 %let sasfile = %scan(&program,1,.);
13%mend;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.