Date: Wed, 16 Feb 2000 12:21:44 -0500
Reply-To: WHITLOI1 <WHITLOI1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: WHITLOI1 <WHITLOI1@WESTAT.COM>
Subject: Re: Format Question
Content-Type: text/plain; charset=US-ASCII
Nicolas,
There are any number of different ways to look up information, so the INFORMAT
is far from
the unique answer. However, in the situation you describe, it is the most
natural to SAS and easily implemented; so you should have a good reason for
avoiding it before looking at other methods.
Here is code that shows how easy it is to convert your FTEST format to an FTEST
informat.
proc format ;
value ftest
1 = "NICOLAS"
;
data _null_ ;
a=1 ;
put a ftest. ;
run ;
proc format cntlout = fmtdata ( keep = fmtname start label ) ;
select ftest ;
run ;
data fmtdata ( keep = tstart tlabel type fmtname
rename = ( tstart = start tlabel = label ) ) ;
set fmtdata ( keep = fmtname start label
rename = ( start = tlabel label = tstart ) ) ;
retain type "I" ;
run ;
proc format cntlin = fmtdata ;
run ;
data q ;
input x ftest. ;
cards ;
NICOLAS
12
;
Ian Whitlock <whitloi1@westat.com>
____________________Reply Separator____________________
Subject: Format Question
Author: nicolas.pont@UNICIBLE.CH
Date: 2/16/2000 5:35 PM
I Have a format on a variable
The format is ftest. and the format for the value 1 is "NICOLAS"
data test ;
a=1 ;
format a ftest.
run ;
Now If I export the file test in an external file, i will have this result
in my external file 1 line with value NICOLAS
Now i would like to read my external file and transform the value NICOLAS
in value 1
How can I do it, the informat solution is-it the only one ?
thanks for any advices