Macro XDIR (from Fraktal SAS Programming): Unterschied zwischen den Versionen

Aus phenixxenia.org
Zur Navigation springen Zur Suche springen
K
K
Zeile 8: Zeile 8:
 
|vorwärts=Macro XEDIT (from Fraktal SAS Programming)
 
|vorwärts=Macro XEDIT (from Fraktal SAS Programming)
 
}}
 
}}
 +
 +
'''This SAS Macro reads entries from a specified OS directory and writes results to the SAS LOG screen.'''
 +
* When no directory is specified, a pop-up window is defined and opened to ask the user for the directory name.
  
 
{| class="wikitable"
 
{| class="wikitable"

Version vom 4. August 2014, 13:31 Uhr

Zurück

Übersicht

Vorwärts

This SAS Macro reads entries from a specified OS directory and writes results to the SAS LOG screen.

  • When no directory is specified, a pop-up window is defined and opened to ask the user for the directory name.
Code executed Function performed
%MACRO xdir(xpath);
Start macro definition with name and positional parameter xpath.
%IF %LENGTH(&XPATH.) = 0 %THEN %DO;
Define branch when parameter xpath is not supplied.
%WINDOW path
Start definition of pop-up window.
irow = 20 rows = 14 icolumn = 30 columns = 64
Specify position and size of window.
#4 @5 'Enter path: ' xpath 40 attr = underline
Specify constant text shown, parameter name to be populated and attributes.
 ;
Terminate pop-up window definition statement.
%DISPLAY path;
Open pop-up window.
%END;
Finalize branch definition for empty parameter xpath.
filename path pipe "dir /b ""&XPATH.""" lrecl = 256;
Define text data stream with type pipe and logical record length.
data _NULL_;
Initiate data step run group.
length entry $256;
Specify length in byte for character field entry.
infile path length = lrecl;
Open text data stream path.
input entry $varying256. lrecl;
Specify structure of data stream path.
put entry;
Write value from field entry to the SAS LOG screen.
run;
Terminate data step run group.
filename path clear;
Revoke definition of text data stream.
%MEND xdir;
END macro definition with name

Zurück

Übersicht

Vorwärts