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. statistical question regarding standard error

It appears to me that you might have inadvertently changed the scale from
percent to proportion.

Paul R. Swank, Ph.D.
Professor, Developmental Pediatrics
Medical School
UT Health Science Center at Houston



-----Original Message-----
From: SAS(r) Discussion [mailto: XXXX@XXXXX.COM ] On Behalf Of Kerri
Rivers
Sent: Thursday, October 23, 2003 3:58 PM
To:  XXXX@XXXXX.COM 
Subject: OT: statistical question regarding standard error


hi all,

sorry for posting this here - i thought i'd tap the wealth of knowledge on
this list to see if anyone can explain this to me.

i'm working with 2000 and 2001 supplementary survey data (ACS data from the
census bureau).  i've calculated estimates and percents for educational
attainment by race for 2000 and 2001 for the states.  b/c i'm breaking this
down by different race groups (and the unweighted observations in some cases
are small), some standard errors are quite large.

i decided to do a 2-year average to decrease the standard error.  the
standard error did, in fact, decrease.  the SE just decreased so
substantially, that i'm wondering why/how.  i've checked and rechecked all
of my calculations, and everything is correct.

can anyone hazard a guess as to why the standard error dropped so
dramatically using a 2 year average?  i need to be able to explain this to
my funder.

here's an example of the standard error for percents that i'm talking about.
all data are for non-hispanic, black alone ages 18-64 at different levels of
educational attainment.  the sample size for 2001 data is roughly 3xs a
large as the sample size for 2000.

yr 2000 SEperc , yr 2001 SEperc, 2yravg SE perc
1.91 , 1.07 , .01
2.02 , 1.26 , .02
2.10 , 1.32 , .02
6.17 , 5.59 , .04
12.45, 8.80 , .10
13.32, 9.44 , .20
4.14 , 2.69 , .03

i just can't fathom how a standard error of 12.45 one year and 8.8 the next
year drops to .1 with a 2 year average.  that seems HUGE to me.

any thoughts would be greatly appreciated.  if anyone can help and you need
more info, i'm happy to provide more.  :)

thanks much,
~kerri

Kerri Rivers
Research Associate
Population Reference Bureau
1875 Connecticut Avenue, NW
Suite 520
Washington, DC 20009

8. A question regarding ANCOVA Models interpreation