<?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: How to create the set of values in the column base? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-set-of-values-in-the-column-base/m-p/669182#M200707</link>
    <description>If you only need it once, I would suggest a temporary array instead. You can load the values for the array from a data set or dynamically.</description>
    <pubDate>Tue, 14 Jul 2020 14:56:49 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-07-14T14:56:49Z</dc:date>
    <item>
      <title>How to create the set of values in the column base?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-set-of-values-in-the-column-base/m-p/668973#M200615</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set that I want to loop based on the column base.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only have the ID column along with other covariates. Here is the output that I want to have.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I want to create the column, names as Index_n3, Index_n2.9, ......, Index_2.9, Index_3.0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The index column is ranged from -3 to 3 by 0.1 or 0.01. For example for the column Index_n3, I want to have -3 in each observation for the whole observation and second column (Index_n2.9&amp;nbsp; with -2.9 for the whole observations, up to the range 3.0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I kind of know how to create the value in the row basis (with do index = -3 to 3 by 0.01), but not sure for the column basis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate any help I can get for this problem. Thank you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8&lt;/TD&gt;&lt;TD&gt;………&lt;/TD&gt;&lt;TD&gt;2.8&lt;/TD&gt;&lt;TD&gt;2.9&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;-3&lt;/TD&gt;&lt;TD&gt;-2.9&lt;/TD&gt;&lt;TD&gt;-2.8&lt;/TD&gt;&lt;TD&gt;………&lt;/TD&gt;&lt;TD&gt;2.8&lt;/TD&gt;&lt;TD&gt;2.9&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 13 Jul 2020 21:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-set-of-values-in-the-column-base/m-p/668973#M200615</guid>
      <dc:creator>jystat</dc:creator>
      <dc:date>2020-07-13T21:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the set of values in the column base?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-set-of-values-in-the-column-base/m-p/668977#M200618</link>
      <description>This is either an array or a data step with a transpose. I'm leaning towards the latter but can you explain a bit what you're trying to do here? There may be an easier way to accomplish what you need.</description>
      <pubDate>Mon, 13 Jul 2020 21:18:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-set-of-values-in-the-column-base/m-p/668977#M200618</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-13T21:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the set of values in the column base?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-set-of-values-in-the-column-base/m-p/668989#M200624</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This index value where the range of -3 to 3 by the step size 0.1 or 0.01, is to find the optimal value in this range. The optimal value is where the value gives the maximum value of Youden index from my new model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I was searching an array too, but was not clear how to apply for my data. And I was thinking a transpose too, but if I use it, then all of my covariates variables also need to transpose as well.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 21:45:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-set-of-values-in-the-column-base/m-p/668989#M200624</guid>
      <dc:creator>jystat</dc:creator>
      <dc:date>2020-07-13T21:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the set of values in the column base?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-set-of-values-in-the-column-base/m-p/668990#M200625</link>
      <description>&lt;P&gt;SAS variables names typically do not contain . The "." character would separate a library name from a data set name so "index_2.8" would normally reference a library named index_2 (legal) and a data set 8 (illegal), or in some places a datset/variable pair with 8 being an illegal variable name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The headaches involved with setting options to use, and repeatedly typing the acceptable "index_2.8"n construct are often not worth the headaches. If you want a fancy value displayed to indicate what the variable has then assign a label. For many purposes it is MUCH more flexible to have the values, such as 2.8, 2.9, 3.0 stored in another variable. Then much of the code that works will extend when you have values of 3.1, 3.2, 3.3. When you have the values coded into variables then your code has to be rewritten to use additional&amp;nbsp; variable names (and possibly dropping others). And if the values are all constants as shown the "why" of extra variables becomes very much a question.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 21:49:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-set-of-values-in-the-column-base/m-p/668990#M200625</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-13T21:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the set of values in the column base?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-set-of-values-in-the-column-base/m-p/669102#M200680</link>
      <description>&lt;P&gt;First of all, you CANNOT have two columns with the exact same name:&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;Index_n2.9&lt;/TD&gt;
&lt;TD&gt;Index_n2.9&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next, to get rid of any ambiguities and be clear, &lt;U&gt;&lt;EM&gt;always&lt;/EM&gt;&lt;/U&gt; post your example data in a data step with datalines that we can run to recreate your dataset as is.&lt;/P&gt;
&lt;P&gt;By testing that data step, you can pick up any typos you mistakenly made.&lt;/P&gt;
&lt;P&gt;It is also &lt;STRONG&gt;STRONGLY&lt;/STRONG&gt; recommended to not work with non-valid SAS names by using name literals. That makes coding unnecessarily hard and error-prone.&lt;/P&gt;
&lt;P&gt;"If it's stupid and it works, it's still stupid, and you're lucky."&lt;/P&gt;
&lt;P&gt;(Maxim 43 of the &lt;A href="https://schlockmercenary.fandom.com/wiki/The_Seventy_Maxims_of_Maximally_Effective_Mercenaries" target="_blank" rel="noopener"&gt;70 Maxims of Maximally Effective Mercenaries&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 06:59:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-set-of-values-in-the-column-base/m-p/669102#M200680</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-07-14T06:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the set of values in the column base?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-set-of-values-in-the-column-base/m-p/669182#M200707</link>
      <description>If you only need it once, I would suggest a temporary array instead. You can load the values for the array from a data set or dynamically.</description>
      <pubDate>Tue, 14 Jul 2020 14:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-set-of-values-in-the-column-base/m-p/669182#M200707</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-14T14:56:49Z</dc:date>
    </item>
  </channel>
</rss>

