Date: Wed, 20 Feb 2008 14:37:43 -0800
Reply-To: "Duell, Bob" <BD9439@ATT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Duell, Bob" <BD9439@ATT.COM>
Subject: Re: help on attributes - data step
Content-Type: text/plain; charset="us-ascii"
Either of the following should do the trick:
1. Change the name of the SAS catalog containing your formats to
PROC FORMAT LIBRARY = a.formats;
2. Change your FMTSEARCH option to point to the complete catalog
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Wednesday, February 20, 2008 1:58 PM
Subject: help on attributes - data step
I work with PIs who like to do their own statistical analysis, so
request the data with each variable being formatted and labeled. Now I
having trouble to incorporate the formats into data by using the ATTRIB
statement in data step, have been struggled for a while and really need
Here is my simplified code and I don't know why it just won't work.
I have a seperate program called fmt05.sas like this:
PROC FORMAT LIBRARY = a.myfmt;
1 = 'MALE '
2 = 'FEMALE'
7 = 'REFUSED'
8 = 'DK'
(I know all the formats have been created and saved in library by using
contlout=, I also added option fmtsearch = a;)
Then I have a seperate program called attrib.sas like this:
ATTRIB DPSEX FORMAT=DPSEXF. LABEL= '<DPSEX> PATIENT'S GENDER';
ATTRIB DPAGE LABEL = '<DPAGE> PATIENT'S AGE';
My main program look like this:
Then I get message in log file says:
+ ATTRIB DPSEX FORMAT=DPSEXF. LABEL= '<DPSEX> PATIENT'S GENDER';
ERROR 48-59: The format DPSEXF was not found or could not be loaded.
What could be wrong?
Many thanks in advance.