| Date: | Mon, 18 Oct 1999 22:52:52 -0500 |
| Reply-To: | Paul McDonald <paul_mcdonald@AMERITECH.NET> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Paul McDonald <paul_mcdonald@AMERITECH.NET> |
| Organization: | Ameritech.Net www.ameritech.net Complaints: abuse@ameritech.net |
| Subject: | Re: Macro Mental Block - USE PROC TRANSPOSE |
|---|
I suggest using PROC TRANSPOSE (gee that's the second time today I've put
that in the newsgroup!)
Berryhill, Tim wrote in message
<15C9395592CFD011AD1900805FEAD7FD04E16016@exchange02.comp.pge.com>...
>Dear WW, It may help to remember that the macro runs and generates SAS code
>exactly once, before any observations are processed. Thus the code
>generated will be applied to EVERY observation. How about having the macro
>generate
>> PROVNO = IP_ACUTE ;
>if provno ne . then
>> OUTPUT ;
>> PROVNO = IP_ADMIN ;
>if provno ne . then
>> OUTPUT ;
>> etc......
>>
>I suppose it would be more efficient (in CPU) to generate
>if ip_acute ne .
>then do;
> provno=ip_acute;
> output;
>end;
>
>but I will not suggest this variation.
>
>Tim Berryhill - Contract Programmer and General Wizard
>TWB2@PGE.COM or http://www.aartwolf.com/twb.html
>Frequently at Pacific Gas & Electric Co., San Francisco
>The correlation coefficient between their views and
>my postings is slightly less than 0
>
>
>> ----------
>> From: William W. Viergever[SMTP:wwvierg@IBM.NET]
>> Reply To: William W. Viergever
>> Sent: Monday, October 18, 1999 5:49 PM
>> To: SAS-L@LISTSERV.UGA.EDU
>> Subject: Macro Mental Block - HELP please
>>
>> Hi All:
>>
>> Got an Excel file that has rows of hospital names and columns of multiple
>> hospital license numbers (e.g., one for Inpatient Acute, one for
>> Outpatient, one for Home Health, etc.).
>>
>> Need to do a pseudo-transpose of this such that (s.t.) I end up with
>> multiple obs for a given hospital's name, each with a generic variable
>> named PROVNO which will have the above mentioned (different) license
>> numbers.
>>
>> Didn't want to hard code a bunch of:
>>
>> PROVNO = IP_ACUTE ;
>> OUTPUT ;
>> PROVNO = IP_ADMIN ;
>> OUTPUT ;
>> etc......
>>
>> so figured I'd try to "macro-ize" it what with reading the recent posts
>> about "macro-loopings" (I had learned a new trick, what can I say <g>).
>>
>> The trouble is that not all hosps have all types of licenses thus I was
>> hoping to conditionally evaluate whether (e.g.) the IP_PSY variable was
>> missing or had a value (i.e., there was a license number for this
>> Inpatient Psych category) so that the macro-eeze would *NOT* gen the
>> following code:
>>
>> PROVNO = IP_PSY ;
>> OUTPUT ;
><SNIP>
>> -------------------------------------------------------------------------
-
>> --
>> William W. Viergever Voice : (916) 483-8398
>> Viergever & Associates Fax : (916) 486-1488
>> A SAS Institute Quality Partner (USA) E-mail : wwvierg@ibm.net
>> Sacramento, CA 95825
>>
>> "Age is a question of mind over matter. If you don't mind, it don't
>> matter."
>> - Satchel Paige -
>>
>> "Reality is merely an illusion, albeit a very persistent one."
>> - Albert Einstein -
>> -------------------------------------------------------------------------
-
>> --
>>
|