<?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: INFILE in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/INFILE/m-p/5840#M2361</link>
    <description>Hi:&lt;BR /&gt;
  This is not an ODS or Base Reporting procedure (PRINT, REPORT or TABULATE) question. It is almost impossible for anyone on the forum to look at your program and debug it without also looking at a sample of your data file(s).&lt;BR /&gt;
&lt;BR /&gt;
  This is a perfect question for Tech Support, because they can look at your data, look at your code and help you debug what's not working or suggest program alterations to make the program work better. To contact Tech Support, go to:&lt;BR /&gt;
&lt;A href="http://support.sas.com" target="_blank"&gt;http://support.sas.com&lt;/A&gt;  and in the left hand navigation pane click the link entitled on "Submit a Problem".&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
    <pubDate>Mon, 10 Dec 2007 16:08:05 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2007-12-10T16:08:05Z</dc:date>
    <item>
      <title>INFILE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/INFILE/m-p/5839#M2360</link>
      <description>Hi Buddy,&lt;BR /&gt;
I have one logic which is retrieving the content from mutiple files dynamically using "INFILE MYINFILE FILEVAR=dsn FILENAME=MYINFILE END=nd; " statement. For some cases the below code doesn't ran fine. I don't know the exact problem  in the below code. I took the backup of the input files and ran with this code. For this the code ran fine. Please help to find the bug in the below code.&lt;BR /&gt;
&lt;BR /&gt;
Sorce code:-&lt;BR /&gt;
DATA main(KEEP=clientno date year)                                    &lt;BR /&gt;
  adset(KEEP=client process align subset date year)                   &lt;BR /&gt;
adjust(KEEP=client process_id ip_rows op_rows comment1 type date year)&lt;BR /&gt;
  drm45(KEEP=client process date comment) ;                           &lt;BR /&gt;
  SET one NOBS=n1;                                                    &lt;BR /&gt;
      FORMAT date DATE5. ;                                            &lt;BR /&gt;
      len = LENGTH(dsn) ;                                             &lt;BR /&gt;
      date = SUBSTR(dsn,len-6,3);                                     &lt;BR /&gt;
      CALL SYMPUT('date',PUT(date,DATE5.));                           &lt;BR /&gt;
      year=TRIM("&amp;amp;year4");                                            &lt;BR /&gt;
                                                                      &lt;BR /&gt;
        IF n1 &amp;gt;= _N_ THEN DO;                                         &lt;BR /&gt;
         INFILE MYINFILE FILEVAR=dsn FILENAME=MYINFILE END=nd;        &lt;BR /&gt;
             IF nd ¬=1 THEN DO;                                       &lt;BR /&gt;
                subject='       '; process='     ';                   &lt;BR /&gt;
                proces1='              ';                             &lt;BR /&gt;
                INPUT @1  subject $7.                                 &lt;BR /&gt;
                      @10 process $5.                                 &lt;BR /&gt;
                      @10 proces1 $14. ;                              &lt;BR /&gt;
                put subject= process= proces1=;                       &lt;BR /&gt;
****************************************************************;     &lt;BR /&gt;
*** Reading Data for Adset process  Email notification     *****;     &lt;BR /&gt;
****************************************************************;     &lt;BR /&gt;
                IF process = 'ADSET' THEN DO;                         &lt;BR /&gt;
                   INPUT / @1 status  $80.                            &lt;BR /&gt;
                         / @17 client $3.                             &lt;BR /&gt;
                         / @17 align  $1.                             &lt;BR /&gt;
                         / @17 subset $2.;                            &lt;BR /&gt;
                   PUT 'INSIDE ADSET: ' _n_ ;                         &lt;BR /&gt;
                   OUTPUT adset;                                      &lt;BR /&gt;
                                                                      &lt;BR /&gt;
                END;                                                  &lt;BR /&gt;
                                                                      &lt;BR /&gt;
****************************************************************;     &lt;BR /&gt;
*** Reading Data for DRM45 process  Email notification     *****;     &lt;BR /&gt;
****************************************************************;     &lt;BR /&gt;
                IF process = 'DRM45' THEN DO;                         &lt;BR /&gt;
                   INPUT / @1 status  $80.                         &lt;BR /&gt;
                         / @20 client $3.;                         &lt;BR /&gt;
                   IF TRIM(SUBSTR(status,18,6)) = "FAILED" THEN    &lt;BR /&gt;
                       comment = 'ERROR ENCOUNTERED' ;             &lt;BR /&gt;
                   ELSE DO ;                                       &lt;BR /&gt;
                       INPUT / / / @1 rec3 $80. ;                  &lt;BR /&gt;
                       IF INDEX(rec3,'NOT PROCESSED') ¬= 0 THEN    &lt;BR /&gt;
                          comment = 'ERROR ENCOUNTERED' ;          &lt;BR /&gt;
                       ELSE                                        &lt;BR /&gt;
                          comment = '' ;                           &lt;BR /&gt;
                   END;                                            &lt;BR /&gt;
                                                                   &lt;BR /&gt;
                   PUT 'INSIDE DRM45: ' _N_ ;                      &lt;BR /&gt;
                   OUTPUT drm45;                                   &lt;BR /&gt;
                                                                   &lt;BR /&gt;
                END;                                               &lt;BR /&gt;
****************************************************************;  &lt;BR /&gt;
*** Reading Data for Adjustment set Email notification     *****;  &lt;BR /&gt;
****************************************************************;     &lt;BR /&gt;
                                                                      &lt;BR /&gt;
                IF proces1 = "ADJUSTMENT SET" THEN DO;                &lt;BR /&gt;
                            comment1 = '                 ';           &lt;BR /&gt;
                    DO UNTIL(nd);                                     &lt;BR /&gt;
                    RETAIN comment1 client process_id ip_rows op_rows;&lt;BR /&gt;
                    put comment1= client= process_id= ;               &lt;BR /&gt;
                         INPUT @1 rec $140.;                          &lt;BR /&gt;
                         IF INDEX(rec,'CLIENT ID') ¬= 0 THEN          &lt;BR /&gt;
                            client = SUBSTR(rec,18,3);                &lt;BR /&gt;
                         IF INDEX(rec,'PROCESS ID') ¬= 0 THEN         &lt;BR /&gt;
                            process_id = SUBSTR(rec,19,7);            &lt;BR /&gt;
                         IF INDEX(rec,'READ') ¬= 0 THEN               &lt;BR /&gt;
                            ip_rows = SUBSTR(rec,55,10);              &lt;BR /&gt;
                         IF INDEX(rec,'WRITTEN') ¬= 0 THEN            &lt;BR /&gt;
                            op_rows = SUBSTR(rec,55,10);              &lt;BR /&gt;
                         IF INDEX(rec,'ERRORS') ¬= 0 THEN             &lt;BR /&gt;
                            comment1 = 'ERROR ENCOUNTERED';        &lt;BR /&gt;
                    END ;                                          &lt;BR /&gt;
                      IF nd = 1 THEN OUTPUT adjust;                &lt;BR /&gt;
                END ;                                              &lt;BR /&gt;
    put ' end of adjustment';                                      &lt;BR /&gt;
****************************************************************;  &lt;BR /&gt;
*** Reading Data for PRH10 process  Email notification     *****;  &lt;BR /&gt;
****************************************************************;  &lt;BR /&gt;
                IF subject = 'DATA' THEN DO;                       &lt;BR /&gt;
                       put ' DATA';                                &lt;BR /&gt;
                     DO UNTIL(nd);                                 &lt;BR /&gt;
                       INPUT @1 keyword1 $6.                       &lt;BR /&gt;
                             @42 clientno $3. ;                    &lt;BR /&gt;
                       IF keyword1 = 'CLIENT' THEN OUTPUT main;    &lt;BR /&gt;
                                                                   &lt;BR /&gt;
                     END ;                                         &lt;BR /&gt;
                END ;                                              &lt;BR /&gt;
             END;                                                  &lt;BR /&gt;
        END;                                                          &lt;BR /&gt;
RUN;</description>
      <pubDate>Mon, 10 Dec 2007 13:27:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/INFILE/m-p/5839#M2360</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-12-10T13:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: INFILE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/INFILE/m-p/5840#M2361</link>
      <description>Hi:&lt;BR /&gt;
  This is not an ODS or Base Reporting procedure (PRINT, REPORT or TABULATE) question. It is almost impossible for anyone on the forum to look at your program and debug it without also looking at a sample of your data file(s).&lt;BR /&gt;
&lt;BR /&gt;
  This is a perfect question for Tech Support, because they can look at your data, look at your code and help you debug what's not working or suggest program alterations to make the program work better. To contact Tech Support, go to:&lt;BR /&gt;
&lt;A href="http://support.sas.com" target="_blank"&gt;http://support.sas.com&lt;/A&gt;  and in the left hand navigation pane click the link entitled on "Submit a Problem".&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 10 Dec 2007 16:08:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/INFILE/m-p/5840#M2361</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-12-10T16:08:05Z</dc:date>
    </item>
  </channel>
</rss>

