<?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: Stringing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564254#M158251</link>
    <description>Hi:&lt;BR /&gt;Without data, nobody can run your code. However, it seems to me that you might only need a LABEL statement, not array processing.&lt;BR /&gt;Cynthia</description>
    <pubDate>Thu, 06 Jun 2019 18:37:09 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2019-06-06T18:37:09Z</dc:date>
    <item>
      <title>Stringing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564214#M158236</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to string 11 stress variables in this order&lt;/P&gt;&lt;P&gt;Role Overload (RO)&lt;/P&gt;&lt;P&gt;Role Insufficiency (RI)&lt;/P&gt;&lt;P&gt;Role Ambiguity (RA)&lt;/P&gt;&lt;P&gt;Role Boundary (RB)&lt;/P&gt;&lt;P&gt;Responsibility (R)&lt;/P&gt;&lt;P&gt;Physical Environment (PE)&lt;/P&gt;&lt;P&gt;Vocational Strain (VS)&lt;/P&gt;&lt;P&gt;Psychological Strain (PSY)&lt;/P&gt;&lt;P&gt;Physical Strain (PHS)&lt;/P&gt;&lt;P&gt;Recreation (RE)&lt;/P&gt;&lt;P&gt;Rational/Cognitive Coping (RC)&lt;/P&gt;&lt;P&gt;Below is my code, it could not run. Here's a shot of my data&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="data1.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30077i5200CDCDCDA4D476/image-size/large?v=v2&amp;amp;px=999" role="button" title="data1.JPG" alt="data1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;code;&lt;/P&gt;&lt;P&gt;Proc format ;&lt;BR /&gt;value testcodefm&lt;BR /&gt;1='Gend'&lt;BR /&gt;2='BMI'&lt;BR /&gt;3='Age'&lt;BR /&gt;4='Role Overload (RO)'&lt;BR /&gt;5='Role Insufficiency (RI)'&lt;BR /&gt;6='Role Ambiguity (RA) '&lt;BR /&gt;7='Role Boundary (RB) '&lt;BR /&gt;8='Responsibility (R) '&lt;BR /&gt;9='Physical Environment (PE)'&lt;BR /&gt;10='Vocational Strain (VS)'&lt;BR /&gt;11='Psychological Strain (PSY) '&lt;BR /&gt;12='Physical Strain (PHS) '&lt;BR /&gt;13='Recreation (RE)'&lt;BR /&gt;14='Rational/Cognitive Coping (RC)'&lt;BR /&gt;15='strescor'&lt;BR /&gt;16='cursmoke'&lt;BR /&gt;17='exsmoke'&lt;BR /&gt;18='primstnd'&lt;BR /&gt;19='injury'&lt;BR /&gt;20='Id'&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;data two; set one;&lt;BR /&gt;array ya gend bmi age stress1 stress2 stress3 stress4 stress5 stress6 stress7 stress8 stress9 stress10 stress11 strescor cursmoke exsmoke primstnd lia injury id ;&lt;BR /&gt;do over ya ;&lt;BR /&gt;tc = _I_ ;&lt;BR /&gt;tn = put(tc,testcodefm.) ;&lt;BR /&gt;value = ya;&lt;BR /&gt;output; end;&lt;BR /&gt;proc print data =two (obs=10) ;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 17:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564214#M158236</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-06-06T17:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Stringing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564254#M158251</link>
      <description>Hi:&lt;BR /&gt;Without data, nobody can run your code. However, it seems to me that you might only need a LABEL statement, not array processing.&lt;BR /&gt;Cynthia</description>
      <pubDate>Thu, 06 Jun 2019 18:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564254#M158251</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-06-06T18:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Stringing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564265#M158256</link>
      <description>&lt;P&gt;What does the desired OUTPUT look like?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 19:06:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564265#M158256</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-06T19:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Stringing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564271#M158258</link>
      <description>&lt;P&gt;Thanks Cynthia,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a datastep to create a dataset one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data one;&lt;BR /&gt;input GEND BMI AGE STRESS1 STRESS2 STRESS3 STRESS4 STRESS5 STRESS6 STRESS7 STRESS8 STRESS9 STRESS10 STRESS11 STRESCOR cursmoke exsmoke primstnd Lia injury iD;&lt;BR /&gt;datalines;&lt;BR /&gt;0 25.8272 56 2 4 3 2 1 2 2 2 3 2 2 32 1 0 0 1.93 0 905&lt;BR /&gt;0 22.3154 24 2 4 3 2 2 3 2 4 4 2 2 37 1 0 1 0.10 0 906&lt;BR /&gt;1 25.0594 38 4 4 4 4 1 2 2 2 3 2 3 39 1 0 1 0.45 0 907&lt;BR /&gt;0 24.8092 29 3 4 3 3 2 2 2 2 2 3 2 34 1 0 1 0.10 0 908&lt;BR /&gt;1 . 41 3 4 4 4 2 3 4 4 4 3 2 47 1 0 1 1.36 1 909&lt;BR /&gt;1 33.2816 44 1 4 2 1 2 3 2 3 3 2 2 32 0 0 1 1.94 0 910&lt;BR /&gt;0 27.5490 35 3 4 4 4 2 3 4 2 2 2 2 39 1 0 1 0.10 0 911&lt;BR /&gt;0 22.3779 28 4 4 4 2 3 4 4 3 3 2 2 45 1 0 1 0.10 0 912&lt;BR /&gt;0 29.9534 55 1 4 2 2 2 2 3 2 3 2 2 32 1 0 1 0.10 0 913&lt;BR /&gt;0 36.3158 62 2 2 2 3 3 3 3 2 3 3 2 35 0 1 1 1.55 0 914&lt;BR /&gt;0 23.2635 55 2 2 3 2 1 2 2 2 2 2 2 28 0 1 0 1.78 0 915&lt;BR /&gt;0 22.7483 24 3 4 3 3 3 4 3 3 3 2 2 40 0 0 0 0.10 0 916&lt;BR /&gt;0 28.4810 63 3 2 3 3 2 2 2 2 2 2 2 31 1 0 0 1.78 0 917&lt;BR /&gt;0 24.1292 63 2 3 2 3 3 3 3 3 3 3 2 38 1 0 1 0.10 0 918&lt;BR /&gt;0 29.6495 55 3 4 3 4 1 4 4 4 3 2 1 42 0 1 1 0.10 0 919&lt;BR /&gt;1 32.5565 27 2 3 3 3 3 2 3 3 3 2 2 36 0 0 1 0.10 0 920&lt;BR /&gt;0 31.4002 42 2 4 2 3 2 2 3 4 3 3 2 41 0 1 1 0.10 0 921&lt;BR /&gt;0 22.2987 46 2 3 3 2 2 2 2 3 3 3 2 34 0 0 1 0.10 0 922&lt;BR /&gt;1 32.7711 55 2 4 2 2 3 1 4 4 4 3 4 43 0 1 1 0.10 0 923&lt;BR /&gt;1 20.9825 55 2 3 3 2 2 3 2 2 2 3 2 32 1 0 1 0.10 0 924&lt;BR /&gt;0 25.0881 22 2 4 3 3 3 1 2 3 3 2 2 35 1 0 1 0.10 0 925&lt;BR /&gt;0 29.2947 65 1 4 1 2 3 2 1 3 2 1 1 27 1 0 1 0.10 0 926&lt;BR /&gt;1 31.8854 56 3 3 3 3 3 3 2 3 2 2 2 36 0 0 0 0.10 0 927&lt;BR /&gt;0 28.2456 50 2 3 2 3 3 2 3 3 3 3 2 36 1 0 1 2.53 0 928&lt;BR /&gt;1 40.2707 56 3 4 3 3 2 3 2 3 2 2 2 34 0 0 1 0.10 0 929&lt;BR /&gt;0 30.4683 47 3 3 3 3 2 3 2 3 3 3 2 36 0 1 1 0.10 0 930&lt;BR /&gt;1 . 41 2 4 2 2 2 2 2 4 4 3 3 41 1 0 1 0.74 0 933&lt;BR /&gt;0 23.6749 45 3 4 2 3 2 2 2 4 4 1 3 38 1 0 1 0.10 0 934&lt;BR /&gt;1 36.3158 51 2 4 1 2 2 2 3 4 4 4 4 41 0 0 0 0.10 1 935&lt;BR /&gt;0 33.3604 50 2 3 2 1 3 2 1 3 3 2 2 31 1 0 0 0.36 0 936&lt;BR /&gt;; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to string out the 11 stress variables. I am trying to use Testcode and Testname to do this. I crosschecked using proc contents and proc print for the first 10 observations but it's wrong.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 19:23:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564271#M158258</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-06-06T19:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Stringing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564285#M158265</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/236266"&gt;@ChuksManuel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks Cynthia,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to string out the 11 stress variables. I am trying to use Testcode and Testname to do this. I crosschecked using proc contents and proc print for the first 10 observations but it's wrong.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I do not understand what "string out the 11 stress variables" means.&lt;/P&gt;
&lt;P&gt;What would the actual result look like?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Only use 3 or 4 stress&amp;nbsp;variables and 4 or 5 rows&amp;nbsp;to make the example small enough you could do that by hand.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 20:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564285#M158265</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-06T20:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Stringing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564290#M158267</link>
      <description>&lt;P&gt;My question is:&lt;/P&gt;&lt;P&gt;How can i replace Stress1-Stress11 with the names I've already listed. In other words, instead of having Stress 1, Stress 2,...as variable names, i want to have them replaced by Role Overload (RO), Role Insufficiency (RI)......&lt;/P&gt;&lt;P&gt;in the order that I've listed them in the original post. Any help will be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 20:21:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564290#M158267</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-06-06T20:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Stringing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564325#M158278</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;Consider these 3 programs and their output (using SASHELP.CLASSFIT, but the concept works on ANY SAS data set):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="use_label_statement.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30085i4FE3D1B4E988BFDC/image-size/large?v=v2&amp;amp;px=999" role="button" title="use_label_statement.png" alt="use_label_statement.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Note that the title statement is different for each report. In the 3rd report, the LABEL statement was used to change the column header in the output to be what I wanted, which is different from the labels stored in the data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 22:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stringing/m-p/564325#M158278</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-06-06T22:52:28Z</dc:date>
    </item>
  </channel>
</rss>

