<?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: Variable copying over empty in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Variable-copying-over-empty/m-p/704146#M215838</link>
    <description>&lt;P&gt;It sounds like the structure of your data is slightly different from run to run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One (or more) variable is supposed to use the CDTYPEI format.&amp;nbsp; As long as that variable is numeric, the program works fine.&amp;nbsp; But sometimes that variable is character, causing SAS to look for the $CDTYPEI format (which does not exist).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Similarly, one (or more) variable is supposed to use the HCFASAF format.&amp;nbsp; As long as that variable is numeric, the program works fine.&amp;nbsp; But sometimes that variable is character, causing SAS to look for the $HCFASAF format (which does not exist).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you fix the data and make those variables numeric, the program should work.&amp;nbsp; However, that may not be a simple task.&amp;nbsp; The variables may be character because they occasionally contain characters such as "N/A".&amp;nbsp; It's not clear what the proper fix would be to make the variable numeric.&amp;nbsp; So there are decisions to make.&amp;nbsp; But the task remains the same.&amp;nbsp; Fix the data.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Dec 2020 14:34:24 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2020-12-07T14:34:24Z</dc:date>
    <item>
      <title>Variable copying over empty</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-copying-over-empty/m-p/704021#M215778</link>
      <description>&lt;P&gt;My code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let IN = inCKD.DET20;

DATA OUT.IN_FILTER_07A;
	SET &amp;amp;IN.07A;
	FORMAT CLM_FROM CLM_THRU yymmdd10.;
	keep FIVEP_ID CLM_FROM CLM_THRU HCPCS;
RUN;

DATA OUT.IN_FILTER_07A;
	SET &amp;amp;IN.07A;
	if '90935' &amp;lt;= HCPCS &amp;lt;= '90999' then DIA = 1;
	else DIA = 0;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My log:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 72         
 73         /* Create Treatment Variables */
 74         %let IN = inCKD.DET20;
 75         
 76         DATA OUT.IN_FILTER_07A;
 77         SET &amp;amp;IN.07A;
 NOTE: Data file INCKD.DET2007A.DATA is in a format that is native to another host, or the file encoding does not match the session 
       encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce 
       performance.
 78         FORMAT CLM_FROM CLM_THRU yymmdd10.;
 79         keep FIVEP_ID CLM_FROM CLM_THRU HCPCS;
 80         RUN;
 
 NOTE: Format $CDTYPEI was not found or could not be loaded.
 NOTE: Format $HCFASAF was not found or could not be loaded.
 NOTE: There were 10200000 observations read from the data set INCKD.DET2007A.
 NOTE: The data set OUT.IN_FILTER_07A has 10200000 observations and 4 variables.
 NOTE: DATA statement used (Total process time):
       real time           47.44 seconds
       cpu time            42.04 seconds
       
 
 81         
 82         DATA OUT.IN_FILTER_07A;
 83         SET &amp;amp;IN.07A;
 NOTE: Data file INCKD.DET2007A.DATA is in a format that is native to another host, or the file encoding does not match the session 
       encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce 
       performance.
 84         if '90935' &amp;lt;= HCPCS &amp;lt;= '90999' then DIA = 1;
 85         else DIA = 0;
 86         RUN;
 
 NOTE: Format $CDTYPEI was not found or could not be loaded.
 NOTE: Format $HCFASAF was not found or could not be loaded.
 NOTE: There were 10200000 observations read from the data set INCKD.DET2007A.
 NOTE: The data set OUT.IN_FILTER_07A has 10200000 observations and 12 variables.
 NOTE: DATA statement used (Total process time):
       real time           49.54 seconds
       cpu time            43.61 seconds
       
 
 87         
 88         
 89         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 101        

 
User: sasdemo
DATA Step Statements&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The code is simple enough. I made a macros out of it (not shown) and while it works for some documents just fine. There are select ones that do not transfer over any of the data from FIVEP_ID and HCPCS, as in they're just blank cells. The documents hold all the same data, so in theory code that works for one should be able to work for the rest but it isn't. Why is this happening and how can I fix it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 02:23:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-copying-over-empty/m-p/704021#M215778</guid>
      <dc:creator>amarikow57</dc:creator>
      <dc:date>2020-12-07T02:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Variable copying over empty</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-copying-over-empty/m-p/704059#M215798</link>
      <description>&lt;P&gt;Why do you create a table and then overwrite it?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 06:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-copying-over-empty/m-p/704059#M215798</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-12-07T06:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Variable copying over empty</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-copying-over-empty/m-p/704146#M215838</link>
      <description>&lt;P&gt;It sounds like the structure of your data is slightly different from run to run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One (or more) variable is supposed to use the CDTYPEI format.&amp;nbsp; As long as that variable is numeric, the program works fine.&amp;nbsp; But sometimes that variable is character, causing SAS to look for the $CDTYPEI format (which does not exist).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Similarly, one (or more) variable is supposed to use the HCFASAF format.&amp;nbsp; As long as that variable is numeric, the program works fine.&amp;nbsp; But sometimes that variable is character, causing SAS to look for the $HCFASAF format (which does not exist).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you fix the data and make those variables numeric, the program should work.&amp;nbsp; However, that may not be a simple task.&amp;nbsp; The variables may be character because they occasionally contain characters such as "N/A".&amp;nbsp; It's not clear what the proper fix would be to make the variable numeric.&amp;nbsp; So there are decisions to make.&amp;nbsp; But the task remains the same.&amp;nbsp; Fix the data.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 14:34:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-copying-over-empty/m-p/704146#M215838</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-12-07T14:34:24Z</dc:date>
    </item>
  </channel>
</rss>

