-
Notifications
You must be signed in to change notification settings - Fork 8
/
printtype.sas
71 lines (58 loc) · 2.23 KB
/
printtype.sas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
%macro PrintType(type,lib=,where=) / des="Print objects from SASHELP.VCATALG";
/********************************************************************************
BEGIN MACRO HEADER
********************************************************************************
Name: PrintType
Author: Chris Swenson
Created: 2010-04-02
Purpose: Print objects from SASHELP.VCATALG, e.g., FORMAT
Arguments: type - type of object to output
lib= - library to filter on
where= - additional filter criteria
Revisions
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Date Author Comments
¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯
2012-03-21 CAS Corrected SQL and added WHERE= and LIB= arguments.
YYYY-MM-DD III Please use this format and insert new entries above
********************************************************************************
END MACRO HEADER
********************************************************************************/
%if "&type"="" %then %do;
%put %str(E)RROR: No type specified.;
%return;
%end;
%let type=%upcase(&type);
proc sql;
create table _vcatalg_ as
select * from sashelp.vcatalg
where substr(objtype, 1, length("&TYPE"))="%upcase(&TYPE)"
%if %superq(WHERE) ne %str() %then %do;
and &WHERE
%end;
%if %superq(LIB) ne %str() %then %do;
and libname="%upcase(&LIB)"
%end;
;
quit;
data _null_;
set _vcatalg_ end=end;
if _n_=1 then do;
put @5 "AVAILABLE &type.S";
put "NOTE-";
put @5 "Name" @30 "Description";
put @5 "----" @30 "-----------";
end;
put @5 Objname @30 Objdesc;
if end then do;
put "NOTE-";
if "&type"="MACRO" then do;
put @5 "Note: This list only includes autocall macros that have already been used.";
put "NOTE-";
end;
end;
run;
proc sql;
drop table _vcatalg_;
quit;
%mend PrintType;