<?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: Downloading a pdf report via SAS VIYA jobs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/836224#M330653</link>
    <description>Yes, that's one way of doing it!&lt;BR /&gt;&lt;BR /&gt;We have a bunch of demo SAS web apps you can check out here: &lt;A href="https://github.com/search?q=topic%3Asasjs-app+org%3Asasjs+fork%3Atrue&amp;amp;type=repositories" target="_blank"&gt;https://github.com/search?q=topic%3Asasjs-app+org%3Asasjs+fork%3Atrue&amp;amp;type=repositories&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;There is also a support group:  &lt;A href="https://matrix.to/#/#sasjs:4gl.io" target="_blank"&gt;https://matrix.to/#/#sasjs:4gl.io&lt;/A&gt;</description>
    <pubDate>Fri, 30 Sep 2022 21:38:39 GMT</pubDate>
    <dc:creator>AllanBowe</dc:creator>
    <dc:date>2022-09-30T21:38:39Z</dc:date>
    <item>
      <title>Downloading a pdf report via SAS VIYA jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/815424#M321864</link>
      <description>&lt;P&gt;How do we make the file downloadable once the submit button is pressed at the client side?. I'm creating a job definition in SAS Viya 3.5 and want the client to download a pdf or any other file format. Kind of new of new to stored process as well as its equivalent Jobs in SAS VIYA. Not sure if I am reading the job execution web application doc correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=""&gt;filename f_pdf filesrvc parenturi="&amp;amp;SYS_JES_JOB_URI" 
  name='Class.pdf' 
  contenttype='application/pdf';
ods pdf file=f_pdf style=&amp;amp;_ODSSTYLE;&lt;BR /&gt;proc print data=xxxxx;&lt;BR /&gt;run;&lt;BR /&gt;ods pdf close;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The above code saves it but does not download into the downloads folder at the client site. How can we achieve that?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 15:31:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/815424#M321864</guid>
      <dc:creator>jins</dc:creator>
      <dc:date>2022-05-27T15:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading a pdf report via SAS VIYA jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/815638#M321925</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/84674"&gt;@jins&lt;/a&gt; - you were close!&amp;nbsp; Here are the things I changed to make your code work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&amp;nbsp;Changed the name to _webout.pdf - this is necessary for the result to stream&lt;/LI&gt;
&lt;LI&gt;Added the contentdisp attribute - this is necessary for the file to auto-download&lt;/LI&gt;
&lt;LI&gt;Removed the _odsstyle variable (not available in my 3.5 environment)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;And here is a functional program you can run in SAS Studio to reproduce (just open the link in the log at the end):&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* compile sasjs core macros */
filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
%inc mc;

/* set up the sas program */
filename ft15f001 temp lrecl=1000;
parmcards4;
	filename f_pdf filesrvc parenturi="&amp;amp;SYS_JES_JOB_URI" 
	  name='_webout.pdf' 
	  contenttype='application/pdf'
      contentdisp="attachment; filename=my.pdf";
	ods pdf file=f_pdf /*style=&amp;amp;_ODSSTYLE */;
	proc print data=sashelp.class;
	run;
	ods pdf close;
;;;;

/* create the job in SAS Drive */
%mx_createwebservice(path=/Public/app/demo,name=sendpdf)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;For reference there are a bunch of examples for streaming files from Viya (or SAS 9, or SASjs server) in this macro:&amp;nbsp;&amp;nbsp;&lt;A href="https://core.sasjs.io/mp__streamfile_8sas_source.html" target="_blank" rel="noopener"&gt;https://core.sasjs.io/mp__streamfile_8sas_source.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's no PDF option yet, but feel free to raise an issue or PR!&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 00:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/815638#M321925</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2022-05-30T00:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading a pdf report via SAS VIYA jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/815748#M321971</link>
      <description>&lt;P&gt;thanks for this.&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 23:43:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/815748#M321971</guid>
      <dc:creator>jins</dc:creator>
      <dc:date>2022-05-30T23:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading a pdf report via SAS VIYA jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/815825#M321993</link>
      <description>&lt;P&gt;I had one more question - if the report link has to be shared, where should one store the job definition and the associated data sets. Currently it is under&amp;nbsp; Users/Username... and this gives unable to read the Job definition error, if someone else tries to open it. This might be permission issue on my folder but where can this be moved to?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 13:42:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/815825#M321993</guid>
      <dc:creator>jins</dc:creator>
      <dc:date>2022-05-31T13:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading a pdf report via SAS VIYA jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/815841#M321998</link>
      <description>&lt;P&gt;That's really up to you and your site policies.&amp;nbsp; You can put it anywhere in SAS Drive you like, just set any relevant permissions.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 14:26:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/815841#M321998</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2022-05-31T14:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading a pdf report via SAS VIYA jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/836217#M330649</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/28909"&gt;@AllanBowe&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Trying to use this code as sample, what does this part of the code do:&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;filename ft15f001 temp lrecl=1000;
parmcards4;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 21:00:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/836217#M330649</guid>
      <dc:creator>jimbobob</dc:creator>
      <dc:date>2022-09-30T21:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading a pdf report via SAS VIYA jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/836219#M330650</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13255"&gt;@jimbobob&lt;/a&gt;&amp;nbsp;- great question!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The strange looking filename is a special destination that - when used in combination with the parmcards statement - allows you to write arbitrary content to a fileref (in a very similar way to cards / datalines to a data set)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We use it in SASjs as a convenient way to deploy multiple stored processes in a single SAS program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 21:14:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/836219#M330650</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2022-09-30T21:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading a pdf report via SAS VIYA jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/836220#M330651</link>
      <description>&lt;P&gt;Ok very interesting, thanks for update&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 21:20:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/836220#M330651</guid>
      <dc:creator>jimbobob</dc:creator>
      <dc:date>2022-09-30T21:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading a pdf report via SAS VIYA jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/836223#M330652</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/28909"&gt;@AllanBowe&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is fascinating, so you code creates a job, so now all i need to do is associate the created job to a form right?&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 21:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/836223#M330652</guid>
      <dc:creator>jimbobob</dc:creator>
      <dc:date>2022-09-30T21:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading a pdf report via SAS VIYA jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/836224#M330653</link>
      <description>Yes, that's one way of doing it!&lt;BR /&gt;&lt;BR /&gt;We have a bunch of demo SAS web apps you can check out here: &lt;A href="https://github.com/search?q=topic%3Asasjs-app+org%3Asasjs+fork%3Atrue&amp;amp;type=repositories" target="_blank"&gt;https://github.com/search?q=topic%3Asasjs-app+org%3Asasjs+fork%3Atrue&amp;amp;type=repositories&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;There is also a support group:  &lt;A href="https://matrix.to/#/#sasjs:4gl.io" target="_blank"&gt;https://matrix.to/#/#sasjs:4gl.io&lt;/A&gt;</description>
      <pubDate>Fri, 30 Sep 2022 21:38:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-a-pdf-report-via-SAS-VIYA-jobs/m-p/836224#M330653</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2022-09-30T21:38:39Z</dc:date>
    </item>
  </channel>
</rss>

