<?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: f_ in crosstabs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/f-in-crosstabs/m-p/852512#M336985</link>
    <description>&lt;P&gt;If you require explicit F_ variables, you can use the PUT function to create them from the raw data and the formats for each variable. For example, the following program uses the 3.1 format for the variables A and B.&amp;nbsp; I use a DATA step view to create F_A and F_B that contain the formatted values:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* generate example data */
data Have;
format A B 3.1;
call streaminit(1234);
do i = 1 to 100;
   A = rand("Table", 0.3, 0.5, 0.2);
   B = rand("Table", 0.1, 0.2, 0.3, 0.4);
   output;
end;
run;

proc freq data=Have;
tables A*B / out=FreqOut;
ods output CrossTabFreqs=CTF;
run;

/* add variables that contains the formatted values */
data Want / view=Want;
set CTF;
F_A = put(A, 3.1);
F_B = put(B, 3.1);
run;

proc contents data=Want;
ods select Variables;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Jan 2023 15:27:25 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2023-01-06T15:27:25Z</dc:date>
    <item>
      <title>f_ in crosstabs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/f-in-crosstabs/m-p/852500#M336977</link>
      <description>&lt;P&gt;hey,&lt;/P&gt;&lt;P&gt;in onewayfreqs the ods output statement additionally creates this very useful variable named &lt;SPAN&gt;F_&amp;lt;nameoftablesvar&amp;gt; containing the formatted value, which is a copy of the displayed value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is there anything like this in crosstabfreqs?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 13:59:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/f-in-crosstabs/m-p/852500#M336977</guid>
      <dc:creator>drfzLee</dc:creator>
      <dc:date>2023-01-06T13:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: f_ in crosstabs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/f-in-crosstabs/m-p/852503#M336979</link>
      <description>&lt;P&gt;Did you look to see if it is in the output from CROSSTABFREQS?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 14:18:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/f-in-crosstabs/m-p/852503#M336979</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-01-06T14:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: f_ in crosstabs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/f-in-crosstabs/m-p/852506#M336980</link>
      <description>&lt;P&gt;This is not the case. With the onyewayfreqs it comes automatically. Since it obviously doesn't come automatically with the crosstabfreqs, I thought there was another option to enable or something. But I could not find anything that would help me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is a n&lt;SPAN&gt;ew variable that contains the formatted value of the original variable. I use the crosstabfreqs in a macro so the variables have different formats.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;In OneWayFreqs this was solved with the f_ variable.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is there another way to create a new variable that contains only the format of another variable? This might be a better question.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 14:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/f-in-crosstabs/m-p/852506#M336980</guid>
      <dc:creator>drfzLee</dc:creator>
      <dc:date>2023-01-06T14:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: f_ in crosstabs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/f-in-crosstabs/m-p/852512#M336985</link>
      <description>&lt;P&gt;If you require explicit F_ variables, you can use the PUT function to create them from the raw data and the formats for each variable. For example, the following program uses the 3.1 format for the variables A and B.&amp;nbsp; I use a DATA step view to create F_A and F_B that contain the formatted values:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* generate example data */
data Have;
format A B 3.1;
call streaminit(1234);
do i = 1 to 100;
   A = rand("Table", 0.3, 0.5, 0.2);
   B = rand("Table", 0.1, 0.2, 0.3, 0.4);
   output;
end;
run;

proc freq data=Have;
tables A*B / out=FreqOut;
ods output CrossTabFreqs=CTF;
run;

/* add variables that contains the formatted values */
data Want / view=Want;
set CTF;
F_A = put(A, 3.1);
F_B = put(B, 3.1);
run;

proc contents data=Want;
ods select Variables;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jan 2023 15:27:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/f-in-crosstabs/m-p/852512#M336985</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-01-06T15:27:25Z</dc:date>
    </item>
  </channel>
</rss>

