<?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: format variable with same value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/format-variable-with-same-value/m-p/932709#M366906</link>
    <description>&lt;P&gt;yes, please Paige Miller&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2024 17:38:12 GMT</pubDate>
    <dc:creator>urban58</dc:creator>
    <dc:date>2024-06-17T17:38:12Z</dc:date>
    <item>
      <title>format variable with same value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-variable-with-same-value/m-p/932703#M366903</link>
      <description>&lt;P&gt;Hello SAS community,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset with a variable number_images with values 1 or 2 which indicate whether an image was read for a bunch of variable (n=110) at T0 or/and T2&lt;/P&gt;
&lt;P&gt;this is what I get from proc freq&lt;BR /&gt;number_images nmissT0 nmissT2 &lt;BR /&gt;1 0 110 &lt;BR /&gt;1 1 110 &lt;BR /&gt;1 2 110 &lt;BR /&gt;1 3 110 &lt;BR /&gt;1 4 110 &lt;BR /&gt;1 5 110 &lt;BR /&gt;1 6 110 &lt;BR /&gt;1 7 110 &lt;BR /&gt;1 8 110 &lt;BR /&gt;1 9 110 &lt;BR /&gt;1 10 110 &lt;BR /&gt;1 12 110 &lt;BR /&gt;1 14 110 &lt;BR /&gt;1 15 110 &lt;BR /&gt;1 18 110 &lt;BR /&gt;1 31 110 &lt;BR /&gt;1 93 110 &lt;BR /&gt;1 110 0 &lt;BR /&gt;1 110 1 &lt;BR /&gt;1 110 2 &lt;BR /&gt;1 110 6 &lt;BR /&gt;1 110 10 &lt;BR /&gt;1 110 12 &lt;BR /&gt;1 110 13 &lt;BR /&gt;1 110 14 &lt;BR /&gt;2 0 0&lt;/P&gt;
&lt;P&gt;If number_images=1, the image could have been read at either of the timepoints.&lt;BR /&gt;I want to keep number_images =1 but be able to distinguish those with readings at T1 or T2 only&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;if nmissT0=110 then the images was only read at T2&lt;BR /&gt;if nmissT2=110 then the images was only read at T0&lt;BR /&gt;if nmiss is &amp;lt;110, then the image was read at least for some features at one timepoint- not concerned with that part for this question&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to update number_images to have something like this but I know this won't work&lt;BR /&gt;proc format;&lt;BR /&gt;value n_imagf&lt;BR /&gt;1="1: V0 readings only"&lt;BR /&gt;1="1: V2 readings only"&lt;BR /&gt;2="2: V0, V2 readings"&lt;/P&gt;
&lt;P&gt;What can I do instead so number of images still shows 1 and is numeric?&lt;BR /&gt;if number_images=1 and nmissT0=110 then number_images=1??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Maggie&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 17:10:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-variable-with-same-value/m-p/932703#M366903</guid>
      <dc:creator>urban58</dc:creator>
      <dc:date>2024-06-17T17:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: format variable with same value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-variable-with-same-value/m-p/932707#M366904</link>
      <description>&lt;P&gt;If I am understanding everything properly, you need to create a new variable that indicates&amp;nbsp;&lt;SPAN&gt;"1: V0 readings only" or&amp;nbsp;"1: V2 readings only" or&amp;nbsp;"2: V0, V2 readings", and then format that new variable.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 17:34:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-variable-with-same-value/m-p/932707#M366904</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-06-17T17:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: format variable with same value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-variable-with-same-value/m-p/932708#M366905</link>
      <description>&lt;P&gt;Can you provide an example of your data in a data step and what you want from that example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am afraid that the output you show doesn't look at all like any normal Proc Freq output (it doesn't normally have any NMISS) so I can't interpret what that might be.&lt;/P&gt;
&lt;P&gt;Or at least show the proc freq code that supposedly generated it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I strongly suspect this is going to take an example of the data and some manipulation PRIOR to proc freq to accomplish.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 17:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-variable-with-same-value/m-p/932708#M366905</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-06-17T17:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: format variable with same value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-variable-with-same-value/m-p/932709#M366906</link>
      <description>&lt;P&gt;yes, please Paige Miller&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 17:38:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-variable-with-same-value/m-p/932709#M366906</guid>
      <dc:creator>urban58</dc:creator>
      <dc:date>2024-06-17T17:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: format variable with same value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-variable-with-same-value/m-p/932714#M366908</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;if nmissT0=110 then the images was only read at T2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if nmissT2=110 then the images was only read at T0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if nmiss is &amp;lt;110, then the image was read at least for some features at one timepoint- not concerned with that part for this question&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if nmissT0=110 then category=1;
else if nmissT2=110 then category=2;
else category=3;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and then&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
     value catf 1='V0 readings only'&amp;nbsp;...&amp;nbsp;
    ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 18:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-variable-with-same-value/m-p/932714#M366908</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-06-17T18:16:25Z</dc:date>
    </item>
  </channel>
</rss>

