<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to make value labels become the value in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/How-to-make-value-labels-become-the-value/m-p/371378#M2842</link>
    <description>&lt;P&gt;You have a couple of problems with your code. I presume you used a libname statement to specify the Preeti library, but you never used the fmtsearch option to tell SAS that is where your formats exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Plus, you included that libname in one of your assignment statements, which you should not have done. i.e., you used:&lt;/P&gt;
&lt;PRE&gt;format preeti.hlthfood hlthfood.;&lt;/PRE&gt;
&lt;P&gt;when you should have used:&lt;/P&gt;
&lt;PRE&gt;format hlthfood hlthfood.;&lt;/PRE&gt;
&lt;P&gt;You also specified some formats that you never created, like custid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I didn't correct all of those errors, but the following should be enough for you to correct (i.e., delete the unassigned format declarations):&lt;/P&gt;
&lt;PRE&gt;libname Preeti '/folders/myfolders';
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_coupons;
  input hlthfood size org custid gender shopfor veg
    style usecoup week seq carry coupval amtspent;
  cards;
0 1 2 3 1 1 1 1 1 1 1 1 1 1
1 2 3 2 0 1 1 1 1 1 1 1 1 1
;

options fmtsearch=(preeti);
data preeti.grocery_coupons1;
set Preeti.grocery_coupons;
format preeti.hlthfood hlthfood.;
format 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;
 &lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jun 2017 17:16:18 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-06-28T17:16:18Z</dc:date>
    <item>
      <title>How to make value labels become the value</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-make-value-labels-become-the-value/m-p/371365#M2840</link>
      <description>&lt;P&gt;please help me with this....&lt;/P&gt;&lt;P&gt;i want to put value in variable but its showing error....&lt;/P&gt;&lt;P&gt;reply fast please......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;code;-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc format lib=Preeti;&lt;BR /&gt;value hlthfood&lt;BR /&gt;0='No'&lt;BR /&gt;1='Yes';&lt;BR /&gt;value size&lt;BR /&gt;1='Small'&lt;BR /&gt;2='Medium'&lt;BR /&gt;3='Large';&lt;BR /&gt;value org&lt;BR /&gt;1='Emphasizes produce'&lt;BR /&gt;2='Emphasizes deli'&lt;BR /&gt;3='Emphasizes bakery'&lt;BR /&gt;4='No emphasis';&lt;BR /&gt;value gender&lt;BR /&gt;0='Male'&lt;BR /&gt;1='Female';&lt;BR /&gt;value shopfor&lt;BR /&gt;1='Self'&lt;BR /&gt;2='Self and spouse'&lt;BR /&gt;3='Self and family';&lt;BR /&gt;value veg&lt;BR /&gt;0='No'&lt;BR /&gt;1='Yes';&lt;BR /&gt;value style&lt;BR /&gt;1='Biweekly' and 'in bulk'&lt;BR /&gt;2='Weekly' and 'similar items'&lt;BR /&gt;3='Often' and 'whats on sale';&lt;BR /&gt;value usecoup&lt;BR /&gt;1='No'&lt;BR /&gt;2='From newspaper'&lt;BR /&gt;3='From mailings'&lt;BR /&gt;4='From both';&lt;/P&gt;&lt;P&gt;value carry&lt;BR /&gt;0='First period'&lt;BR /&gt;1='No coupon'&lt;BR /&gt;2='5 percent'&lt;BR /&gt;3='15 percent'&lt;BR /&gt;4='25 percent';&lt;/P&gt;&lt;P&gt;Value coupval&lt;BR /&gt;1='No value'&lt;BR /&gt;2='5 percent'&lt;BR /&gt;3='15 percent'&lt;BR /&gt;4='25 percent'&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data preeti.grocery_coupons1;&lt;BR /&gt;set Preeti.grocery_coupons;&lt;BR /&gt;format preeti.hlthfood hlthfood.;&lt;BR /&gt;format size size. ;&lt;BR /&gt;format org org. ;&lt;BR /&gt;format custid custid. ;&lt;BR /&gt;format gender gender. ;&lt;BR /&gt;format shopfor shopfor. ;&lt;BR /&gt;format veg veg. ;&lt;BR /&gt;format style style. ;&lt;BR /&gt;format usecoup usecoup. ;&lt;BR /&gt;format week week. ;&lt;BR /&gt;format seq seq. ;&lt;BR /&gt;format carry carry. ;&lt;BR /&gt;format coupval coupval. ;&lt;BR /&gt;format amtspent amtspent. ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;error ;-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasSource"&gt;data preeti.grocery_coupons1;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;111 set Preeti.grocery_coupons;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;112 format preeti.hlthfood hlthfood.;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;_________&lt;/DIV&gt;&lt;DIV class="sasError"&gt;484&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: Invalid variable specification, preeti.hlthfood. Variable names of the form X.X must be either FIRST.X or LAST.X.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: The name preeti.hlthfood is not a valid SAS name.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 484-185: Format HLTHFOOD was not found or could not be loaded.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;113 format size size. ;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;_____&lt;/DIV&gt;&lt;DIV class="sasError"&gt;484&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 484-185: Format SIZE was not found or could not be loaded.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;114 formatorgorg. ;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;____&lt;/DIV&gt;&lt;DIV class="sasError"&gt;484&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 484-185: Format ORG was not found or could not be loaded.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;115 formatcustidcustid. ;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;_______&lt;/DIV&gt;&lt;DIV class="sasError"&gt;484&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 484-185: Format CUSTID was not found or could not be loaded.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;116 formatgendergender. ;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;_______&lt;/DIV&gt;&lt;DIV class="sasError"&gt;484&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 484-185: Format GENDER was not found or could not be loaded.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;117 formatshopforshopfor. ;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;________&lt;/DIV&gt;&lt;DIV class="sasError"&gt;484&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 484-185: Format SHOPFOR was not found or could not be loaded.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;118 formatvegveg. ;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;____&lt;/DIV&gt;&lt;DIV class="sasError"&gt;484&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 484-185: Format VEG was not found or could not be loaded.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;119 formatstylestyle. ;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;______&lt;/DIV&gt;&lt;DIV class="sasError"&gt;484&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 484-185: Format STYLE was not found or could not be loaded.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;120 formatusecoupusecoup. ;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;________&lt;/DIV&gt;&lt;DIV class="sasError"&gt;484&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 484-185: Format USECOUP was not found or could not be loaded.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;121 formatweekweek. ;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;_____&lt;/DIV&gt;&lt;DIV class="sasError"&gt;484&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 484-185: Format WEEK was not found or could not be loaded.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;122 formatseqseq. ;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;____&lt;/DIV&gt;&lt;DIV class="sasError"&gt;484&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 484-185: Format SEQ was not found or could not be loaded.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;123 formatcarrycarry. ;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;______&lt;/DIV&gt;&lt;DIV class="sasError"&gt;484&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 484-185: Format CARRY was not found or could not be loaded.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;124 formatcoupvalcoupval. ;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;________&lt;/DIV&gt;&lt;DIV class="sasError"&gt;484&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 484-185: Format COUPVAL was not found or could not be loaded.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;125 formatamtspentamtspent. ;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;_________&lt;/DIV&gt;&lt;DIV class="sasError"&gt;484&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE 484-185: Format AMTSPENT was not found or could not be loaded.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;126 run;&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Jun 2017 16:23:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-make-value-labels-become-the-value/m-p/371365#M2840</guid>
      <dc:creator>jonty</dc:creator>
      <dc:date>2017-06-28T16:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to make value labels become the value</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-make-value-labels-become-the-value/m-p/371378#M2842</link>
      <description>&lt;P&gt;You have a couple of problems with your code. I presume you used a libname statement to specify the Preeti library, but you never used the fmtsearch option to tell SAS that is where your formats exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Plus, you included that libname in one of your assignment statements, which you should not have done. i.e., you used:&lt;/P&gt;
&lt;PRE&gt;format preeti.hlthfood hlthfood.;&lt;/PRE&gt;
&lt;P&gt;when you should have used:&lt;/P&gt;
&lt;PRE&gt;format hlthfood hlthfood.;&lt;/PRE&gt;
&lt;P&gt;You also specified some formats that you never created, like custid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I didn't correct all of those errors, but the following should be enough for you to correct (i.e., delete the unassigned format declarations):&lt;/P&gt;
&lt;PRE&gt;libname Preeti '/folders/myfolders';
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_coupons;
  input hlthfood size org custid gender shopfor veg
    style usecoup week seq carry coupval amtspent;
  cards;
0 1 2 3 1 1 1 1 1 1 1 1 1 1
1 2 3 2 0 1 1 1 1 1 1 1 1 1
;

options fmtsearch=(preeti);
data preeti.grocery_coupons1;
set Preeti.grocery_coupons;
format preeti.hlthfood hlthfood.;
format 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;
 &lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 17:16:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-make-value-labels-become-the-value/m-p/371378#M2842</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-06-28T17:16:18Z</dc:date>
    </item>
  </channel>
</rss>

