<?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 Possible INFILE problem with my code in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Possible-INFILE-problem-with-my-code/m-p/47110#M12612</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have pieced together the following DATA statement with examples I've found and it runs to completion but doesn not populate the pdb. The problem I am trying to solve is to read through 10 files, checking if they exists and import thier data into a pdb. Simple enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿﻿﻿﻿DATA USER.LNX_HISTORY;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ARRAY SYS{10} $4. _TEMPORARY_&amp;nbsp; ('SYSE' 'SYSX' 'LNX1' 'LNX2' 'LNX3' 'LNX4' 'LNX5' 'LNX6' 'LNX7' 'LNX8');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO I = 1 TO 10;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; LENGTH FILENAME $256;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; FILENAME = CATS('SYS90H.'||SYS{I}||'HISTORY.',PUT(TODAY()-1,YYMMDD6.));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IF FILEEXIST(FILENAME) THEN DO;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INFILE DUMMY END=EOF FILEVAR=FILENAME;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DO WHILE(NOT EOF);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xxxxx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xxxxx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xxxxx....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; END;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;STOP;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting sporatic results when I run this. Sometimes it reads through all allocated files and put zero observations to the pdb, sometimes it loops. I've narrowed it down to the INFILE statement but cannot figure it out yet. If anyone sees anything obvious, please thump me on the head!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeff&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Mar 2012 14:58:05 GMT</pubDate>
    <dc:creator>G_I_Jeff</dc:creator>
    <dc:date>2012-03-28T14:58:05Z</dc:date>
    <item>
      <title>Possible INFILE problem with my code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Possible-INFILE-problem-with-my-code/m-p/47110#M12612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have pieced together the following DATA statement with examples I've found and it runs to completion but doesn not populate the pdb. The problem I am trying to solve is to read through 10 files, checking if they exists and import thier data into a pdb. Simple enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿﻿﻿﻿DATA USER.LNX_HISTORY;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ARRAY SYS{10} $4. _TEMPORARY_&amp;nbsp; ('SYSE' 'SYSX' 'LNX1' 'LNX2' 'LNX3' 'LNX4' 'LNX5' 'LNX6' 'LNX7' 'LNX8');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO I = 1 TO 10;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; LENGTH FILENAME $256;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; FILENAME = CATS('SYS90H.'||SYS{I}||'HISTORY.',PUT(TODAY()-1,YYMMDD6.));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IF FILEEXIST(FILENAME) THEN DO;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INFILE DUMMY END=EOF FILEVAR=FILENAME;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DO WHILE(NOT EOF);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xxxxx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xxxxx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xxxxx....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; END;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;STOP;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting sporatic results when I run this. Sometimes it reads through all allocated files and put zero observations to the pdb, sometimes it loops. I've narrowed it down to the INFILE statement but cannot figure it out yet. If anyone sees anything obvious, please thump me on the head!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeff&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 14:58:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Possible-INFILE-problem-with-my-code/m-p/47110#M12612</guid>
      <dc:creator>G_I_Jeff</dc:creator>
      <dc:date>2012-03-28T14:58:05Z</dc:date>
    </item>
    <item>
      <title>Possible INFILE problem with my code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Possible-INFILE-problem-with-my-code/m-p/47111#M12613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. When constructing the filename, should a period be before HISTORY, e.g. sys90h.syse.history.120327?&lt;/P&gt;&lt;P&gt;2. It's been a while since I've worked on a mainframe. If these are os/390 files, don't the segments of the filename have to begin with an alpha character? So the segment with the date must begin with a-z.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 15:22:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Possible-INFILE-problem-with-my-code/m-p/47111#M12613</guid>
      <dc:creator>FloydNevseta</dc:creator>
      <dc:date>2012-03-28T15:22:15Z</dc:date>
    </item>
    <item>
      <title>Possible INFILE problem with my code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Possible-INFILE-problem-with-my-code/m-p/47112#M12614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; SAS_Bigot,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes your correct and I'm sorry I miss-typed the statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FILENAME = CATS('SYS90H.'||SYS{I}||'.HISTORY.D',PUT(TODAY()-1,YYMMDD6.));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guess I was in a hurry!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know the FILENAME statement is correct because when I test the DO loops with the following code it works as expected:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;﻿DATA USER.LNX_HISTORY;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ARRAY SYS{10} $4. _TEMPORARY_ ('SYSE' 'SYSX' 'LNX2' 'LNX3' 'LNX4' 'LNX5' 'LNX6' 'LNX7' 'LNX8');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DO I = 1 TO 10;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LENGTH FILENAME $256;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FILENAME = CATS('SYS90H.'||SYS{I}||'.HISTORY.D',PUT(TODAY()-1,YYMMDD6.));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF FILEEXISTS(FILENAME) THEN DO;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PUT FILENAME;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;END;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;END;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;STOP;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RUN;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I recieve the following:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SYS90D.SYSE.HISTORY.D120327&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SYS90D.SYSX.HISTORY.D120327&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SYS90D.LNX2.HISTORY.D120327&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SYS90D.LNX3.HISTORY.D120327&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SYS90D.LNX4.HISTORY.D120327&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SYS90D.LNX5.HISTORY.D120327&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Those are the current allocated files on the system this code is running on. So it has to do something with the INFILE statement, either witht EOF not being set or I'm creating a loop with the DO WHILE(NOT EOF);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 15:41:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Possible-INFILE-problem-with-my-code/m-p/47112#M12614</guid>
      <dc:creator>G_I_Jeff</dc:creator>
      <dc:date>2012-03-28T15:41:05Z</dc:date>
    </item>
    <item>
      <title>Possible INFILE problem with my code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Possible-INFILE-problem-with-my-code/m-p/47113#M12615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The obvious head-thumper is that there is no OUTPUT statement.&amp;nbsp; Most DATA steps output a record automatically upon hitting the bottom of the DATA step at the RUN statement.&amp;nbsp; This code loops, then stops before getting there, so it should have an OUTPUT statement after the INPUT statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 16:10:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Possible-INFILE-problem-with-my-code/m-p/47113#M12615</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-03-28T16:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Possible INFILE problem with my code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Possible-INFILE-problem-with-my-code/m-p/47114#M12616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Astouding,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DUHH!! Thank you!! I knew it was something very stupid I was overlooking!! I don't know where I lost the output statement along the way....&lt;/P&gt;&lt;P&gt;This is the first time I've tried doing something like this inside loops so I'm glad it works now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 16:24:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Possible-INFILE-problem-with-my-code/m-p/47114#M12616</guid>
      <dc:creator>G_I_Jeff</dc:creator>
      <dc:date>2012-03-28T16:24:26Z</dc:date>
    </item>
  </channel>
</rss>

