<?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 SASPy and the WORK.GSEG catalog in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SASPy-and-the-WORK-GSEG-catalog/m-p/919501#M362169</link>
    <description>&lt;P&gt;Hey Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble displaying only specific graphs when a back-end SAS program is ran using SASPy. For the sake of simplicity, I have the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;import&lt;/STRONG&gt;&lt;/FONT&gt; saspy
&lt;FONT color="#339966"&gt;&lt;STRONG&gt;import&lt;/STRONG&gt;&lt;/FONT&gt; os
&lt;FONT color="#339966"&gt;&lt;STRONG&gt;from&lt;/STRONG&gt;&lt;/FONT&gt; IPython.display &lt;FONT color="#339966"&gt;&lt;STRONG&gt;import&lt;/STRONG&gt;&lt;/FONT&gt; HTML

&lt;FONT color="#339966"&gt;### os.environ["PATH"] += INSERT PATH NAME IF NEEDED ###&lt;/FONT&gt;
sas = saspy.SASsession(cfgname="&lt;FONT color="#993300"&gt;winlocal&lt;/FONT&gt;")

sas.symput(&lt;FONT color="#993300"&gt;"SASPGRM"&lt;/FONT&gt;, &lt;FONT color="#993300"&gt;"[INSERT PATH NAME OF SAS FILE]"&lt;/FONT&gt;, quoting=&lt;FONT color="#008000"&gt;&lt;STRONG&gt;None&lt;/STRONG&gt;&lt;/FONT&gt;)
sas_submit_return_value = sas.submit(
   &lt;FONT color="#993300"&gt; """&lt;/FONT&gt;
    &lt;FONT color="#993300"&gt;%INCLUDE "&amp;amp;SASPGRM";&lt;/FONT&gt;
    &lt;FONT color="#993300"&gt;"""&lt;/FONT&gt;)

&lt;FONT color="#339966"&gt;### Sucessful when using Jupyter Notebook ###&lt;/FONT&gt;
HTML(sas_submit_return_value[&lt;FONT color="#993300"&gt;'LST'&lt;/FONT&gt;])&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where code for the SASPRM is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;&lt;FONT color="#3366FF"&gt;TITLE&lt;/FONT&gt; &lt;FONT color="#800080"&gt;"PLOT 1"&lt;/FONT&gt;;
&lt;FONT color="#000080"&gt;&lt;STRONG&gt;PROC SHEWHART&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#3366FF"&gt;DATA=&lt;/FONT&gt;SASHELP.CARS;
   &lt;FONT color="#3366FF"&gt; SYMBOL V=&lt;/FONT&gt;DOT;
    &lt;FONT color="#3366FF"&gt;IRCHART&lt;/FONT&gt; ENGINESIZE*MAKE / &lt;FONT color="#0000FF"&gt;OUTTABLE=&lt;/FONT&gt;CHRTVIOL1(WHERE=(_TESTS_ NE &lt;FONT color="#333399"&gt;''&lt;/FONT&gt;));
&lt;FONT color="#000080"&gt;&lt;STRONG&gt;RUN;
QUIT;&lt;/STRONG&gt;&lt;/FONT&gt;

&lt;FONT color="#3366FF"&gt;TITLE&lt;/FONT&gt; &lt;FONT color="#800080"&gt;"PLOT 2"&lt;/FONT&gt;;
&lt;STRONG&gt;&lt;FONT color="#000080"&gt;PROC SHEWHART&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#3366FF"&gt;DATA=&lt;/FONT&gt;SASHELP.CARS;
    &lt;FONT color="#3366FF"&gt;SYMBOL V=&lt;/FONT&gt;DOT;
    &lt;FONT color="#3366FF"&gt;IRCHART&lt;/FONT&gt; ENGINESIZE*MAKE / &lt;FONT color="#0000FF"&gt;OUTTABLE=&lt;/FONT&gt;CHRTVIOL2(WHERE=(_TESTS_ NE &lt;FONT color="#333399"&gt;''&lt;/FONT&gt;));
&lt;STRONG&gt;&lt;FONT color="#000080"&gt;RUN;
QUIT;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000080"&gt;&lt;FONT color="#3366FF"&gt;TITLE&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000080"&gt;&lt;FONT color="#800080"&gt;"PLOT 3"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000080"&gt;;&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080"&gt;PROC SHEWHART &lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000080"&gt;&lt;FONT color="#3366FF"&gt;DATA=&lt;FONT color="#000000"&gt;SASHELP.CARS;&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000080"&gt;&lt;FONT color="#3366FF"&gt;    SYMBOL V=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000080"&gt;&lt;FONT color="#000000"&gt;DOT;&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#000080"&gt;&lt;FONT color="#3366FF"&gt;    IRCHART&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt; ENGINESIZE*MAKE / &lt;FONT color="#0000FF"&gt;OUTTABLE=&lt;/FONT&gt;CHRTVIOL3(WHERE=(_TESTS_ NE &lt;FONT color="#333399"&gt;''&lt;/FONT&gt;));&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080"&gt;RUN;
QUIT;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Typically, when I want to only display specific graphs, I can use PROC GREPLAY and specify the graphs that are saved in a temp catalog in WORK.GSEG or really any permanent catalog defined in a GOUT statement. I've noticed that when running these procedures in my SAS Environment, the GSEG catalog is created in the same location as my WORK directory. However, when running the code in the submit block using SASPy, the catalog doesn't appear but the SAS datasets do appear. Note: The log states that the "Body file: _TOMODS1" was created in the work directory location. Even though this file is created, it is either deleted or invisible in the windows file explorer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question is, are there similar functions like GREPLAY in SASPy? I've tried using the GOUT option but the defined catalog isn't created like it does in my SAS Environment. I only want to create pdf files if the user wants them by selecting a custom button in my Python application.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do any of you have any insights or comments? Note: We're restricted from changing any back-end SAS programs so any solutions that requires changing the SAS Program itself would probably be a non-starter within my organization.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Mar 2024 17:33:48 GMT</pubDate>
    <dc:creator>mrmcdonald</dc:creator>
    <dc:date>2024-03-08T17:33:48Z</dc:date>
    <item>
      <title>SASPy and the WORK.GSEG catalog</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASPy-and-the-WORK-GSEG-catalog/m-p/919501#M362169</link>
      <description>&lt;P&gt;Hey Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble displaying only specific graphs when a back-end SAS program is ran using SASPy. For the sake of simplicity, I have the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;import&lt;/STRONG&gt;&lt;/FONT&gt; saspy
&lt;FONT color="#339966"&gt;&lt;STRONG&gt;import&lt;/STRONG&gt;&lt;/FONT&gt; os
&lt;FONT color="#339966"&gt;&lt;STRONG&gt;from&lt;/STRONG&gt;&lt;/FONT&gt; IPython.display &lt;FONT color="#339966"&gt;&lt;STRONG&gt;import&lt;/STRONG&gt;&lt;/FONT&gt; HTML

&lt;FONT color="#339966"&gt;### os.environ["PATH"] += INSERT PATH NAME IF NEEDED ###&lt;/FONT&gt;
sas = saspy.SASsession(cfgname="&lt;FONT color="#993300"&gt;winlocal&lt;/FONT&gt;")

sas.symput(&lt;FONT color="#993300"&gt;"SASPGRM"&lt;/FONT&gt;, &lt;FONT color="#993300"&gt;"[INSERT PATH NAME OF SAS FILE]"&lt;/FONT&gt;, quoting=&lt;FONT color="#008000"&gt;&lt;STRONG&gt;None&lt;/STRONG&gt;&lt;/FONT&gt;)
sas_submit_return_value = sas.submit(
   &lt;FONT color="#993300"&gt; """&lt;/FONT&gt;
    &lt;FONT color="#993300"&gt;%INCLUDE "&amp;amp;SASPGRM";&lt;/FONT&gt;
    &lt;FONT color="#993300"&gt;"""&lt;/FONT&gt;)

&lt;FONT color="#339966"&gt;### Sucessful when using Jupyter Notebook ###&lt;/FONT&gt;
HTML(sas_submit_return_value[&lt;FONT color="#993300"&gt;'LST'&lt;/FONT&gt;])&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where code for the SASPRM is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;&lt;FONT color="#3366FF"&gt;TITLE&lt;/FONT&gt; &lt;FONT color="#800080"&gt;"PLOT 1"&lt;/FONT&gt;;
&lt;FONT color="#000080"&gt;&lt;STRONG&gt;PROC SHEWHART&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#3366FF"&gt;DATA=&lt;/FONT&gt;SASHELP.CARS;
   &lt;FONT color="#3366FF"&gt; SYMBOL V=&lt;/FONT&gt;DOT;
    &lt;FONT color="#3366FF"&gt;IRCHART&lt;/FONT&gt; ENGINESIZE*MAKE / &lt;FONT color="#0000FF"&gt;OUTTABLE=&lt;/FONT&gt;CHRTVIOL1(WHERE=(_TESTS_ NE &lt;FONT color="#333399"&gt;''&lt;/FONT&gt;));
&lt;FONT color="#000080"&gt;&lt;STRONG&gt;RUN;
QUIT;&lt;/STRONG&gt;&lt;/FONT&gt;

&lt;FONT color="#3366FF"&gt;TITLE&lt;/FONT&gt; &lt;FONT color="#800080"&gt;"PLOT 2"&lt;/FONT&gt;;
&lt;STRONG&gt;&lt;FONT color="#000080"&gt;PROC SHEWHART&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#3366FF"&gt;DATA=&lt;/FONT&gt;SASHELP.CARS;
    &lt;FONT color="#3366FF"&gt;SYMBOL V=&lt;/FONT&gt;DOT;
    &lt;FONT color="#3366FF"&gt;IRCHART&lt;/FONT&gt; ENGINESIZE*MAKE / &lt;FONT color="#0000FF"&gt;OUTTABLE=&lt;/FONT&gt;CHRTVIOL2(WHERE=(_TESTS_ NE &lt;FONT color="#333399"&gt;''&lt;/FONT&gt;));
&lt;STRONG&gt;&lt;FONT color="#000080"&gt;RUN;
QUIT;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000080"&gt;&lt;FONT color="#3366FF"&gt;TITLE&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000080"&gt;&lt;FONT color="#800080"&gt;"PLOT 3"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000080"&gt;;&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080"&gt;PROC SHEWHART &lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000080"&gt;&lt;FONT color="#3366FF"&gt;DATA=&lt;FONT color="#000000"&gt;SASHELP.CARS;&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000080"&gt;&lt;FONT color="#3366FF"&gt;    SYMBOL V=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000080"&gt;&lt;FONT color="#000000"&gt;DOT;&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#000080"&gt;&lt;FONT color="#3366FF"&gt;    IRCHART&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt; ENGINESIZE*MAKE / &lt;FONT color="#0000FF"&gt;OUTTABLE=&lt;/FONT&gt;CHRTVIOL3(WHERE=(_TESTS_ NE &lt;FONT color="#333399"&gt;''&lt;/FONT&gt;));&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080"&gt;RUN;
QUIT;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Typically, when I want to only display specific graphs, I can use PROC GREPLAY and specify the graphs that are saved in a temp catalog in WORK.GSEG or really any permanent catalog defined in a GOUT statement. I've noticed that when running these procedures in my SAS Environment, the GSEG catalog is created in the same location as my WORK directory. However, when running the code in the submit block using SASPy, the catalog doesn't appear but the SAS datasets do appear. Note: The log states that the "Body file: _TOMODS1" was created in the work directory location. Even though this file is created, it is either deleted or invisible in the windows file explorer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question is, are there similar functions like GREPLAY in SASPy? I've tried using the GOUT option but the defined catalog isn't created like it does in my SAS Environment. I only want to create pdf files if the user wants them by selecting a custom button in my Python application.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do any of you have any insights or comments? Note: We're restricted from changing any back-end SAS programs so any solutions that requires changing the SAS Program itself would probably be a non-starter within my organization.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 17:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASPy-and-the-WORK-GSEG-catalog/m-p/919501#M362169</guid>
      <dc:creator>mrmcdonald</dc:creator>
      <dc:date>2024-03-08T17:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: SASPy and the WORK.GSEG catalog</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASPy-and-the-WORK-GSEG-catalog/m-p/919516#M362182</link>
      <description>&lt;P&gt;If you add "ods graphics on;" to your program, will you get the outputs you want? That should trigger ODS graphics instead of traditional GRSEG output. I don't know if the graphics produced will have parity/appearance that you want.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 18:24:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASPy-and-the-WORK-GSEG-catalog/m-p/919516#M362182</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2024-03-08T18:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: SASPy and the WORK.GSEG catalog</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASPy-and-the-WORK-GSEG-catalog/m-p/919523#M362183</link>
      <description>&lt;P&gt;For my use case, I would imagine having ODS turned on would trigger output for everything in the %INCLUDE statement. I was wondering if I could be more selective if the user only wants to see a graph. For example, if I had both PROC UNIVARIATE with the default output and a histogram and PROC SHEWHART with an I&amp;amp;MR chart in my back-end SAS program and I wanted to only show the histogram (not the output or the PROC SHEWHART chart) to the user as a pdf. The user would select the "HISTOGRAM" button and a SUBMIT CONTINUE clause with PROC GREPLAY would run in the original SAS/AF application. The SAS/AF application pulls the graph objects (or files, I don't know) in the WORK.GSEG catalog enabling this feature in our application to run seamlessly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 18:57:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASPy-and-the-WORK-GSEG-catalog/m-p/919523#M362183</guid>
      <dc:creator>mrmcdonald</dc:creator>
      <dc:date>2024-03-08T18:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: SASPy and the WORK.GSEG catalog</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASPy-and-the-WORK-GSEG-catalog/m-p/919531#M362185</link>
      <description>&lt;P&gt;The approach to adopt a similar goal using ODS graphics: you would use ODS SELECT to tell SAS which pieces of output you want to keep. Use ODS TRACE to see the SAS-names for each of the outputs generated, then use ODS SELECT to say which you would like and then rerun. Or you can also use PROC DOCUMENT to "replay" just the parts you want from an already generated set of work.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Several &lt;A href="https://blogs.sas.com/content/tag/proc-document/" target="_self"&gt;blog posts here to help you get started&lt;/A&gt;.&amp;nbsp; &lt;A href="https://communities.sas.com/t5/Graphics-Programming/How-to-use-ODS-LAYOUT-GRIDDED-with-ODS-DOCUMENT/td-p/884714" target="_self"&gt;This community post&lt;/A&gt; also shows an example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 19:12:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASPy-and-the-WORK-GSEG-catalog/m-p/919531#M362185</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2024-03-08T19:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: SASPy and the WORK.GSEG catalog</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASPy-and-the-WORK-GSEG-catalog/m-p/922267#M363180</link>
      <description>&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry, it's been a few weeks. I've been studying more up on PROC DOCUMENT and see how powerful this procedure really is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using PROC DOCUMENT to save a catalog of the items that were already generated. However, I'm getting output that's close but not exact. For example, the &lt;FONT color="#3366FF"&gt;SYMBOL V=&lt;/FONT&gt;DOT option in &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;PROC SHEWHART &lt;/STRONG&gt;&lt;FONT color="#000000"&gt;from the code above doesn't seem to work the same way it does in the SAS environment. I'm able to get the basic components of the graph but not this additional option. Similarly, the defaults seem to display the subgroup indices (x-axis) vertically while the PROC DOCUMENT REPLAY displays the indices (x-axis) horizontally.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 14:05:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASPy-and-the-WORK-GSEG-catalog/m-p/922267#M363180</guid>
      <dc:creator>mrmcdonald</dc:creator>
      <dc:date>2024-03-29T14:05:20Z</dc:date>
    </item>
  </channel>
</rss>

