<?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: Save as Integers using sas studio in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Save-as-Integers-using-sas-studio/m-p/300679#M270358</link>
    <description>&lt;P&gt;Your variable names are too long and have characters not allowed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Variable names include only:&lt;/P&gt;
&lt;P&gt;numbers&lt;/P&gt;
&lt;P&gt;letters&lt;/P&gt;
&lt;P&gt;underscore&lt;/P&gt;
&lt;P&gt;- no spaces&lt;/P&gt;
&lt;P&gt;- cannot start with a number&lt;/P&gt;
&lt;P&gt;- less than 32 chars.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure what your actual variable name is, but you can find it out using a proc contents. You'll see the variable names and labels. Names are what you use in your programs. Labels can be used in reporting.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=mycsv1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Once you've determined your variable name, try the input function again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var_numeric = input(var_character, 8.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 26 Sep 2016 03:06:40 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-09-26T03:06:40Z</dc:date>
    <item>
      <title>Save as Integers using sas studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Save-as-Integers-using-sas-studio/m-p/300674#M270357</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having issue of how to save Daily Max-8 hour Ozone Concentration, DAILY_AQI_VALUE,DAILY_OBS_COUNT, and PERCENT_COMPLETE as Integers? I have paste my sample of data below for you to try out. Any help is greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried doing with Data steps:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA WORK.MYCSVIntegers;&lt;BR /&gt;SET WORK.MYCSV1;&lt;BR /&gt;Daily Max 8-hour Ozone Concentration= Int(Daily Max 8-hour Ozone Concentration);&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, no luck. The errors are:&lt;/P&gt;&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;55&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;56 DATA WORK.MYCSVIntegers;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;57 SET WORK.MYCSV1;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;58 Daily Max 8-hour Ozone Concentration= Int(Daily Max 8-hour Ozone Concentration);&lt;/DIV&gt;&lt;DIV class="sasError"&gt;_____&lt;/DIV&gt;&lt;DIV class="sasError"&gt;180&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;59 RUN;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The data set WORK.MYCSVINTEGERS may be incomplete. When this step was stopped there were 0 observations and 18 variables.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Data set WORK.MYCSVINTEGERS was not replaced because this step was stopped.&lt;/DIV&gt;&lt;P&gt;========================================================================================================The&amp;nbsp;DATA is shown below. Please try out and let me know. There are headers start from Date and SITE_LONGITUDE. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date,AQS_SITE_ID,POC,Daily Max 8-hour Ozone Concentration,UNITS,DAILY_AQI_VALUE,DAILY_OBS_COUNT,PERCENT_COMPLETE,AQS_PARAMETER_CODE,AQS_PARAMETER_DESC,CBSA_CODE,CBSA_NAME,STATE_CODE,STATE,COUNTY_CODE,COUNTY,SITE_LATITUDE,SITE_LONGITUDE&lt;BR /&gt;1/1/2015,340010006,1,0.036,ppm,33,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;BR /&gt;1/2/2015,340010006,1,0.03,ppm,28,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;BR /&gt;1/3/2015,340010006,1,0.027,ppm,25,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;BR /&gt;1/4/2015,340010006,1,0.022,ppm,20,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;BR /&gt;1/5/2015,340010006,1,0.033,ppm,31,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;BR /&gt;1/6/2015,340010006,1,0.031,ppm,29,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;BR /&gt;1/7/2015,340010006,1,0.032,ppm,30,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;BR /&gt;1/8/2015,340010006,1,0.031,ppm,29,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;BR /&gt;1/9/2015,340010006,1,0.032,ppm,30,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;BR /&gt;1/10/2015,340010006,1,0.03,ppm,28,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;BR /&gt;1/11/2015,340010006,1,0.034,ppm,31,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;BR /&gt;1/12/2015,340010006,1,0.023,ppm,21,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;BR /&gt;1/13/2015,340010006,1,0.028,ppm,26,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;BR /&gt;1/14/2015,340010006,1,0.031,ppm,29,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;BR /&gt;1/15/2015,340010006,1,0.02,ppm,19,24,100,44201,Ozone,12100,"Atlantic City-Hammonton, NJ",34,New Jersey,1,Atlantic,39.464872,-74.448736&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 02:33:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Save-as-Integers-using-sas-studio/m-p/300674#M270357</guid>
      <dc:creator>pandyat0</dc:creator>
      <dc:date>2016-09-26T02:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Save as Integers using sas studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Save-as-Integers-using-sas-studio/m-p/300679#M270358</link>
      <description>&lt;P&gt;Your variable names are too long and have characters not allowed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Variable names include only:&lt;/P&gt;
&lt;P&gt;numbers&lt;/P&gt;
&lt;P&gt;letters&lt;/P&gt;
&lt;P&gt;underscore&lt;/P&gt;
&lt;P&gt;- no spaces&lt;/P&gt;
&lt;P&gt;- cannot start with a number&lt;/P&gt;
&lt;P&gt;- less than 32 chars.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure what your actual variable name is, but you can find it out using a proc contents. You'll see the variable names and labels. Names are what you use in your programs. Labels can be used in reporting.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=mycsv1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Once you've determined your variable name, try the input function again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var_numeric = input(var_character, 8.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Sep 2016 03:06:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Save-as-Integers-using-sas-studio/m-p/300679#M270358</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-26T03:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Save as Integers using sas studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Save-as-Integers-using-sas-studio/m-p/302225#M270359</link>
      <description>&lt;P&gt;Hello Reeza,&lt;/P&gt;&lt;P&gt;Thank you. It worked. I used a&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;var_numeric &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;var_character&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;8&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and it saved as integers. Thanks. And just a note, I had issues with date and had to use &amp;nbsp;MMDDYY12. , instead 10. &amp;nbsp;why did it work with 12. ? Can you explain, please? Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA work.mycsvdate;
infile "/home/pandyat0/sasuser.v94/Pandya_Ozone.csv" FIRSTOBS=2;
input mydate MMDDYY12.;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Oct 2016 02:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Save-as-Integers-using-sas-studio/m-p/302225#M270359</guid>
      <dc:creator>pandyat0</dc:creator>
      <dc:date>2016-10-04T02:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Save as Integers using sas studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Save-as-Integers-using-sas-studio/m-p/302247#M270360</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WORK.MYCSVIntegers; 
SET WORK.MYCSV1;
ozoneconc= Int(Ozoneconc);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I had to change my variable name and make it shorter (about 13 characters, no space and number--what I thought ). I then ran command above to make intergers &amp;nbsp;but input was working as it was taking all numbers a whole integers (what I thought my prof asked for). I had to use 'int' and it had worked. I just opened the file and check. Thanks for clarifying and following up with me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WORK.MYCSVCharacters; 
SET WORK.MYCSV1;
ozoneconc = input(ozoneconc, 8.);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The code above gave me all 0 and some ". " as it turned all integers like these. I had to check and make sure with my prof, he said input is useful but then he said use int instead.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your help and response. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 05:22:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Save-as-Integers-using-sas-studio/m-p/302247#M270360</guid>
      <dc:creator>pandyat0</dc:creator>
      <dc:date>2016-10-04T05:22:42Z</dc:date>
    </item>
  </channel>
</rss>

