<?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: Data step to generate table with all the reports it can find generates an undetermined error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956770#M373542</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried your version and I get the same result as I used to (thanks for the information on Quote() as it is new for me). The process "works" but it gets out of the data step with an error message:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RockSolid_0-1737477936246.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103884iD2A7DC2B9D97B219/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RockSolid_0-1737477936246.png" alt="RockSolid_0-1737477936246.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I tried to do a bit of debugging, starting from scratch and adding new lines to the code, step by step. It seems to me that the issue is with the Filename function and the usage of the File Service ('FILESRVC'). If I use define the file name it will read the files correctly but it will generate an error at the end it contains any folder. Like this:&lt;/P&gt;&lt;PRE&gt;fc= filename('filrf','','FILESRVC',cats("folderpath='", fparent, "' filename='", report, "'"));&lt;/PRE&gt;&lt;P&gt;If instead I define the full path inside the folderpath it will work well only if all the children are folders. The moment there's a file in the directory it will not read it correctly and get out of the data step with an error message.&lt;/P&gt;&lt;PRE&gt;rc = filename('dirrf', '', 'FILESRVC', cats("folderpath='", fullpath, "'"));&lt;/PRE&gt;&lt;P&gt;So, I just don't know how to get something that works for directories that contain both files and folders. I tried to follow the github that you shared but that person is not using 'FILESRVC' and without it I get no results. I'll keep looking&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2025 16:55:55 GMT</pubDate>
    <dc:creator>RockSolid</dc:creator>
    <dc:date>2025-01-21T16:55:55Z</dc:date>
    <item>
      <title>Data step to generate table with all the reports it can find generates an undetermined error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956040#M373343</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;New to the forum. I'm facing an issue when executing the following data step (Using SAS Viya 4):&lt;/P&gt;&lt;PRE&gt;data GEN_Reports_&amp;amp;region.;
    set GEN_Folders_&amp;amp;region.; /* Start with the existing filenames dataset */
	length region $10 plant $4 report $200 fparent $200 folderpath $500 fullpath $500 description $500;

    /* Check if the entry is a folder */
	region="&amp;amp;region.";
    rc = filename('dirrf', '', 'FILESRVC', cats("folderpath='", fullpath, "'"));
    did = dopen('dirrf');

    if did &amp;gt; 0 then do; /* If it's a folder, explore its contents */
        folderpath = fullpath; /* Update folderpath to the current folder */
        do i = 1 to dnum(did);
            report = dread(did, i); /* File or subfolder name */
            fullpath = cats(folderpath, "/", report);

            /* Check if it's another subfolder */
            rc_sub = filename('checksub', '', 'FILESRVC', cats("folderpath='", fullpath, "'"));
            did_sub = dopen('checksub');
            if did_sub &amp;gt; 0 then do; /* It's a subfolder */
                /*fparent = folderpath;
                output;*/
                did_sub = dclose(did_sub);
            end;
            else do; /* It's a file */
                fparent = folderpath;
				fc= filename('filrf','','FILESRVC',cats("folderpath='", fparent, "' filename='", report, "'"));
                fid=fopen('filrf');
				optval=finfo(fid,'File Identifier');
				description=finfo(fid,'Description');
				hyperlink=cats('https://****/SASVisualAnalytics/?reportUri=/reports/reports/',optval,'&amp;amp;reportViewOnly=true&amp;amp;sas-welcome=false');
				fid=fclose(fid);
				fc= filename('filrf');
				*output; /* Save the file information */
            end;
			rc_sub = filename('checksub');
        end;
        did = dclose(did);
    end;

	rc= filename('dirrf');
	keep region plant report folderpath fullpath optval hyperlink description;
run;&lt;/PRE&gt;&lt;P&gt;What the data step is trying to accomplish is to list all VA reports in the subfolders (representing different locations my company) of a folder (defined by the macro &amp;amp;region).&lt;BR /&gt;&lt;BR /&gt;The thing is that, if I run this step in isolation it will successfully generate the table but the logs will show the following message:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: There were 5 observations read from the data set WORK.GEN_FOLDERS_REU.&lt;BR /&gt;WARNING: The data set WORK.GEN_REPORTS_REU may be incomplete. When this step was stopped there were 5 observations and 8 variables.&lt;BR /&gt;WARNING: Data set WORK.GEN_REPORTS_REU was not replaced because this step was stopped.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been completely unable to find out what those "because of errors" mean. I've run it in debug and it generates no error. I'm almost sure that I'm closing all the file and directory references.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any Idea?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 11:13:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956040#M373343</guid>
      <dc:creator>RockSolid</dc:creator>
      <dc:date>2025-01-14T11:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Data step to generate table with all the reports it can find generates an undetermined error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956149#M373383</link>
      <description>Since the log indicate SAS stops after the 5th iteraction, I think check who should be the 6th observation and why it doesn't will be helpful.</description>
      <pubDate>Wed, 15 Jan 2025 02:47:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956149#M373383</guid>
      <dc:creator>whymath</dc:creator>
      <dc:date>2025-01-15T02:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Data step to generate table with all the reports it can find generates an undetermined error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956153#M373385</link>
      <description>&lt;P&gt;How many levels of directories does your source file system have?&lt;/P&gt;
&lt;P&gt;I don't think your logic can handle more than one level of nesting.&lt;/P&gt;
&lt;P&gt;You might want to use the MODIFY trick of this macro instead so that it can simulate recursion.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/sasutils/macros/blob/master/dirtree.sas" target="_blank" rel="noopener"&gt;https://github.com/sasutils/macros/blob/master/dirtree.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Just adjust the code to use your FILESRV engine to open the files instead of the normal direct file access.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 04:01:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956153#M373385</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-01-15T04:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Data step to generate table with all the reports it can find generates an undetermined error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956155#M373387</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/270406"&gt;@whymath&lt;/a&gt;, the starting dataset has only 5 observations, so I assume there's an issue when "getting out" of the data step. I tried to debug the Data Step, going line by line, but I got no issue at the individual iteration.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 07:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956155#M373387</guid>
      <dc:creator>RockSolid</dc:creator>
      <dc:date>2025-01-15T07:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Data step to generate table with all the reports it can find generates an undetermined error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956156#M373388</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;The starting dataset has 5 observations representing 5 folders inside the directory I want to look at. Inside those folders there are only report files. No subfolders. The amount of levels is fixed by design. I know my logic is not really advanced. I still have to learn if and how SAS programming can handle recursivity.&lt;BR /&gt;I'll check the link, and try to update the post asap&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 07:42:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956156#M373388</guid>
      <dc:creator>RockSolid</dc:creator>
      <dc:date>2025-01-15T07:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Data step to generate table with all the reports it can find generates an undetermined error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956237#M373418</link>
      <description>&lt;P&gt;Try putting in more testing for errors.&lt;/P&gt;
&lt;P&gt;Also try using QUOTE() function to add the quotes in case there are any single quote characters or leading spaces in one of the folder or file names.&lt;/P&gt;
&lt;P&gt;And it really looks to me like you are using the report name twice in generating that last fileref.&amp;nbsp; Is that how it really works?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data GEN_Reports_&amp;amp;region.;
/* Start with the existing filenames dataset */
  set GEN_Folders_&amp;amp;region.;
  length region $10 plant $4 report $200 fparent $200 folderpath fullpath description $500;

/* Check if the entry is a folder */
  region="&amp;amp;region.";
  rc = filename('dirrf', '', 'FILESRVC', cats("folderpath=",quote(trim(fullpath),"'")));
  if rc then do;
    put 'ERROR: Unable to find folder. ' _n_= folderpath=:$quote.;
    return;
  end;
  did = dopen('dirrf');
/* When a folder, explore its contents */
  if did then do; 
/* Update folderpath to the current folder */
    folderpath = fullpath; 
    do i = 1 to dnum(did);
/* File or subfolder name */
      report = dread(did, i); 
      fullpath = cats(folderpath, "/", report);
/* Check if it's another subfolder */
      rc_sub = filename('checksub', '', 'FILESRVC', cats("folderpath=", quote(trim(fullpath),"'")));
      did_sub = dopen('checksub');
/* Ignore folders */
      if did_sub then did_sub = dclose(did_sub);
      else do;
/* It's a file */
        fparent = folderpath;
        fc=filename('filrf','','FILESRVC'
           ,catx(' ',cats("folderpath=",quote(trim(fparent)))
                    ,cats("filename=",quote(trim(report),"'"))
                )
           );
        if fc then put 'ERROR: Unable to find report. ' _n_= i= report= fparent= ;
        else do;
          fid=fopen('filrf');
          if fid then do;
            optval=finfo(fid,'File Identifier');
            description=finfo(fid,'Description');
            hyperlink=cats('https://****/SASVisualAnalytics/?reportUri=/reports/reports/',optval,'&amp;amp;reportViewOnly=true&amp;amp;sas-welcome=false');
  /* Save the file information */
            output; 
            fid=fclose(fid);
          end;
          else put 'ERROR: Unable to open report file. ' _n_= i= report= fparent= ;
          fc= filename('filrf');
        end;
      end;
      rc_sub = filename('checksub');
    end;
    did = dclose(did);
  end;
  rc= filename('dirrf');
  keep region plant report folderpath fullpath optval hyperlink description;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 18:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956237#M373418</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-01-15T18:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Data step to generate table with all the reports it can find generates an undetermined error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956770#M373542</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried your version and I get the same result as I used to (thanks for the information on Quote() as it is new for me). The process "works" but it gets out of the data step with an error message:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RockSolid_0-1737477936246.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103884iD2A7DC2B9D97B219/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RockSolid_0-1737477936246.png" alt="RockSolid_0-1737477936246.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I tried to do a bit of debugging, starting from scratch and adding new lines to the code, step by step. It seems to me that the issue is with the Filename function and the usage of the File Service ('FILESRVC'). If I use define the file name it will read the files correctly but it will generate an error at the end it contains any folder. Like this:&lt;/P&gt;&lt;PRE&gt;fc= filename('filrf','','FILESRVC',cats("folderpath='", fparent, "' filename='", report, "'"));&lt;/PRE&gt;&lt;P&gt;If instead I define the full path inside the folderpath it will work well only if all the children are folders. The moment there's a file in the directory it will not read it correctly and get out of the data step with an error message.&lt;/P&gt;&lt;PRE&gt;rc = filename('dirrf', '', 'FILESRVC', cats("folderpath='", fullpath, "'"));&lt;/PRE&gt;&lt;P&gt;So, I just don't know how to get something that works for directories that contain both files and folders. I tried to follow the github that you shared but that person is not using 'FILESRVC' and without it I get no results. I'll keep looking&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 16:55:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956770#M373542</guid>
      <dc:creator>RockSolid</dc:creator>
      <dc:date>2025-01-21T16:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Data step to generate table with all the reports it can find generates an undetermined error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956772#M373544</link>
      <description>&lt;P&gt;Huh?&lt;/P&gt;
&lt;P&gt;I am not sure what you are saying works and what does not work.&lt;/P&gt;
&lt;P&gt;Can you run the FILENAME() function for a normal file with either method?&amp;nbsp; Or are you required to use the complicated one?&lt;BR /&gt;Same for a directory (aka "folder").&amp;nbsp; Can you run the FILENAME() for a directory with either method? Or do you have to use the simpler one.&lt;/P&gt;
&lt;P&gt;Please show examples that with text literals only.&amp;nbsp; So something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
   rc1 = filename('file1',,'FILESRVC','folderpath="/dir1/" filename="report.pdf"');
   rc2 = filename('file2',,'FILESRVC','folderpath="/dir1/report.pdf"');
   rc3 = filename('dir1',,'FILESRVC','folderpath="/dir1/" filename="subdir1");
   rc3b = filename('dir1b',,'FILESRVC','folderpath="/dir1/" filename="subdir1/");
   rc4 = filename('dir2',,'FILESRVC','folderpath="/dir1/subdir1"');
   put (rc:) (=);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Once you know what syntax works you can then begin to write code to generate that syntax.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 17:40:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956772#M373544</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-01-21T17:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Data step to generate table with all the reports it can find generates an undetermined error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956780#M373547</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I see that I explained quite badly.&lt;BR /&gt;&lt;BR /&gt;I ran a variation on your snippet:&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;data test1;
	* this is a VA Report, a file;
	rc1_a = filename('file1',,'FILESRVC','folderpath="/Public/ODAP_REPORTS/" filename="A0_ODAP_Welcome"');
run;

data test2;
	* this is the same VA Report, a file;
	rc1_b = filename('file2',,'FILESRVC','folderpath="/Public/ODAP_REPORTS/Resources/A0_ODAP_Welcome"');
run;

data test3;
	* this is a directory;
	rc2_a = filename('dir1',,'FILESRVC','folderpath="/Public/ODAP_REPORTS/" filename="Resources"');
run;

data test4;
	* this is the same directory;
	rc2_b = filename('dir2',,'FILESRVC','folderpath="/Public/ODAP_REPORTS/Resources"');
run;&lt;/PRE&gt;&lt;P&gt;Just to see which version "fails". All of them generate an output table but it is actually the&amp;nbsp;&lt;STRONG&gt;test2&lt;/STRONG&gt; that generates this error message (saying that my code stopped and that the output might be incomplete).&lt;/P&gt;&lt;P&gt;I was using it to check if the elements inside the directory were directories them selves and, if not, I was trying to open it as files.&lt;BR /&gt;What I just realized is that doing it the other way around opening everything as a file (defining the filename) and then checking if it is really a file or not, seems to be the way, because it doesn't generate any errors... I guess that's the way to do it?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Jan 2025 18:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956780#M373547</guid>
      <dc:creator>RockSolid</dc:creator>
      <dc:date>2025-01-21T18:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Data step to generate table with all the reports it can find generates an undetermined error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956793#M373551</link>
      <description>&lt;P&gt;Yes. To check if the "file" is a directory you need to:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;assign a fileref pointing to it&lt;/LI&gt;
&lt;LI&gt;make sure the fileref is pointing to an existing file.&lt;/LI&gt;
&lt;LI&gt;try to open the fileref as a directory using DOPEN().&lt;/LI&gt;
&lt;LI&gt;If that fails then it is a FILE and not a directory.&lt;/LI&gt;
&lt;LI&gt;if it succeeds you can use DREAD() to get the members. Make sure to close it when done.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data step running was not the test.&amp;nbsp; You need to check the return code from the FILENAME() function.&amp;nbsp;The return code will tell you if it worked or not.&amp;nbsp; Note that a filename will work when the file does not exist (SAS does not know at that point if you intend to READ or WRITE using the fileref).&amp;nbsp; So you need to check the actual value of the return code to tell whether or not the file was found.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example check this section of the %DIRTREE() macro:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  rc1=filename("&amp;amp;fileref",catx('/',path,filename));
  if rc1 then do;
    length message $256;
    message=sysmsg();
    put 'ERROR: Unable to create fileref for ' path= filename= ;
    put 'ERROR- ' message ;
    stop;
  end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A non zero value indicates that either there was a problem with defining the fileref, or the fileref worked but it is not pointing to an existing file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have a valid fileref you can then try to open it as a directory.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Try to open as a directory to determine type ;
  did=dopen("&amp;amp;fileref");
  type = ifc(did,'D','F');
  if type='D' then do;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The returned value is pointer to the open directory. A zero value in this case indicates that the directory could not be opened.&amp;nbsp; Do not try to call DOPEN() if the FILENAME() function did not succeed.&amp;nbsp; If the DOPEN() request succeeds make sure to eventually call DCLOSE() to close it again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to try modifying DIRTREE to work for the FILESRVC fileref engine that line with the FILENAME() function call should be the only thing you need to change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 19:45:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956793#M373551</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-01-21T19:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Data step to generate table with all the reports it can find generates an undetermined error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956859#M373571</link>
      <description>&lt;P&gt;Hi Tom.&lt;BR /&gt;&lt;BR /&gt;The steps that you mention are precisely what, I'm telling you, will generate an error status at the end of the data step execution. And it's going to happen on the function filename, when I'm trying to assign the fileref pointing to a file (not a directory), using the &lt;SPAN&gt;FILESRVC engine, and using only the folder path:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;	rc1_b = filename('file2',,'FILESRVC','folderpath="/Public/ODAP_REPORTS/Resources/A0_ODAP_Welcome"');&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;That's what I was trying to tell you with my version of the test.&amp;nbsp;Nevermind what the filename returns (your code returned something like this--&amp;gt; rc1_a = 0 rc1_b=10730045 rc2_a = 0 rc2_b = 0) and whether you can open it or not with a DOPEN(). I'm going to get the same error status when the system steps out of the data step:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RockSolid_0-1737533568825.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103890i8A3982C7EF8E59C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RockSolid_0-1737533568825.png" alt="RockSolid_0-1737533568825.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I did run a version of&amp;nbsp;&lt;SPAN&gt;DIRTREE with FILESERVC. But I always get the same result, as I'm getting from the beginning:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;No error message.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Warning telling me that the table might be incomplete and that my code stop.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;The correct output table&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Error status of the execution --&amp;gt; making subsequent steps fail&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Maybe it is just a problem of the FILESERVC engine, and the scheme of trying to open first as a directory is not the right approach, for this engine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 08:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956859#M373571</guid>
      <dc:creator>RockSolid</dc:creator>
      <dc:date>2025-01-22T08:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Data step to generate table with all the reports it can find generates an undetermined error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956881#M373589</link>
      <description>&lt;P&gt;Perhaps.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What exactly is the WARNING message?&amp;nbsp; You posted a picture of the wrong part of the SAS log.&amp;nbsp; You are just posted the summary that whatever tool (SAS/Studio? EG?) you used to submit the code generated.&amp;nbsp; Instead look for the actual line in the LOG with the WARNING.&amp;nbsp; If you cannot find it then turn off the option that is hiding the autogenerated pre/post code that is added to your code when code is submitted using that tool.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To debug further try hard coding the folder and filenames.&amp;nbsp; So run a step that generates calls the filename() function.&amp;nbsp; Then add one that adds the dopen() call (make sure to remember to add a dclose() if it works).&amp;nbsp; Then add one that adds the DO loop to read the names of all of the files in the folder.&amp;nbsp; etc. etc. until you are able to get the warning again.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 15:03:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-to-generate-table-with-all-the-reports-it-can-find/m-p/956881#M373589</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-01-22T15:03:22Z</dc:date>
    </item>
  </channel>
</rss>

