<?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 How to create dumy dataset with only attrib statement in datastep in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610202#M18051</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a zero dataset with DATASTEP, which contains only attrib information or we can assign/modify attributes of variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data x;&lt;BR /&gt;attrib&lt;BR /&gt;x label="X" length=$25.;&lt;BR /&gt;stop;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I'm getting below warning&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;15274 data x;&lt;BR /&gt;15275 attrib&lt;BR /&gt;15276 x label="X" length=$25.;&lt;BR /&gt;15277 stop;&lt;BR /&gt;15278 run;&lt;/P&gt;&lt;P&gt;NOTE: Variable x is uninitialized.&lt;BR /&gt;NOTE: The data set WORK.X has 0 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.04 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please anyone can help me in fixing this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anv_SAS&lt;/P&gt;</description>
    <pubDate>Sat, 07 Dec 2019 14:57:26 GMT</pubDate>
    <dc:creator>Anv_SAS</dc:creator>
    <dc:date>2019-12-07T14:57:26Z</dc:date>
    <item>
      <title>How to create dumy dataset with only attrib statement in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610202#M18051</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a zero dataset with DATASTEP, which contains only attrib information or we can assign/modify attributes of variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data x;&lt;BR /&gt;attrib&lt;BR /&gt;x label="X" length=$25.;&lt;BR /&gt;stop;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I'm getting below warning&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;15274 data x;&lt;BR /&gt;15275 attrib&lt;BR /&gt;15276 x label="X" length=$25.;&lt;BR /&gt;15277 stop;&lt;BR /&gt;15278 run;&lt;/P&gt;&lt;P&gt;NOTE: Variable x is uninitialized.&lt;BR /&gt;NOTE: The data set WORK.X has 0 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.04 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please anyone can help me in fixing this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anv_SAS&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 14:57:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610202#M18051</guid>
      <dc:creator>Anv_SAS</dc:creator>
      <dc:date>2019-12-07T14:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dumy dataset with only attrib statement in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610203#M18052</link>
      <description>&lt;P&gt;This is just a NOTE, not a WARNING.&lt;/P&gt;
&lt;P&gt;If you want to prevent it, assign a value to x before the stop statement.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 15:06:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610203#M18052</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-07T15:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dumy dataset with only attrib statement in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610205#M18053</link>
      <description>Thank you KurtBremser,&lt;BR /&gt;&lt;BR /&gt;We cannot assign value to x. Only can using attrib statement, is this possible using datastep. Do we have any other way to this.</description>
      <pubDate>Sat, 07 Dec 2019 15:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610205#M18053</guid>
      <dc:creator>Anv_SAS</dc:creator>
      <dc:date>2019-12-07T15:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dumy dataset with only attrib statement in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610206#M18054</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/302673"&gt;@Anv_SAS&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Put the assignment statement (or CALL MISSING, etc.) &lt;EM&gt;after&lt;/EM&gt; the STOP statement. Then it will not be executed, i.e., you really don't assign a value. Nevertheless, the note in the log will no longer appear because the &lt;EM&gt;compiler&lt;/EM&gt; sees an assignment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: Alternatively you can use a RETAIN statement with an initial value if you prefer a declarative statement.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 16:31:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610206#M18054</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-12-07T16:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dumy dataset with only attrib statement in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610209#M18056</link>
      <description>&lt;P&gt;The stop statement prevents any writing of values to the dataset, so it does not matter what you assign to the variable.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 17:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610209#M18056</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-07T17:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dumy dataset with only attrib statement in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610226#M18058</link>
      <description>&lt;P&gt;Adding the variables to an ARRAY will prevent the message.&amp;nbsp; But you need a separate array for the numeric and character variables.&lt;/P&gt;
&lt;P&gt;You can also use the CALL MISSING() function.&lt;/P&gt;
&lt;PRE&gt;110   data x;
111     attrib x label="X" length=$25;
112     array _ _character_;
113     stop;
114   run;

NOTE: The data set WORK.X has 0 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


115
116   data x;
117     attrib x label="X" length=$25;
118     stop;
119     call missing(of _all_);
120   run;

NOTE: The data set WORK.X has 0 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds
&lt;/PRE&gt;
&lt;P&gt;PS&amp;nbsp; There is no need to include a decimal point when specifying a length.&amp;nbsp; Lengths can only be integers.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 21:19:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610226#M18058</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-12-07T21:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dumy dataset with only attrib statement in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610261#M18065</link>
      <description>Why the requirement for the attrib statement? You can definitely creating empty data sets without any values, not sure the attributes statement is the way to do that though.</description>
      <pubDate>Sun, 08 Dec 2019 04:13:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610261#M18065</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-12-08T04:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dumy dataset with only attrib statement in datastep</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610276#M18066</link>
      <description>&lt;P&gt;Then give X a initial value(missing value).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data x;
attrib x label="X" length=$25.;
x=' ';
stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OR Try PROC SQL&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

proc sql;
create table x (
x char(25) label='X'
);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2019 10:36:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-dumy-dataset-with-only-attrib-statement-in/m-p/610276#M18066</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-12-08T10:36:53Z</dc:date>
    </item>
  </channel>
</rss>

