<?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: Understanding the code in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Understanding-the-code/m-p/850909#M37301</link>
    <description>&lt;P&gt;The code reads (or tries to read) data from a comma-separated file (csv = Comma Separated Values).&lt;/P&gt;
&lt;P&gt;FIRSTOBS=2 means that the first line is skipped.&lt;/P&gt;
&lt;P&gt;The multiple FORMAT statements implicitly set lengths for the variables; this is not good practice, a LENGTH statement should be used instead.&lt;/P&gt;
&lt;P&gt;Since no informat is set, I suspect that the date and time will not be read correctly (unless the file contains raw SAS date and time values).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile
  "&amp;amp;path\sample.csv"
  delimiter = ','
  missover
  firstobs = 2
  dsd
  lrecl = 32767
;
length
  IP $15
  date 8
  time 8
  zone $5
  cik $7
  accession $20
  extension $30
  code $3
  size 8
;
format
  date yymmdd10.
  time hhmm.
  size 10.
;
input 
  IP
  date :yymmdd10. /* use proper informat for the dates found in the file */
  time :hhmm. /* same as above, for times */
  zone
  cik
  accession
  extension
  code
  size
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 23 Dec 2022 07:42:32 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-12-23T07:42:32Z</dc:date>
    <item>
      <title>Understanding the code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Understanding-the-code/m-p/850905#M37299</link>
      <description>&lt;PRE&gt;&lt;CODE class=""&gt;data want;
       infile "&amp;amp;path\sample.csv"
       delimiter = ','
       missover
       firstobs = 2
       DSD 
       lrecl = 32767;
       format IP $15.;
       format date yymmdd10.;
       format time hhmm.;
       format zone $5.;
       format cik $7.;
       format accession $20.;
       format extension $30.;
       format code $3.;
       format size 10.;
       input 
             IP $
             date 
             time 
             zone $
             cik $
             accession $
             extension $
             code $
             size
       ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What will this code does? Can anyone Explain?&lt;/P&gt;&lt;P&gt;I was trying to replace variable names in the CSV file is this correct and I don't want to use Replace.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 06:37:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Understanding-the-code/m-p/850905#M37299</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2022-12-23T06:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding the code</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Understanding-the-code/m-p/850909#M37301</link>
      <description>&lt;P&gt;The code reads (or tries to read) data from a comma-separated file (csv = Comma Separated Values).&lt;/P&gt;
&lt;P&gt;FIRSTOBS=2 means that the first line is skipped.&lt;/P&gt;
&lt;P&gt;The multiple FORMAT statements implicitly set lengths for the variables; this is not good practice, a LENGTH statement should be used instead.&lt;/P&gt;
&lt;P&gt;Since no informat is set, I suspect that the date and time will not be read correctly (unless the file contains raw SAS date and time values).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile
  "&amp;amp;path\sample.csv"
  delimiter = ','
  missover
  firstobs = 2
  dsd
  lrecl = 32767
;
length
  IP $15
  date 8
  time 8
  zone $5
  cik $7
  accession $20
  extension $30
  code $3
  size 8
;
format
  date yymmdd10.
  time hhmm.
  size 10.
;
input 
  IP
  date :yymmdd10. /* use proper informat for the dates found in the file */
  time :hhmm. /* same as above, for times */
  zone
  cik
  accession
  extension
  code
  size
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Dec 2022 07:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Understanding-the-code/m-p/850909#M37301</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-12-23T07:42:32Z</dc:date>
    </item>
  </channel>
</rss>

