Date: Mon, 10 Apr 2006 14:34:46 -0400
Reply-To: "Fehd, Ronald J" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J" <rjf2@CDC.GOV>
Subject: Re: Two level format name, possible?
Content-Type: text/plain; charset="us-ascii"
to use two (or more) format libraries you need
options fmtsearch = (work Lib1 ... LibN);
or your case:
options fmtsearch = (work V1 V2);
your formats have the same name
so this won't work
but if you had different names for the two formats
then you could access them with the above trick.
Ron Fehd the Format catalog
or macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
> -----Original Message-----
> From: owner-sas-l@listserv.uga.edu
> [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of Ya Huang
> Sent: Monday, April 10, 2006 12:10 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Cc: Ya Huang
> Subject: Two level format name, possible?
>
> Hi there,
>
> Assuming that I have two formats catalog stored in two
> different place,
> and the format names are same. Is there any way I can use them in one
> data step with some kind two level name reference? I search the SAS-L
> archive, and found one very old thread (10 year ago) which basically
> concluded that no easy way to do this. I wonder if this has
> been changed
> with all the later version of SAS:
>
> proc format library=v1;
> value visit
> 1='Day -7'
> 2='Week 1'
> 3='Week 4'
> ;
>
> proc format library=v2;
> value visit
> 1='Day -7'
> 2='Week 1'
> 3='Week 6'
> ;
>
> data visit;
> study=1; visit=1; output;
> study=1; visit=2; output;
> study=1; visit=3; output;
> study=2; visit=1; output;
> study=2; visit=2; output;
> study=2; visit=3; output;
> run;
>
> ** this doesn't work;
> data visit;
> set visit;
> if study=1 then cvisit=put(visit,v1.visit.);
> else if study=2 then cvisit=put(visit,v2.visit.);
> run;
>
>
> Thanks
>
> Ya
>
>
|