<?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 create data set with data entry in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-data-entry/m-p/768055#M243574</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to ask a question about creating a dat set by data entry.&lt;/P&gt;
&lt;P&gt;I want to understand please why it is written $12 near fname and&amp;nbsp; $9 near class and&amp;nbsp; near lname only $ (without number).&lt;/P&gt;
&lt;P&gt;I would like to udnerstand if I create this data set by myself how to know which $w. should I write.&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;                                                                                                                             
  input fname : $12. lname $ class : $9.;                                                                                               
  datalines;                                                                                                                            
Jon Smith Math                                                                                                                          
John Smith Math                                                                                                                         
Johnny Smith Math                                                                                                                       
James Smith Math                                                                                                                        
Will Miller Chemistry                                                                                                                   
Willy Miller Chemistry                                                                                                                  
Willie Miller Chemistry                                                                                                                 
Bonny Davis Gym                                                                                                                         
Milly Wilson Biology                                                                                                                    
; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Sep 2021 08:42:29 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2021-09-16T08:42:29Z</dc:date>
    <item>
      <title>create data set with data entry</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-data-entry/m-p/768055#M243574</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to ask a question about creating a dat set by data entry.&lt;/P&gt;
&lt;P&gt;I want to understand please why it is written $12 near fname and&amp;nbsp; $9 near class and&amp;nbsp; near lname only $ (without number).&lt;/P&gt;
&lt;P&gt;I would like to udnerstand if I create this data set by myself how to know which $w. should I write.&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;                                                                                                                             
  input fname : $12. lname $ class : $9.;                                                                                               
  datalines;                                                                                                                            
Jon Smith Math                                                                                                                          
John Smith Math                                                                                                                         
Johnny Smith Math                                                                                                                       
James Smith Math                                                                                                                        
Will Miller Chemistry                                                                                                                   
Willy Miller Chemistry                                                                                                                  
Willie Miller Chemistry                                                                                                                 
Bonny Davis Gym                                                                                                                         
Milly Wilson Biology                                                                                                                    
; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 08:42:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-data-entry/m-p/768055#M243574</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-09-16T08:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: create data set with data entry</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-data-entry/m-p/768061#M243575</link>
      <description>&lt;P&gt;$w. is the default character informat (w being the width used for this particular variable). Since no separate LENGTH statement is used, the data step compiler will use the width of the informat as a length for that variable.&lt;/P&gt;
&lt;P&gt;$ on its own means "just character", and if no explicit length was specified (see above), the data step compiler will define the variable with the default length of 8.&lt;/P&gt;
&lt;P&gt;Which width you use for an informat (or if you can go with the default) has to be defined by what you know about the input data.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 08:59:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-data-entry/m-p/768061#M243575</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-16T08:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: create data set with data entry</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-data-entry/m-p/768065#M243576</link>
      <description>&lt;P&gt;I am trying to understand how to build such data set by myself.&lt;BR /&gt;I see with my eyes that for var fname the max length is 6 (Johnny),&lt;BR /&gt;for var lname max length is 6 too (Miller),&lt;BR /&gt;for var class max length is 9 (Chemistry)&lt;BR /&gt;My question is why the person who wrote this code choose to write &lt;BR /&gt;fname : $12. lname $ class : $9.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;fname is max length of 6 so whu did he write 9?&lt;/P&gt;
&lt;P&gt;and so on..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 09:22:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-data-entry/m-p/768065#M243576</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-09-16T09:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: create data set with data entry</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-data-entry/m-p/768069#M243578</link>
      <description>&lt;P&gt;Maybe there were other factors that determined the lengths.&lt;/P&gt;
&lt;P&gt;E.g. variable lengths in an existing dataset that would be combined with this new data.&lt;/P&gt;
&lt;P&gt;Or a data catalog for the project that defined these columns with these attributes.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 09:32:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-data-entry/m-p/768069#M243578</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-16T09:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: create data set with data entry</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-data-entry/m-p/768144#M243612</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to understand how to build such data set by myself.&lt;BR /&gt;I see with my eyes that for var fname the max length is 6 (Johnny),&lt;BR /&gt;for var lname max length is 6 too (Miller),&lt;BR /&gt;for var class max length is 9 (Chemistry)&lt;BR /&gt;My question is why the person who wrote this code choose to write &lt;BR /&gt;fname : $12. lname $ class : $9.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;fname is max length of 6 so whu did he write 9?&lt;/P&gt;
&lt;P&gt;and so on..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Or you are only seeing part of the data as an example and there are values longer than shown.&lt;/P&gt;
&lt;P&gt;Personally I would suspect 12 is too short for most person name fields (I routinely run into last names in the 20+ character range and first names longer than 12)&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 14:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-data-set-with-data-entry/m-p/768144#M243612</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-09-16T14:18:00Z</dc:date>
    </item>
  </channel>
</rss>

