Date: Thu, 24 Feb 2000 13:52:11 -0800
Reply-To: "Lund, Pete" <Peter.Lund@CFC.WA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Lund, Pete" <Peter.Lund@CFC.WA.GOV>
Subject: Re: Permanent Formats and documenting permanent storage data
Content-Type: text/plain; charset="windows-1252"
Peter-
Great post - it's nice when people are willing to give a complete answer
that goes a bit beyond the question to fill in the blanks a bit. One "heads
up" to novice users - don't know whether it's worth posting to the group:
If using your example to add a format to an existing format catalog...
proc format library=xxx.yyy cntlout=xxx.fmtcntl fmtlib;
value ........etc
picture .... etc
run;
...it may not be apparent to everyone that the cntlout dataset and the
fmtlib listing will contain information on ALL the formats in the catalog,
not just the ones created in the current proc format. I've got format
catalogs with dozens of formats and I may only want the listing of the new
one I'm adding.
I might suggest adding a SELECT statement listing just the new
formats/pictures/informats being created.
Again, I always appreciate your posts.
Pete Lund
WA State Caseload Forecast Council
(360) 902-0086 voice
(360) 902-0084 fax
peter.lund@cfc.wa.gov
-----Original Message-----
From: Peter Crawford [mailto:peter.crawford@DB.COM]
Sent: Thursday, February 24, 2000 11:36 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Permanent Formats and documenting permanent storage data
You would always be able to read the permanent data set with the system
option
NOfmtErr.
I would suggest preparing a format catalog holding all user formats needed
by
your permanent dataset.
This format catalog should be stored with the data.It may also be worth
storing
a cntlout dataset for the format catalog into the permanent library. This is
for
the event that an XPORT version of your library is generated that may not
preserve the catalog.
You need to ensure that your permanent format catalog is added to the format
search path before opening the permanent data set. This (complex-ish) code
can
help by adding your format catalog to the fmtsearch option...
/* tested code***/
option fmtsearch = ( %sysfunc( translate(
%sysfunc( getoption( fmtsearch ) ) , %str( ),
%str(()) ) ) XXX.YYY ) ;
where XXX.YYY is the libref and catname for your catalog of formats
for
the permanent data set
This permanent format catalog and cntlin dataset may be created with a proc
format like
proc format library=xxx.yyy cntlout=xxx.fmtcntl fmtlib;
value ........etc
picture .... etc
run;
That FMTLIB option on the proc statement provides a most useful printout of
the
ranges and pictures in each format. As meaningful documentation, this also
could
be stored in the permanent library along with a proc contents report.
You may consider it to be getting a bit excessive, (but your successors will
be
very grateful) if you create subsets of the dictionary tables relevant to
your
permanent data set and copy those into the library also.
proc sql;
create table xxx.metaYYY as select * from dictionary.members where
libname='XXX' and memname='YYY' ;
create table xxx.metatab as select * from dictionary.tables where
libname='XXX' and memname='YYY' ;
create table xxx.metacol as select * from dictionary.columns where
libname='XXX' and memname='YYY' ;
create table xxx.metaidx as select * from dictionary.indexes where
libname='XXX' and memname='YYY' ;
quit;
I guess I'm coming across with the message that permanent storage data can't
have too much documentation!
(just my opinion.... based on the opposite scenario ===> painful ! )
as a final thought on securing explanations of your data,
it may be worth storing the programs with which your permanent data set was
created along with a simple display or brief data printout for a few obs.
..... and finally
some control totals and counts that would verify the data are being
retrieved by
the recipient/successor, as you stored them.
proc means data=xxx.yyy noprint;
output out=xxx.totals;
run;
good luck
Peter Crawford
Datum: 24.02.2000 19:19
An: SAS-L@listserv.uga.edu
Antwort an: PapanikolaouP@cardiff.ac.uk
Betreff: Permanent Formats
Nachrichtentext:
Dear All,
i have a SAS PERMANENT dataset and I want to assign permanent
formats on the existing character values of some variables. Whilst
I am able to do this successfully on a temporary basis i am not
sure how I PERMANENTLY assign the format values. That is, I am
seeking advice how I would not need to run again and again the
PROC FORMAT each time that I use this PERMANENT data set. Notice,
that I have looked at the manuals but they were of little (if any)
help. So, would be grateful if you would offer me any suggestions on
how to successfully assign the format values on the variables and
therefore I won't need to run PROC FORMAT each time i us ethe data-
set. Any SAS statements and codes would be very welcome and well
received.
Thank you ever so much for taking the time to consider my request.
I look forward to hearing from you.
Yours sincerely
Panos.
Panos Papanikolaou
*********************
Research Fellow
Nursing, Health and Social Care Research Centre
SONWS
UWCM
Heath Park
Cardiff
CF14 4XN
Great Britain
E-mail: papanikolaoup@cf.ac.uk
Direct line: +44 (0)29 2074 2197
Fax: +44 (0)29 2074 5521