Hi,
I am having a situation when i am creating format
Proc Sql;
create table test1 as
select cntyname,cnty_id
from cnty table
where cnty_id in (select cnty_id from test);
quit;
data test2;
set test1;
retain fmtname 'cnty'
rename cnty_id=start;
rename cntyname=label;
run;
proc format library=format cntlin=cnty;
run;
This runs well when i am having data in test1 but when i am having no data it says it cannot load format cnty.Even though i am having no data it should not throw an error.
Can any one help me how to avoid this.
Proc Sql;
create table cntyFmt as
select "cnty" as fmtname, cntyname as label, cnty_id as start
from cnty
where cnty_id in (select cnty_id from test);
quit;
proc format library=format cntlin=cntyFmt;
run;
Proc Sql;
create table cntyFmt as
select "cnty" as fmtname, cntyname as label, cnty_id as start
from cnty
where cnty_id in (select cnty_id from test);
quit;
proc format library=format cntlin=cntyFmt;
run;
Hey But i think we have to use cntlin=cnty instead of cntyFmt
With PROC SQL you create the table called cntyFmt with the proper variables : FMTNAME, LABEL and START and then use CNTLIN=cntyFmt to tell PROC FORMAT the name of the format control dataset. You could use any name instead of cntyFmt.
Cheers!
PG
oops i got it previously i was using
proc format cntlin=cnty;
so i was getting that problem
Now i am using
Proc format library=format
cntlin=cnty;
when i used the above one i am not getting that problem.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.