<?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: Same principle but different outcomes?! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/589504#M168625</link>
    <description>&lt;P&gt;Wow, great! Thank you so much! I guess I seriously need to improve my SAS skills.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Sep 2019 23:48:42 GMT</pubDate>
    <dc:creator>expertyejin</dc:creator>
    <dc:date>2019-09-17T23:48:42Z</dc:date>
    <item>
      <title>Same principle but different outcomes?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/589501#M168623</link>
      <description>&lt;P&gt;Hi all:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am exploring some basic SAS statements. Here is my first code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
input a (b c) ($);
put a= b= c=;
datalines;
1 A B
2 C D
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When I run this I get exactly the result as I expected, and I thought using the same principle I can be a bit more creative. So I tried this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
input a (b c) (date9.);
put a= b= ddmmyy10. c= mmddyy10.;
datalines;
1 13jan1988 21may2000
2 30aug1994 05dec1999
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To my surprise this time the code isn't working quite. In fact here is the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 70         
 71         data _null_;
 72         input a (b c) (date9.);
 73         put a= b= ddmmyy10. c= mmddyy10.;
 74         datalines;
 
 NOTE: Invalid data for c in line 75 12-20.
 a=1 b=13/01/1988 c=.
 RULE:      ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0                     
 75         1 13jan1988 21may2000
 a=1 b=10239 c=. _ERROR_=1 _N_=1
 NOTE: Invalid data for c in line 76 12-20.
 a=2 b=30/08/1994 c=.
 76         2 30aug1994 05dec1999
 a=2 b=12660 c=. _ERROR_=1 _N_=2
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       user cpu time       0.00 seconds
       system cpu time     0.00 seconds
       memory              465.56k
       OS Memory           27044.00k
       Timestamp           09/17/2019 10:42:41 PM
       Step Count                        84  Switch Count  0
       Page Faults                       0
       Page Reclaims                     84
       Page Swaps                        0
       Voluntary Context Switches        0
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           0
       
 
 77         ;
 78         run;
 79         
 80         
 81         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 92         &lt;/PRE&gt;
&lt;P&gt;Can anyone tell me why the former is working but not the latter?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2019 22:53:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/589501#M168623</guid>
      <dc:creator>expertyejin</dc:creator>
      <dc:date>2019-09-17T22:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Same principle but different outcomes?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/589503#M168624</link>
      <description>&lt;P&gt;You need the : format modifier to use LIST input with explicit in-format.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1    data _null_;
2       input a (b c) (:date9.);
3       put a= (b c) (=ddmmyy10.);
4       datalines;

a=1 b=13/01/1988 c=21/05/2000
a=2 b=30/08/1994 c=05/12/1999
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 14:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/589503#M168624</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-09-18T14:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Same principle but different outcomes?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/589504#M168625</link>
      <description>&lt;P&gt;Wow, great! Thank you so much! I guess I seriously need to improve my SAS skills.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2019 23:48:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/589504#M168625</guid>
      <dc:creator>expertyejin</dc:creator>
      <dc:date>2019-09-17T23:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Same principle but different outcomes?!  21may200</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/589508#M168628</link>
      <description>&lt;P&gt;Read the log:&lt;/P&gt;
&lt;PRE&gt; NOTE: Invalid data for c in line 75 12-20.
 RULE:      ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0                     
 75         1 13jan1988 21may2000&lt;/PRE&gt;
&lt;P&gt;The pointer is moved by 9 positions to read the first date because of the informat's length, and then reads the next 9 for the second date.&lt;/P&gt;
&lt;P&gt;The 9 characters at positions 12-20 are :&amp;nbsp; &lt;FONT color="#000000"&gt;&amp;nbsp;'&lt;FONT face="courier new,courier"&gt; 21may200'&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's not a valid date9 string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's all in the log!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 01:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/589508#M168628</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-09-18T01:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Same principle but different outcomes?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/589684#M168698</link>
      <description>&lt;P&gt;Try running this:&lt;/P&gt;
&lt;PRE&gt;data _null_;
input a (b c) (date9.);
put a= b= ddmmyy10. c= mmddyy10.;
datalines;
1 13jan198821may2000
2 30aug199405dec1999
;
run;&lt;/PRE&gt;
&lt;P&gt;Without the : modifier when using&amp;nbsp;formats on the input statement&amp;nbsp;the next variable starts in the column immediately after the end of the previous variable. Formatted input as you attempted in more appropriate for fixed-column data than for delimited data.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 14:56:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/589684#M168698</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-18T14:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Same principle but different outcomes?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/590616#M169073</link>
      <description>&lt;P&gt;Thank you all for your help! I guess I run into this problem because just like character variables, numeric variables may also get truncated when they exceed 8 digits and that's the reason SAS requires a colon modifier, right?&lt;/P&gt;</description>
      <pubDate>Sat, 21 Sep 2019 14:44:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/590616#M169073</guid>
      <dc:creator>expertyejin</dc:creator>
      <dc:date>2019-09-21T14:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Same principle but different outcomes?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/590829#M169156</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;numeric variables may also get truncated when they exceed 8 digits and that's the reason SAS requires a colon modifier, right?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;No.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Read the explanations above again.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And read about the &lt;A href="https://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a003209907.htm" target="_self"&gt;colon modifier.&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 04:27:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-principle-but-different-outcomes/m-p/590829#M169156</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-09-23T04:27:50Z</dc:date>
    </item>
  </channel>
</rss>

