<?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: input date data but not shown in right way in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/input-date-data-but-not-shown-in-right-way/m-p/834036#M329737</link>
    <description>&lt;P&gt;If you want the dates to print in a human recognizable way you need to attach a format specification to the variable.&lt;/P&gt;
&lt;P&gt;You should also update your INPUT statement to either read the date value using LIST MODE like the other variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data d;
  input PERMNO INIT_DATA :YYMMDD10. CUSIP $ END_DATA :YYMMDD10.;
  format init_data end_data yymmdd10.;
datalines;
10107 1999-11-01 59491810 2003-12-31
10145 1989-01-01 01951210 1999-12-02
10145 1999-12-03 43851610 2003-12-31
10401 1989-01-01 03017710 1994-04-21
10401 1994-04-22 00195710 2002-11-19
10401 2002-11-20 00195750 2003-12-31
10786 1989-01-01 08750910 1997-01-16
11308 1989-01-01 19121610 2003-12-31
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or if you want to read them using FORMATTED mode then tell it exactly which column to start at to make sure it reads the the right 10 characters.&amp;nbsp; If you start reading at the space instead of the first digit of the year you will miss the last digit of the day of the month.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  input PERMNO @7 INIT_DATA YYMMDD10. CUSIP $ @27 END_DATA YYMMDD10.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;PRE&gt;231  data d;
232    input PERMNO INIT_DATA YYMMDD10. CUSIP $ END_DATA YYMMDD10.;
233    format init_data end_data yymmdd10.;
234  datalines;

NOTE: Invalid data for END_DATA in line 235 25-34.
RULE:      ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
235        10107 1999-11-01 594918   2003-12-31
PERMNO=10107 INIT_DATA=1999-11-01 CUSIP=594918 END_DATA=. _ERROR_=1 _N_=1
NOTE: The data set WORK.D has 1 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
&lt;/PRE&gt;</description>
    <pubDate>Sun, 18 Sep 2022 19:29:11 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-09-18T19:29:11Z</dc:date>
    <item>
      <title>input date data but not shown in right way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-date-data-but-not-shown-in-right-way/m-p/834035#M329736</link>
      <description>&lt;P class=""&gt;THIS IS WHAT I DID&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Data d;
INPUT PERMNO INIT_DATA YYMMDD10. CUSIP $ END_DATA YYMMDD10.;
DATALINES;
10107 1999-11-01 59491810 2003-12-31
10145 1989-01-01 01951210 1999-12-02
10145 1999-12-03 43851610 2003-12-31
10401 1989-01-01 03017710 1994-04-21
10401 1994-04-22 00195710 2002-11-19
10401 2002-11-20 00195750 2003-12-31
10786 1989-01-01 08750910 1997-01-16
11308 1989-01-01 19121610 2003-12-31
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P class=""&gt;BUT THE DATA SHOWS IN BEST12 FORMAT.&lt;/P&gt;&lt;P class=""&gt;WHY?&lt;/P&gt;&lt;P class=""&gt;AND HOW DO I CHANGE IT INTO YYMMDD10.?&lt;/P&gt;&lt;P class=""&gt;THANKS&lt;/P&gt;</description>
      <pubDate>Sun, 18 Sep 2022 19:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-date-data-but-not-shown-in-right-way/m-p/834035#M329736</guid>
      <dc:creator>wfiona020</dc:creator>
      <dc:date>2022-09-18T19:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: input date data but not shown in right way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-date-data-but-not-shown-in-right-way/m-p/834036#M329737</link>
      <description>&lt;P&gt;If you want the dates to print in a human recognizable way you need to attach a format specification to the variable.&lt;/P&gt;
&lt;P&gt;You should also update your INPUT statement to either read the date value using LIST MODE like the other variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data d;
  input PERMNO INIT_DATA :YYMMDD10. CUSIP $ END_DATA :YYMMDD10.;
  format init_data end_data yymmdd10.;
datalines;
10107 1999-11-01 59491810 2003-12-31
10145 1989-01-01 01951210 1999-12-02
10145 1999-12-03 43851610 2003-12-31
10401 1989-01-01 03017710 1994-04-21
10401 1994-04-22 00195710 2002-11-19
10401 2002-11-20 00195750 2003-12-31
10786 1989-01-01 08750910 1997-01-16
11308 1989-01-01 19121610 2003-12-31
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or if you want to read them using FORMATTED mode then tell it exactly which column to start at to make sure it reads the the right 10 characters.&amp;nbsp; If you start reading at the space instead of the first digit of the year you will miss the last digit of the day of the month.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  input PERMNO @7 INIT_DATA YYMMDD10. CUSIP $ @27 END_DATA YYMMDD10.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;PRE&gt;231  data d;
232    input PERMNO INIT_DATA YYMMDD10. CUSIP $ END_DATA YYMMDD10.;
233    format init_data end_data yymmdd10.;
234  datalines;

NOTE: Invalid data for END_DATA in line 235 25-34.
RULE:      ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
235        10107 1999-11-01 594918   2003-12-31
PERMNO=10107 INIT_DATA=1999-11-01 CUSIP=594918 END_DATA=. _ERROR_=1 _N_=1
NOTE: The data set WORK.D has 1 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Sep 2022 19:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-date-data-but-not-shown-in-right-way/m-p/834036#M329737</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-09-18T19:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: input date data but not shown in right way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-date-data-but-not-shown-in-right-way/m-p/834044#M329743</link>
      <description>&lt;P&gt;Use the colon modifier to prevent formatted input (which will ignore the delimiters), and assign display formats:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input permno init_data :yymmdd10. cusip $ end_data :yymmd10.;
format init_data end_data yymmdd10.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Sep 2022 01:31:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-date-data-but-not-shown-in-right-way/m-p/834044#M329743</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-09-19T01:31:35Z</dc:date>
    </item>
  </channel>
</rss>

