<?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: Create an empty dataset with variables and no unintialized issues in log in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-an-empty-dataset-with-variables-and-no-unintialized/m-p/697161#M213036</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/321557"&gt;@Anonymity&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In practice, I would also use the DATA step approach with CALL MISSING because of the familiar syntax. Other options include:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;PROC SQL&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table SHELL
(FirstName char(200), LastName char(200));
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;Temporarily suppress the unwanted note in the log (and then use a DATA step without the need for CALL MISSING):&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options varinitchk=nonote;&lt;/CODE&gt;&lt;/PRE&gt;
and reset the option to &lt;FONT face="courier new,courier"&gt;note&lt;/FONT&gt;&amp;nbsp;(or whatever the previous setting was) afterwards.&lt;/LI&gt;
&lt;LI&gt;Use one or more arrays:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data SHELL;
array x[*] $200 FirstName LastName;
stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Fri, 06 Nov 2020 15:07:20 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2020-11-06T15:07:20Z</dc:date>
    <item>
      <title>Create an empty dataset with variables and no unintialized issues in log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-an-empty-dataset-with-variables-and-no-unintialized/m-p/697138#M213030</link>
      <description>&lt;P&gt;I need to create an empty dataset but without the uninitialized issue that shows in the log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried the following&lt;/P&gt;&lt;P&gt;data SHELL;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format FirstName LastName&amp;nbsp; $200.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stop;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data SHELL;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length FirstName LastName&amp;nbsp; $200;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stop;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I am still getting uninitialized in my log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to try to avoid this as I would be doing this for about +- 30 variables every time.&lt;/P&gt;&lt;P&gt;data SHELL;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length FirstName LastName&amp;nbsp; $200;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstName = "";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LastName = "";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help with this would be appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 13:27:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-an-empty-dataset-with-variables-and-no-unintialized/m-p/697138#M213030</guid>
      <dc:creator>Anonymity</dc:creator>
      <dc:date>2020-11-06T13:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create an empty dataset with variables and no unintialized issues in log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-an-empty-dataset-with-variables-and-no-unintialized/m-p/697140#M213031</link>
      <description>&lt;P&gt;The log message about uninitialized variables is expected in the case where you have uninitialized variables, and is not a bad thing in this case in my opinion. So I don't have a problem with the log message, and I wouldn't spend time and effort to fix it (if a fix is possible).&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 13:32:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-an-empty-dataset-with-variables-and-no-unintialized/m-p/697140#M213031</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-11-06T13:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create an empty dataset with variables and no unintialized issues in log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-an-empty-dataset-with-variables-and-no-unintialized/m-p/697141#M213032</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data SHELL;
    length FirstName LastName $ 200;
    call missing(of _ALL_);
    stop;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 13:34:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-an-empty-dataset-with-variables-and-no-unintialized/m-p/697141#M213032</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-11-06T13:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create an empty dataset with variables and no unintialized issues in log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-an-empty-dataset-with-variables-and-no-unintialized/m-p/697161#M213036</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/321557"&gt;@Anonymity&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In practice, I would also use the DATA step approach with CALL MISSING because of the familiar syntax. Other options include:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;PROC SQL&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table SHELL
(FirstName char(200), LastName char(200));
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;Temporarily suppress the unwanted note in the log (and then use a DATA step without the need for CALL MISSING):&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options varinitchk=nonote;&lt;/CODE&gt;&lt;/PRE&gt;
and reset the option to &lt;FONT face="courier new,courier"&gt;note&lt;/FONT&gt;&amp;nbsp;(or whatever the previous setting was) afterwards.&lt;/LI&gt;
&lt;LI&gt;Use one or more arrays:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data SHELL;
array x[*] $200 FirstName LastName;
stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 06 Nov 2020 15:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-an-empty-dataset-with-variables-and-no-unintialized/m-p/697161#M213036</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-11-06T15:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create an empty dataset with variables and no unintialized issues in log</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-an-empty-dataset-with-variables-and-no-unintialized/m-p/697166#M213038</link>
      <description>&lt;P&gt;You can use CALL MISSING(of _all_) to initialize the variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also use an array definition as SAS doesn't issue the note for variables that are in arrays.&amp;nbsp; But that requires that you need to know if you have both numeric and character variables since all variables in a single array must be of the same type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS Use the LENGTH statement to define the type/length of the variables. Use a FORMAT statement only if you actually need to attach a format to the variables. Your example variables do not need formats attached to them.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 15:10:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-an-empty-dataset-with-variables-and-no-unintialized/m-p/697166#M213038</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-06T15:10:56Z</dc:date>
    </item>
  </channel>
</rss>

