<?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 PUTTING A HEADER PAGE ON EACH EXCEL FILE in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PUTTING-A-HEADER-PAGE-ON-EACH-EXCEL-FILE/m-p/831165#M328441</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I found this code online and tried to replicate it but I keep getting an error. The code is used to create an header on each excel file. The error said the physical path does not exist but I am not sure of the path shown. Can someone direct me on how to make this works pls.&amp;nbsp; Below is the code and the error log.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class=""&gt;72&lt;/DIV&gt;&lt;DIV class=""&gt;73&lt;/DIV&gt;&lt;DIV class=""&gt;74 options nocenter msglevel=i ls=132 mprint;&lt;/DIV&gt;&lt;DIV class=""&gt;75&lt;/DIV&gt;&lt;DIV class=""&gt;76&lt;/DIV&gt;&lt;DIV class=""&gt;77 * WE ARE NOW PUTTING A HEADER PAGE ON EACH EXCEL FILE TO DOCUMENT THE PROGRAM SOURCE ;&lt;/DIV&gt;&lt;DIV class=""&gt;78 data header_page;&lt;/DIV&gt;&lt;DIV class=""&gt;79 length Information $ 150 ;&lt;/DIV&gt;&lt;DIV class=""&gt;80 if _n_=1 then do;&lt;/DIV&gt;&lt;DIV class=""&gt;81 Information = "RUN DATE: " || put(today(), yymmddd10.) || " at &amp;amp;systime" ; output;&lt;/DIV&gt;&lt;DIV class=""&gt;82 Information = "FILE NAME: " || "%substr(&amp;amp;SYSPROCESSNAME,9)"; output;&lt;/DIV&gt;&lt;DIV class=""&gt;83 Information = "RUN BY: " || "&amp;amp;sysuserid" ; output;&lt;/DIV&gt;&lt;DIV class=""&gt;84 Information = "*********************************************************" ; output;&lt;/DIV&gt;&lt;DIV class=""&gt;85 end;&lt;/DIV&gt;&lt;DIV class=""&gt;86 infile "%substr(&amp;amp;SYSPROCESSNAME,9)" truncover;&lt;/DIV&gt;&lt;DIV class=""&gt;87 input Information $150. ;&lt;/DIV&gt;&lt;DIV class=""&gt;88 if compress(upcase(information)) =: "*MODIFICATIONS:" then stop;&lt;/DIV&gt;&lt;DIV class=""&gt;89 output;&lt;/DIV&gt;&lt;DIV class=""&gt;90 run;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Physical file does not exist, /usr/local/biserver/Lev1/SASApp/erver.&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;&lt;DIV class=""&gt;WARNING: The data set WORK.HEADER_PAGE may be incomplete. When this step was stopped there were 0 observations and 1 variables.&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class=""&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV class=""&gt;user cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class=""&gt;system cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class=""&gt;memory 496.71k&lt;/DIV&gt;&lt;DIV class=""&gt;OS Memory 26784.00k&lt;/DIV&gt;&lt;DIV class=""&gt;Timestamp 08/30/2022 05:44:35 PM&lt;/DIV&gt;&lt;DIV class=""&gt;Step Count 18 Switch Count 2&lt;/DIV&gt;&lt;DIV class=""&gt;Page Faults 1&lt;/DIV&gt;&lt;DIV class=""&gt;Page Reclaims 122&lt;/DIV&gt;&lt;DIV class=""&gt;Page Swaps 0&lt;/DIV&gt;&lt;DIV class=""&gt;Voluntary Context Switches 12&lt;/DIV&gt;&lt;DIV class=""&gt;Involuntary Context Switches 0&lt;/DIV&gt;&lt;DIV class=""&gt;Block Input Operations 264&lt;/DIV&gt;&lt;DIV class=""&gt;Block Output Operations 16&lt;/DIV&gt;&lt;DIV class=""&gt;91&lt;/DIV&gt;&lt;DIV class=""&gt;92 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class=""&gt;105&lt;/DIV&gt;</description>
    <pubDate>Tue, 30 Aug 2022 22:13:18 GMT</pubDate>
    <dc:creator>CathyVI</dc:creator>
    <dc:date>2022-08-30T22:13:18Z</dc:date>
    <item>
      <title>PUTTING A HEADER PAGE ON EACH EXCEL FILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUTTING-A-HEADER-PAGE-ON-EACH-EXCEL-FILE/m-p/831165#M328441</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I found this code online and tried to replicate it but I keep getting an error. The code is used to create an header on each excel file. The error said the physical path does not exist but I am not sure of the path shown. Can someone direct me on how to make this works pls.&amp;nbsp; Below is the code and the error log.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class=""&gt;72&lt;/DIV&gt;&lt;DIV class=""&gt;73&lt;/DIV&gt;&lt;DIV class=""&gt;74 options nocenter msglevel=i ls=132 mprint;&lt;/DIV&gt;&lt;DIV class=""&gt;75&lt;/DIV&gt;&lt;DIV class=""&gt;76&lt;/DIV&gt;&lt;DIV class=""&gt;77 * WE ARE NOW PUTTING A HEADER PAGE ON EACH EXCEL FILE TO DOCUMENT THE PROGRAM SOURCE ;&lt;/DIV&gt;&lt;DIV class=""&gt;78 data header_page;&lt;/DIV&gt;&lt;DIV class=""&gt;79 length Information $ 150 ;&lt;/DIV&gt;&lt;DIV class=""&gt;80 if _n_=1 then do;&lt;/DIV&gt;&lt;DIV class=""&gt;81 Information = "RUN DATE: " || put(today(), yymmddd10.) || " at &amp;amp;systime" ; output;&lt;/DIV&gt;&lt;DIV class=""&gt;82 Information = "FILE NAME: " || "%substr(&amp;amp;SYSPROCESSNAME,9)"; output;&lt;/DIV&gt;&lt;DIV class=""&gt;83 Information = "RUN BY: " || "&amp;amp;sysuserid" ; output;&lt;/DIV&gt;&lt;DIV class=""&gt;84 Information = "*********************************************************" ; output;&lt;/DIV&gt;&lt;DIV class=""&gt;85 end;&lt;/DIV&gt;&lt;DIV class=""&gt;86 infile "%substr(&amp;amp;SYSPROCESSNAME,9)" truncover;&lt;/DIV&gt;&lt;DIV class=""&gt;87 input Information $150. ;&lt;/DIV&gt;&lt;DIV class=""&gt;88 if compress(upcase(information)) =: "*MODIFICATIONS:" then stop;&lt;/DIV&gt;&lt;DIV class=""&gt;89 output;&lt;/DIV&gt;&lt;DIV class=""&gt;90 run;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: Physical file does not exist, /usr/local/biserver/Lev1/SASApp/erver.&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;&lt;DIV class=""&gt;WARNING: The data set WORK.HEADER_PAGE may be incomplete. When this step was stopped there were 0 observations and 1 variables.&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class=""&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV class=""&gt;user cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class=""&gt;system cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class=""&gt;memory 496.71k&lt;/DIV&gt;&lt;DIV class=""&gt;OS Memory 26784.00k&lt;/DIV&gt;&lt;DIV class=""&gt;Timestamp 08/30/2022 05:44:35 PM&lt;/DIV&gt;&lt;DIV class=""&gt;Step Count 18 Switch Count 2&lt;/DIV&gt;&lt;DIV class=""&gt;Page Faults 1&lt;/DIV&gt;&lt;DIV class=""&gt;Page Reclaims 122&lt;/DIV&gt;&lt;DIV class=""&gt;Page Swaps 0&lt;/DIV&gt;&lt;DIV class=""&gt;Voluntary Context Switches 12&lt;/DIV&gt;&lt;DIV class=""&gt;Involuntary Context Switches 0&lt;/DIV&gt;&lt;DIV class=""&gt;Block Input Operations 264&lt;/DIV&gt;&lt;DIV class=""&gt;Block Output Operations 16&lt;/DIV&gt;&lt;DIV class=""&gt;91&lt;/DIV&gt;&lt;DIV class=""&gt;92 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class=""&gt;105&lt;/DIV&gt;</description>
      <pubDate>Tue, 30 Aug 2022 22:13:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUTTING-A-HEADER-PAGE-ON-EACH-EXCEL-FILE/m-p/831165#M328441</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2022-08-30T22:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: PUTTING A HEADER PAGE ON EACH EXCEL FILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUTTING-A-HEADER-PAGE-ON-EACH-EXCEL-FILE/m-p/831167#M328443</link>
      <description>&lt;P&gt;I think this line causes the problem&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile "%substr(&amp;amp;SYSPROCESSNAME,9)" truncover;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This resolves to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile "/usr/local/biserver/Lev1/SASApp/erver" truncover;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which is a file that does not exist. You need to specify a file that does exist. (Also, it's not clear to me why you are doing a %substr on this file name).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The usual advice is first to get this to work without macro variables and without macro functions, by hardcoding a particular file name. Show us that code without macro variables and without macro functions, that works.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 22:24:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUTTING-A-HEADER-PAGE-ON-EACH-EXCEL-FILE/m-p/831167#M328443</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-30T22:24:55Z</dc:date>
    </item>
  </channel>
</rss>

