<?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: ODS Writing Interface - Return or copy the format that is associated with the specified variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ODS-Writing-Interface-Return-or-copy-the-format-that-is/m-p/571858#M161340</link>
    <description>You still need to use PUTC(), it won't work with the format otherwise.</description>
    <pubDate>Mon, 08 Jul 2019 16:31:14 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-07-08T16:31:14Z</dc:date>
    <item>
      <title>ODS Writing Interface - Return or copy the format that is associated with the specified variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Writing-Interface-Return-or-copy-the-format-that-is/m-p/571845#M161336</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using the ODS Writing Interface to dynamically generate reports. The dataset (wide format) that I'm referencing has the correct format specified for each column. However, when using format_cell, the format doesn't appear to be attached to the variable specified.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a workaround, I've used the PUT function to return the string with the specified format. It works if I hard code the format but I would like to dynamically pull the format from the variable I'm referencing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;This works:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;obj.format_cell(data: PUT(VAR1, &lt;FONT color="#0000FF"&gt;&lt;EM&gt;dollar10.2&lt;/EM&gt;&lt;/FONT&gt;)) ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I would like instead:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;obj.format_cell(data: PUT(VAR1, &lt;FONT color="#0000FF"&gt;&lt;EM&gt;%SYSFUNC(VFORMAT(VAR1))&lt;/EM&gt;&lt;/FONT&gt;));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i.e.&amp;nbsp;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;%SYSFUNC(VFORMAT(VAR1))&lt;/FONT&gt;&lt;/EM&gt; should equal&amp;nbsp;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;dollar10.2&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Result:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: The function VFORMAT referenced by %SYSFUNC, %QSYSFUNC, or %SYSCALL cannot be used within the MACRO function/call-routine interfaces.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any thoughts on a fix? Similarly, I would like to replace VAR1 with an array element V(1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 16:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Writing-Interface-Return-or-copy-the-format-that-is/m-p/571845#M161336</guid>
      <dc:creator>Brian</dc:creator>
      <dc:date>2019-07-08T16:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Writing Interface - Return or copy the format that is associated with the specified variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Writing-Interface-Return-or-copy-the-format-that-is/m-p/571850#M161337</link>
      <description>PUT()/PUTC() will take a variable as the second parameter.</description>
      <pubDate>Mon, 08 Jul 2019 16:17:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Writing-Interface-Return-or-copy-the-format-that-is/m-p/571850#M161337</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-08T16:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Writing Interface - Return or copy the format that is associated with the specified variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Writing-Interface-Return-or-copy-the-format-that-is/m-p/571851#M161338</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/127"&gt;@Brian&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using the ODS Writing Interface to dynamically generate reports. The dataset (wide format) that I'm referencing has the correct format specified for each column. However, when using format_cell, the format doesn't appear to be attached to the variable specified.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a workaround, I've used the PUT function to return the string with the specified format. It works if I hard code the format but I would like to dynamically pull the format from the variable I'm referencing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;This works:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;obj.format_cell(data: PUT(VAR1, &lt;FONT color="#0000ff"&gt;&lt;EM&gt;dollar10.2&lt;/EM&gt;&lt;/FONT&gt;)) ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I would like instead:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;obj.format_cell(data: PUT(VAR1, &lt;FONT color="#0000ff"&gt;&lt;EM&gt;%SYSFUNC(VFORMAT(VAR1))&lt;/EM&gt;&lt;/FONT&gt;));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i.e.&amp;nbsp;&lt;EM&gt;&lt;FONT color="#0000ff"&gt;%SYSFUNC(VFORMAT(VAR1))&lt;/FONT&gt;&lt;/EM&gt; should equal&amp;nbsp;&lt;EM&gt;&lt;FONT color="#0000ff"&gt;dollar10.2&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Result:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;ERROR: The function VFORMAT referenced by %SYSFUNC, %QSYSFUNC, or %SYSCALL cannot be used within the MACRO function/call-routine interfaces.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any thoughts on a fix? Similarly, I would like to replace VAR1 with an array element V(1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;SYSFUNC is to allow you to call data step functions in a macro. Since the RWI is part of a data step then there is no need to use SYSFUNC at all.&lt;/P&gt;
&lt;P&gt;You will need to pay attention to how you pass the variable to VFORMAT which will not take an expression, requiring either the literal variable name or an array reference to variable so VFORMAT(V[1]) should work just fine assuming you have properly defined your array V.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 16:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Writing-Interface-Return-or-copy-the-format-that-is/m-p/571851#M161338</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-08T16:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Writing Interface - Return or copy the format that is associated with the specified variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Writing-Interface-Return-or-copy-the-format-that-is/m-p/571857#M161339</link>
      <description>&lt;P&gt;When I remove %SYSFUNC, I receive the following:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR 85-322: Expecting a format name.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hoped to use %SYSFUNC to resolve the format name first.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 16:29:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Writing-Interface-Return-or-copy-the-format-that-is/m-p/571857#M161339</guid>
      <dc:creator>Brian</dc:creator>
      <dc:date>2019-07-08T16:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Writing Interface - Return or copy the format that is associated with the specified variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Writing-Interface-Return-or-copy-the-format-that-is/m-p/571858#M161340</link>
      <description>You still need to use PUTC(), it won't work with the format otherwise.</description>
      <pubDate>Mon, 08 Jul 2019 16:31:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Writing-Interface-Return-or-copy-the-format-that-is/m-p/571858#M161340</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-08T16:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Writing Interface - Return or copy the format that is associated with the specified variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Writing-Interface-Return-or-copy-the-format-that-is/m-p/571859#M161341</link>
      <description>&lt;P&gt;Thank you everyone for your help. Have a great day!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 16:41:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Writing-Interface-Return-or-copy-the-format-that-is/m-p/571859#M161341</guid>
      <dc:creator>Brian</dc:creator>
      <dc:date>2019-07-08T16:41:23Z</dc:date>
    </item>
  </channel>
</rss>

