please help me with this....
i want to put value in variable but its showing error....
reply fast please......
code;-
proc format lib=Preeti;
value hlthfood
0='No'
1='Yes';
value size
1='Small'
2='Medium'
3='Large';
value org
1='Emphasizes produce'
2='Emphasizes deli'
3='Emphasizes bakery'
4='No emphasis';
value gender
0='Male'
1='Female';
value shopfor
1='Self'
2='Self and spouse'
3='Self and family';
value veg
0='No'
1='Yes';
value style
1='Biweekly' and 'in bulk'
2='Weekly' and 'similar items'
3='Often' and 'whats on sale';
value usecoup
1='No'
2='From newspaper'
3='From mailings'
4='From both';
value carry
0='First period'
1='No coupon'
2='5 percent'
3='15 percent'
4='25 percent';
Value coupval
1='No value'
2='5 percent'
3='15 percent'
4='25 percent'
run;
data preeti.grocery_coupons1;
set Preeti.grocery_coupons;
format preeti.hlthfood hlthfood.;
format size size. ;
format org org. ;
format custid custid. ;
format gender gender. ;
format shopfor shopfor. ;
format veg veg. ;
format style style. ;
format usecoup usecoup. ;
format week week. ;
format seq seq. ;
format carry carry. ;
format coupval coupval. ;
format amtspent amtspent. ;
run;
error ;-
You are encountering two types of problems.
The first problem occurs just once, on the first FORMAT statement. It should read:
format hlthfood hlthfood.;
The syntax of table_name.field_name is generally not used within SAS ... perhaps only within PROC SQL. The remaining FORMAT statements appear to be correct. Which leads to the second problem.
You have stored these formats permanently. However, you have not told SAS where to look, to retrieve the formats. That actually requires an additional statement, such as:
options fmtsearch=(Preeti, work);
It seems strange that you can create formats early in the program, save them, and yet SAS cannot find them. But that's what happens when you permanently save formats. You have to add the FMTSEARCH option to tell SAS where to look.
thank you so much
i like your support....
and its strange that i havent used FMTSEARCH and dont know how it still worked
well i am a rookiee to sas so i believe these probs are common for me as i am not from any science studies.
still respect for you, you helped me i loved it
regards
jonty
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.