sas >> Question regarding macro storage

by Mindy » Sun, 19 Aug 2007 01:28:26 GMT

Hey, guys,

I felt a little confused about macro storage.

In my job, we use code such as
Filename initial 'c:/temp';
%incude initial (try);
to include sas code try in current program,

But I saw some codes as
Filename prtsort catalog 'sasuser.mymacs';
%include prtsort(prtlast);

Does anybody know why we need catalog in the second filename
statement?

Thanks a lot,
Mindy


sas >> Question regarding macro storage

by jim4stat » Mon, 20 Aug 2007 18:55:04 GMT


Hi Mindy,

From the SAS docs:
The CATALOG access method in the FILENAME statement enables you to reference
a SAS catalog as an external file. You can then use any SAS commands,
statements, or procedures that can access external files to access a SAS
catalog.

Regards - Jim.

sas >> Question regarding macro storage

by rjf2 » Mon, 20 Aug 2007 22:58:39 GMT

> From: Mindy

this is not a macro storage Q;
it is about storing macros as programs within a catalog.

I am not familiar with the process of loading sas programs (text)
into a catalog.

note: SASuser is a libref:

2 libname sasuser list;
NOTE: Libref= SASUSER
Scope= Kernel
Engine= V9
Physical Name= C:\My SAS Files\9.1
File Name= C:\My SAS Files\9.1

if you want to see what is in the program prtlast then use this option:

options source2;
%include prtsort(prtlast);

or

%include prtsort(prtlast)/source2;

You need to search around to find the program that loaded the macros
into the catalog.

for the record, including programs with macro code as a way of
referencing the macro is
Not Recommended.

RTFM: options sasautos mautosource

proc options define value option = sasautos;
proc options define value option = mautosource;
proc options group = macro;
run;

see also: page 5 and 6 of

A SASautos Companion: Reusing Macros
http://www2.sas.com/proceedings/sugi30/267-30.pdf

Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov

Similar Threads

1. SN#21980 Benchmarking SAS Grid Computing 9.2 on the Sun Storage 7410 Unified Storage System

2. a question regarding GLM model

3. question regarding eof

Hey, guys,

I have a program as below:

data try;
 input a b;
cards;
 1 2
 3 4
 3 8
 ;
 run;

 data try2;
   set try;
   where a=5;
run;
 data _null_;
  set try2 end=eof;
  if end=0 then put "Warning: data set doesn't exist";
 run;

I hope to have  warning in log, but the from the log it says Variable
end is uninitialized. Even I change condition to a=3, the warning
variable end is unintialized is still there. Can anyone explain?
thanks.

Mindy

4. a question regarding count row number in SQL

5. QUICK question regards to wrapping the date

Hi users

I used proc print but could not wrap this long record.

After that I used proc report and used flow and stuff but still I am
having problem wrapping this specific date record.
Help me
 define PI*** /order  left  width=10 'PatientID^(pids)' flow;

Is there any quick way to wrap the text.


This all the dates stays on one row.

~7/14/2005~7/14/2005~7/14/2005~7/14/2005~7/14/2005~7/14/2005~7/14/2005~7/14/2005~7/14/2005~7/14/2005~7/14/2005~7/14/2005~7/14/2005~5/10/2001~5/10/2001~5/10/2001~5/10/2001~8/16/2001~8/17/2001~8/16/2001~8/16/2001~7/14/2005

6. Asking a question regarding SAS and Excel

7. A question regarding ANCOVA Models interpreation

Hi all,

I need to identify which of the outcome variable A, B, C and D are the
best outcome variable. And the following ANCOVA analyese were perform.

Model A=EM AGE SEX EDUC
Model B=EM AGE SEX EDUC
Model C=EM AGE SEX EDUC
Model D=EM AGE SEX EDUC

Unfortunately, none of the models are significant - none of the outcome
variables are significantly associated with EM (the key varable).

>From here, how would I determine which model/which outcome variable is
the best one that is associated with EM?

Thanks for your help!!!

Larry

8. OT: statistical question regarding standard error