<?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: SAS MAINFRAME in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-MAINFRAME/m-p/512612#M21978</link>
    <description>&lt;P&gt;As you have seen, PROC SQL produces a SAS data set as its output.&amp;nbsp; There is no simple lever you can flip to make it output a text file instead.&amp;nbsp; You need some sort of tool that takes a SAS data set and converts it to a text file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;has shown you one of the ways this can be done.&amp;nbsp; That's the safer way, but requires a fair amount of programming.&amp;nbsp; You can also take a look a PROC EXPORT.&amp;nbsp; It takes less work, but might force SAS to make some decisions about what the output should look like.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Nov 2018 16:04:21 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-11-13T16:04:21Z</dc:date>
    <item>
      <title>SAS MAINFRAME</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-MAINFRAME/m-p/512505#M21976</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I am executing a sql query in JCL, using sas, which is running fine, but I want the output in a readable format in a dataset, so that i can extract in CSV format. I am using below JCL&lt;BR /&gt;//$SAS9 EXEC SAS,SCL='*',&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONFIG='KLM.XYZ.LIB(SASCV2P)',WORK='500,500',&amp;nbsp;&lt;BR /&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OPTIONS='MACRO,NOCENTRE'&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;//SAVE01&amp;nbsp;&amp;nbsp; DD DSN=ABC.DEF.GHI,DISP=OLD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;//SASLOG&amp;nbsp;&amp;nbsp; DD SYSOUT=*&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;//SASLIST&amp;nbsp; DD SYSOUT=*&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;//SYSPRINT DD SYSOUT=*&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;//SYSIN&amp;nbsp;&amp;nbsp;&amp;nbsp; DD&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;&amp;nbsp;&lt;BR /&gt;proc sql;&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;&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;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; connect to db2 (SSID = DB2Y);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; create table SAVE01.ABC as&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; select * from connection to db2 (&lt;BR /&gt;&amp;nbsp;SELECT&lt;BR /&gt;&amp;nbsp;------------&lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %put sqlXRC = &amp;amp;sqlXRC.;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %put sqlXMSG = &amp;amp;sqlXMSG.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; disconnect from db2;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;quit;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;endsas;&lt;BR /&gt;&lt;BR /&gt;The output is getting generated in ABC.DEF.GHI and i can read it with TSO SAS. However&amp;nbsp;if&amp;nbsp;I check the same dataset&amp;nbsp;in 3.4, the content is not in simple readable text format. How can i store it in readable text format and so that I can&amp;nbsp;send the output as an attachment in CSV format.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 10:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-MAINFRAME/m-p/512505#M21976</guid>
      <dc:creator>Paul2018</dc:creator>
      <dc:date>2018-11-13T10:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS MAINFRAME</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-MAINFRAME/m-p/512530#M21977</link>
      <description>&lt;P&gt;Have a DSN for a text file for SAVE01.&lt;/P&gt;
&lt;P&gt;In the code, do this;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;                           
   connect to db2 (SSID = DB2Y);
   create table WORK.ABC as
   select * from connection to db2 (
 SELECT
 ------------
   );
   %put sqlXRC = &amp;amp;sqlXRC.;
   %put sqlXMSG = &amp;amp;sqlXMSG.;
   disconnect from db2;
quit;
data _null_;
set WORK.ABC;
file SAVE01;
put
/* insert the necessary variables and formats here */
;
run;       &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Nov 2018 13:27:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-MAINFRAME/m-p/512530#M21977</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-13T13:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAS MAINFRAME</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-MAINFRAME/m-p/512612#M21978</link>
      <description>&lt;P&gt;As you have seen, PROC SQL produces a SAS data set as its output.&amp;nbsp; There is no simple lever you can flip to make it output a text file instead.&amp;nbsp; You need some sort of tool that takes a SAS data set and converts it to a text file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;has shown you one of the ways this can be done.&amp;nbsp; That's the safer way, but requires a fair amount of programming.&amp;nbsp; You can also take a look a PROC EXPORT.&amp;nbsp; It takes less work, but might force SAS to make some decisions about what the output should look like.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 16:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-MAINFRAME/m-p/512612#M21978</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-11-13T16:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS MAINFRAME</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-MAINFRAME/m-p/512891#M21979</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;nad &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;for your valubale reply. Actually the sad part is I am not much into SAS, or I should say I am still a beginner, my core competancies are in Mainframe. My actual requirement is we receive different SQL queries from different team, which we run in&amp;nbsp;SPUFI &amp;gt; save the result in a dataset &amp;gt; exteact it in local machine &amp;gt; format in excel and then send. So to save all these time I was thinking about to automate this in a single JCL if possible, where we will paste the SQL query and submit,&amp;nbsp;after execution it will automatically sent an email to the recipients with&amp;nbsp;the report as an attachment.&amp;nbsp;I have been trying other possibilites as well, like with an IBM program DSNTEP2, which is running fine and I am getting the required output in .txt format as well; however if there are too may fileds in the query the output goes to the next line (coz DSNTEP2 has some fixed record Length), which I really dont want. Then someone said to go with SAS, ODS Listing&amp;nbsp;etc,&amp;nbsp;so I tried to give it a shot. If i understood &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562" target="_blank"&gt;@KurtBremser&lt;/A&gt;&amp;nbsp;correctly, I can define variables but the&amp;nbsp;thing is&amp;nbsp;we receive different kind of SQL queries everytime, but sure i will give it a try.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 10:24:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-MAINFRAME/m-p/512891#M21979</guid>
      <dc:creator>Paul2018</dc:creator>
      <dc:date>2018-11-14T10:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS MAINFRAME</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-MAINFRAME/m-p/512895#M21980</link>
      <description>&lt;P&gt;If Excel is your final target, and you want your code to be as flexible as possible, I recommend to use proc export as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt; already suggested:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;                           
   connect to db2 (SSID = DB2Y);
   create table WORK.ABC as
   select * from connection to db2 (
 SELECT
 ------------
   );
   %put sqlXRC = &amp;amp;sqlXRC.;
   %put sqlXMSG = &amp;amp;sqlXMSG.;
   disconnect from db2;
quit;
proc export
  data=WORK.ABC
  outfile=SAVE01
  dbms=csv
  replace
;
run;       &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You might even be able to use an Excel destination as dbms, but csv is provided in Base SAS without additional licenses.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 10:33:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SAS-MAINFRAME/m-p/512895#M21980</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-14T10:33:07Z</dc:date>
    </item>
  </channel>
</rss>

