Dear experts,
I am creating the data set ap3_8fmt to create the formats for a variable called ap3_8, contained in the data set tsdemwl. The formats are stored in the work library (I can see that in the results window) but they are not picked up by the data set that contains the variable ap3_8.
Could you please tell me what am I doing wrong?
Many thanks,
Claudia
------ CODE------
data ap3_8_; input ap3_8 $ @@; datalines; 1 2 3 4 b ; run;
data ap3_8; length descrip_ $100; set ap3_8_; if ap3_8="1" then descrip_="Vendio o hizo algun producto para su venta?"; else if ap3_8="2" then descrip_="Presto algun servicio a cambio de un pago?"; else if ap3_8="3" then descrip_="Ayudo trabajando en las tierras o en el negocio de un familiar u otra persona?"; else if ap3_8="4" then descrip_="Entonces, no realizo otra actividad?"; else if ap3_8="b" then descrip_="Blanco"; run;
data ap3_8fmt; length descrip $100; set ap3_8 (rename=(ap3_8=start)); retain fmtname "$ap3_8f"; label = descrip_; descrip=descrip_; if substr(descrip,1,1)="¿" then descrip=substr(descrip,2); run;
proc format cntlin=ap3_8fmt; run;
proc format library=work fmtlib; run;
options fmtsearch=(work);
data mydatawf; length ap3_8wf $100; set p1dem.tsdemwl; ap3_8wf=put(AP3_8,$AP3_8F.); run;
proc print data = mydatawf (obs=5) noobs run;
... View more