<?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: Creating new variables from rows in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/440089#M4718</link>
    <description>&lt;P&gt;Ok,&amp;nbsp;this should get you started:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have (keep=Skole);
    retain flag 0 ID Name;

    if anyalpha(skole)=0 and find(skole, '.')=0 then
        ID=skole;
    else if anydigit(skole)=0 then
        Name=skole;
    else
        do;
            Record=Skole;
            output;
        end;
    keep name record ID;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 25 Feb 2018 22:59:47 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-02-25T22:59:47Z</dc:date>
    <item>
      <title>Creating new variables from rows</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/439940#M4709</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just finished the SAS programming 1 course - so I'm fairly new to SAS. I have a problem that I don't know how to solve. I have imported data from excel into SAS, which is the first picture to the right. The data is about schools, their institution number and the number of classes that they provide. My assignment is to divide the one variable "Skole" into three variables "skolekode","skoletx" and "kltrin", which is depicted in the second photo (that is the desired output I want to get).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to collect obs 1, 13, 25 into a new variable "skolekode" and obs 2, 14, 26 into "skoletx" and the rest of the observations into "kltrin". How do I do this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Skærmbillede 2018-02-24 kl. 15.26.46.png" style="width: 241px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18796iC5DD5DFBF34341BA/image-dimensions/241x546?v=v2" width="241" height="546" role="button" title="Skærmbillede 2018-02-24 kl. 15.26.46.png" alt="Skærmbillede 2018-02-24 kl. 15.26.46.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Skærmbillede 2018-02-24 kl. 15.27.57.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18797iBC42E5CB9F65F6B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Skærmbillede 2018-02-24 kl. 15.27.57.png" alt="Skærmbillede 2018-02-24 kl. 15.27.57.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Feb 2018 14:37:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/439940#M4709</guid>
      <dc:creator>Marleneek</dc:creator>
      <dc:date>2018-02-24T14:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variables from rows</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/439953#M4710</link>
      <description>&lt;P&gt;Please post the data as data-step using datalines statement, so that we have data to work with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basic idea:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;create the required variables&lt;/LI&gt;&lt;LI&gt;retain skolekode and skoletx&lt;/LI&gt;&lt;LI&gt;lengthn(skole) = 6 and not notdigit(skole) =&amp;gt; skolekode&lt;/LI&gt;&lt;LI&gt;index(skole, 'klasse') &amp;gt; 0 =&amp;gt; kltrin&lt;/LI&gt;&lt;LI&gt;notidigt(skole) = 1 =&amp;gt; skoletx&lt;/LI&gt;&lt;LI&gt;output-statement, when kltrin was filled&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Sat, 24 Feb 2018 16:10:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/439953#M4710</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2018-02-24T16:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variables from rows</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/439961#M4711</link>
      <description>&lt;P&gt;To work with your data we'd have to type it out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can create sample data in a data step using the instructions here:&lt;/P&gt;
&lt;P&gt;&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;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Feb 2018 17:29:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/439961#M4711</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-24T17:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variables from rows</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/439964#M4712</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have created the sample data using the ZIP file. Do I just post it here directly? It is quite big because it has over 10000 lines of code. Here are the first lines:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ARBEJDE.PROVE2011;
  infile datalines dsd truncover;
  input VAR1:$653. VAR2:$99.;
datalines4;
&amp;gt;�׻'&amp;#16;��[=&amp;#4;�,
&amp;amp;$�շ7�7&amp;#28;4�O��H"�xR��㳔d&amp;#28;���&amp;#16;��N&amp;#27;Ҩ9��ɨ�Aw(7e�(��&amp;#3;�3O��,
"��ރh�����&amp;#14;m�&amp;#27;|	�sD�&amp;#23;""$�4�&amp;#1;D�S���O&amp;#23;�&amp;#17;����U��Nh�9��.)��k0՚0�!&amp;#29;�!�i&amp;#29;�&amp;#18;ɹS]�٬	��`�&amp;#4;2K9�G&amp;#6;yvq�/��&amp;#3;PK&amp;#3;&amp;#4;&amp;#20;&amp;#6;&amp;#8;!m&amp;#25;&amp;#25;&amp;#12;�&amp;#2;X&amp;#5;&amp;#15;xl/workbook.xml�T�n�0&amp;#16;�&amp;#23;�?&amp;#8;����&amp;#5;�&amp;#3;�&amp;#11;j�-��I�4E[D��$&amp;#21;�(��&amp;#29;IU�撶&amp;#23;qfH&amp;gt;��7��E#��Ȍ�Z�(&amp;#28;&amp;#5;�c�ꂫc�n�m�	��#� B+��3��b�������^�&amp;#7;&amp;#15;��Q�\5��ҒIbG�b",
v&amp;#14;�H��5Gl+�HaKƜ&amp;#20;8,
�&amp;#12;K�&amp;#21;�&amp;#17;f�=&amp;#24;�p���5�%S�&amp;#7;1L&amp;#16;&amp;#7;�m�+;�I�&amp;#30;8I�C]�T�,
"�\pw�@�'�lwTڐ����0&amp;#29;��|&amp;#3;-95���&amp;#27;&amp;#1;&amp;#20;�I��7&amp;#12;p&amp;#24;�)/�&amp;#7;.�]_v�T�W""�W&amp;#4;�&amp;#4;�nSpǊ&amp;#28;e��&amp;#19;{&amp;#21;0uuYs&amp;#1;��4&amp;#8;�&amp;#21;^&amp;lt;iqeZ&amp;#15;�/�cF&amp;#17;�VZ9(��&amp;#18;�oQ:�U�A&amp;#2;��}��a�|[��&amp;#28;�����^&amp;#17;Wz�&amp;#17;9·&amp;#22;2�_�&amp;#17;L1&amp;lt;�f�&amp;#21;��""&amp;#2;�,on&amp;#21;��ϝ۬AF",�&amp;#7;-��f&amp;lt;�tu$�̃���䭺&amp;#127;!&amp;#1;�]�0&amp;#20;�Of1o�?�����}���&amp;gt;��u�枫B�r&amp;#4;�r&amp;#30;�$&amp;#3;��m��• �d&amp;#18;&amp;lt;�&amp;gt;1~
�]&amp;#8;.��}��[A2��&amp;#31;��6M���&amp;#15;���O�p�_���OV�Mr9M�e&amp;lt;���D�o�&amp;#16;L�t��&amp;amp;Lf��&amp;#4;8&amp;#23;�@j�v�&amp;#28;ٺ&amp;#2;Jq4��}z@�&amp;#21;�4�7�:��t&amp;#27;��t&amp;#19;�a&amp;#22;G~�l�4YEQ�FO\e�&amp;gt;��P�&amp;#26;ʺ?�d )����r����&amp;#28;���&amp;#23;��|_F&amp;lt;���&amp;#5;��&amp;#3;PK&amp;#3;&amp;#4;&amp;#20;&amp;#6;&amp;#8;!��▔C&amp;#4;O&amp;#1;&amp;#20;xl/sharedStrings.xml�}�R[����D�;(���Ƹ�&amp;#19;���9&amp;#29;P&amp;#24;(c�,
�D�n�m�&amp;#17;&amp;#18;�%1���y��&amp;#2;��~&amp;#3;��b�Vn	d��O�7'������we����?�&amp;#6;���&amp;#25;�Gÿ���z��N=�}t�&amp;#31;^�����&amp;#7;ko~��'���&amp;#26;����&amp;#127;������&amp;#31;��&amp;#127;�m&amp;lt;�t@;&amp;#28;�������&amp;#127;��������&amp;#26;�&amp;#30;��C�˗QsWM�&amp;#127;�����M]]�o�zr7�ys}}�绪?����h:�`ܝ�&amp;#27;�&amp;lt;&amp;#29;��cZ������f��&amp;#127;�m����&amp;amp;��X�X_���ϓ&amp;#127;��g����_&amp;#15;;�&amp;#12;���&amp;#30;�o�·�&amp;#26;&amp;#3;ގ&amp;#6;��?\&amp;#127;ݹ��{�&amp;#15;&amp;#27;�?lf�����v�&amp;#15;��&amp;#31;v�&amp;#127;�e��&amp;amp;����&amp;#2;�q[/�}2�&amp;#28;]�M��mV�u�%������uuU�&amp;#11;T=&amp;#25;��{�ԗͨ�[��&amp;#22;(߼��&amp;#27;&amp;lt;�y��gs�&amp;#19;mȅث&amp;#7;������&amp;#2;Ѧ��&amp;lt;~&amp;#31;�WP�~&amp;#28;�,
�b���mx]O,
۲��rȣ�`P�&amp;#3;W+6tC6�h:��&amp;#21;V'�x4&amp;#27;L�˯us]�z�r��դ�&amp;#15;k�/'�\&amp;#23;�~s�j�M9��Q3��K�qS&amp;#14;�&amp;#20;�w�&amp;#31;\Յ�ɵ?&amp;#7;W[�&amp;#21;��/�tQ
&amp;#7;��ǥ�d�α���r�OnK��h4��)&amp;#5;�&amp;#26;,
��3ޒ��&amp;gt;�yu&amp;#7;�&amp;lt;.^�&amp;#18;k��{=&amp;#29;\q&amp;#30;���rO1&amp;#7;��&amp;#21;�y[&amp;#14;�lҀ���:�W�-G&amp;#127;ѿ���L&amp;#11;7s[�����	n�A������S�m9	F�9x���[�I��b&amp;#127;�i��I�”��aiҲ���������+�(&amp;#24;��s��gg&amp;#23;��&amp;#27;�^w��r&amp;#22;��[�%�&amp;#4;{��r&amp;#18;G��W�C&amp;#5;�WZXWNc&amp;gt;�&amp;#7;��&amp;#20;wgb��2&amp;#8;&amp;#127;{9�c�Q���+&amp;lt;�&amp;#3;�sS=��!��3�#X��_�&amp;#3;�Og��]_��A��#��[M1�av&amp;#11;����[���$\��,�vdW��j�`o;�C�G&amp;#15;ug�?&amp;#25;�&amp;#15;T��mݑ��T���@�&amp;#27;&amp;lt;~�U[��z���(p����Sa�o�����&amp;#6;��8ߞlj&amp;#28;C�)�&amp;#12;�&amp;#31;\��=��&amp;#21;��s'��������
"��&amp;#19;������h�K��-��|=`����З~L�	�epU""&amp;#19;&amp;gt;v6jpT�]a(��Y5��tv���o���ݰ&amp;#26;��w��a�i[E&amp;#29;�hCO�ee+���&amp;#30;�&amp;#7;��A&amp;#127;�Ϲ���&amp;lt;���ϝߠ�=�0b &amp;#12;���͝I&amp;#127;p9�2&amp;#15;xsC.���wH���&amp;#31;�����jPw&amp;gt;&amp;#15;��Fw�����������ܐۥ_�:��G����i3���&amp;lt;�T��&amp;#23;��?��;G}l&amp;#6;e�&amp;#25;���&amp;#26;k
y]�k���&amp;#23;&amp;gt;O���&amp;#17;eL������X��q��خ^��&amp;#6;�a&amp;#28;��[�&amp;#27;y��&amp;#21;u��v&amp;#12;�%�@۽�u�@�:����I$����zu&amp;#7;�U ��&amp;#26;�&amp;lt;T��i����8�&amp;gt;ٖ��yo:&amp;#24;�&amp;#31;��Qn�t�&amp;#15;U&amp;#7;V|3�\$Ĳ3Kr�dV��M&amp;#6;ޖ�����&amp;#12;!&amp;#20;Z��_�V���M
�p��fReS&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 Feb 2018 19:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/439964#M4712</guid>
      <dc:creator>Marleneek</dc:creator>
      <dc:date>2018-02-24T19:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variables from rows</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/439975#M4713</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/190706"&gt;@Marleneek&lt;/a&gt;&amp;nbsp;That does not look correct to me, does it to you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/190706"&gt;@Marleneek&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;I have created the sample data using the ZIP file. Do I just post it here directly? It is quite big because it has over 10000 lines of code. Here are the first lines:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ARBEJDE.PROVE2011;
  infile datalines dsd truncover;
  input VAR1:$653. VAR2:$99.;
datalines4;
&amp;gt;�׻'&amp;#16;��[=&amp;#4;�,
&amp;amp;$�շ7�7&amp;#28;4�O��H"�xR��㳔d&amp;#28;���&amp;#16;��N&amp;#27;Ҩ9��ɨ�Aw(7e�(��&amp;#3;�3O��,
"��ރh�����&amp;#14;m�&amp;#27;|	�sD�&amp;#23;""$�4�&amp;#1;D�S���O&amp;#23;�&amp;#17;����U��Nh�9��.)��k0՚0�!&amp;#29;�!�i&amp;#29;�&amp;#18;ɹS]�٬	��`�&amp;#4;2K9�G&amp;#6;yvq�/��&amp;#3;PK&amp;#3;&amp;#4;&amp;#20;&amp;#6;&amp;#8;!m&amp;#25;&amp;#25;&amp;#12;�&amp;#2;X&amp;#5;&amp;#15;xl/workbook.xml�T�n�0&amp;#16;�&amp;#23;�?&amp;#8;����&amp;#5;�&amp;#3;�&amp;#11;j�-��I�4E[D��$&amp;#21;�(��&amp;#29;IU�撶&amp;#23;qfH&amp;gt;��7��E#��Ȍ�Z�(&amp;#28;&amp;#5;�c�ꂫc�n�m�	��#� B+��3��b�������^�&amp;#7;&amp;#15;��Q�\5��ҒIbG�b",
v&amp;#14;�H��5Gl+�HaKƜ&amp;#20;8,
�&amp;#12;K�&amp;#21;�&amp;#17;f�=&amp;#24;�p���5�%S�&amp;#7;1L&amp;#16;&amp;#7;�m�+;�I�&amp;#30;8I�C]�T�,
"�\pw�@�'�lwTڐ����0&amp;#29;��|&amp;#3;-95���&amp;#27;&amp;#1;&amp;#20;�I��7&amp;#12;p&amp;#24;�)/�&amp;#7;.�]_v�T�W""�W&amp;#4;�&amp;#4;�nSpǊ&amp;#28;e��&amp;#19;{&amp;#21;0uuYs&amp;#1;��4&amp;#8;�&amp;#21;^&amp;lt;iqeZ&amp;#15;�/�cF&amp;#17;�VZ9(��&amp;#18;�oQ:�U�A&amp;#2;��}��a�|[��&amp;#28;�����^&amp;#17;Wz�&amp;#17;9·&amp;#22;2�_�&amp;#17;L1&amp;lt;�f�&amp;#21;��""&amp;#2;�,on&amp;#21;��ϝ۬AF",�&amp;#7;-��f&amp;lt;�tu$�̃���䭺&amp;#127;!&amp;#1;�]�0&amp;#20;�Of1o�?�����}���&amp;gt;��u�枫B�r&amp;#4;�r&amp;#30;�$&amp;#3;��m��• �d&amp;#18;&amp;lt;�&amp;gt;1~
�]&amp;#8;.��}��[A2��&amp;#31;��6M���&amp;#15;���O�p�_���OV�Mr9M�e&amp;lt;���D�o�&amp;#16;L�t��&amp;amp;Lf��&amp;#4;8&amp;#23;�@j�v�&amp;#28;ٺ&amp;#2;Jq4��}z@�&amp;#21;�4�7�:��t&amp;#27;��t&amp;#19;�a&amp;#22;G~�l�4YEQ�FO\e�&amp;gt;��P�&amp;#26;ʺ?�d )����r����&amp;#28;���&amp;#23;��|_F&amp;lt;���&amp;#5;��&amp;#3;PK&amp;#3;&amp;#4;&amp;#20;&amp;#6;&amp;#8;!��▔C&amp;#4;O&amp;#1;&amp;#20;xl/sharedStrings.xml�}�R[����D�;(���Ƹ�&amp;#19;���9&amp;#29;P&amp;#24;(c�,
�D�n�m�&amp;#17;&amp;#18;�%1���y��&amp;#2;��~&amp;#3;��b�Vn	d��O�7'������we����?�&amp;#6;���&amp;#25;�Gÿ���z��N=�}t�&amp;#31;^�����&amp;#7;ko~��'���&amp;#26;����&amp;#127;������&amp;#31;��&amp;#127;�m&amp;lt;�t@;&amp;#28;�������&amp;#127;��������&amp;#26;�&amp;#30;��C�˗QsWM�&amp;#127;�����M]]�o�zr7�ys}}�绪?����h:�`ܝ�&amp;#27;�&amp;lt;&amp;#29;��cZ������f��&amp;#127;�m����&amp;amp;��X�X_���ϓ&amp;#127;��g����_&amp;#15;;�&amp;#12;���&amp;#30;�o�·�&amp;#26;&amp;#3;ގ&amp;#6;��?\&amp;#127;ݹ��{�&amp;#15;&amp;#27;�?lf�����v�&amp;#15;��&amp;#31;v�&amp;#127;�e��&amp;amp;����&amp;#2;�q[/�}2�&amp;#28;]�M��mV�u�%������uuU�&amp;#11;T=&amp;#25;��{�ԗͨ�[��&amp;#22;(߼��&amp;#27;&amp;lt;�y��gs�&amp;#19;mȅث&amp;#7;������&amp;#2;Ѧ��&amp;lt;~&amp;#31;�WP�~&amp;#28;�,
�b���mx]O,
۲��rȣ�`P�&amp;#3;W+6tC6�h:��&amp;#21;V'�x4&amp;#27;L�˯us]�z�r��դ�&amp;#15;k�/'�\&amp;#23;�~s�j�M9��Q3��K�qS&amp;#14;�&amp;#20;�w�&amp;#31;\Յ�ɵ?&amp;#7;W[�&amp;#21;��/�tQ
&amp;#7;��ǥ�d�α���r�OnK��h4��)&amp;#5;�&amp;#26;,
��3ޒ��&amp;gt;�yu&amp;#7;�&amp;lt;.^�&amp;#18;k��{=&amp;#29;\q&amp;#30;���rO1&amp;#7;��&amp;#21;�y[&amp;#14;�lҀ���:�W�-G&amp;#127;ѿ���L&amp;#11;7s[�����	n�A������S�m9	F�9x���[�I��b&amp;#127;�i��I�”��aiҲ���������+�(&amp;#24;��s��gg&amp;#23;��&amp;#27;�^w��r&amp;#22;��[�%�&amp;#4;{��r&amp;#18;G��W�C&amp;#5;�WZXWNc&amp;gt;�&amp;#7;��&amp;#20;wgb��2&amp;#8;&amp;#127;{9�c�Q���+&amp;lt;�&amp;#3;�sS=��!��3�#X��_�&amp;#3;�Og��]_��A��#��[M1�av&amp;#11;����[���$\��,�vdW��j�`o;�C�G&amp;#15;ug�?&amp;#25;�&amp;#15;T��mݑ��T���@�&amp;#27;&amp;lt;~�U[��z���(p����Sa�o�����&amp;#6;��8ߞlj&amp;#28;C�)�&amp;#12;�&amp;#31;\��=��&amp;#21;��s'��������
"��&amp;#19;������h�K��-��|=`����З~L�	�epU""&amp;#19;&amp;gt;v6jpT�]a(��Y5��tv���o���ݰ&amp;#26;��w��a�i[E&amp;#29;�hCO�ee+���&amp;#30;�&amp;#7;��A&amp;#127;�Ϲ���&amp;lt;���ϝߠ�=�0b &amp;#12;���͝I&amp;#127;p9�2&amp;#15;xsC.���wH���&amp;#31;�����jPw&amp;gt;&amp;#15;��Fw�����������ܐۥ_�:��G����i3���&amp;lt;�T��&amp;#23;��?��;G}l&amp;#6;e�&amp;#25;���&amp;#26;k
y]�k���&amp;#23;&amp;gt;O���&amp;#17;eL������X��q��خ^��&amp;#6;�a&amp;#28;��[�&amp;#27;y��&amp;#21;u��v&amp;#12;�%�@۽�u�@�:����I$����zu&amp;#7;�U ��&amp;#26;�&amp;lt;T��i����8�&amp;gt;ٖ��yo:&amp;#24;�&amp;#31;��Qn�t�&amp;#15;U&amp;#7;V|3�\$Ĳ3Kr�dV��M&amp;#6;ޖ�����&amp;#12;!&amp;#20;Z��_�V���M
�p��fReS&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Feb 2018 21:16:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/439975#M4713</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-24T21:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variables from rows</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/440052#M4714</link>
      <description>&lt;P&gt;What about this: (I still have a lot more code, because my data is very big.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ARBEJDE.QUERY;
  infile datalines dsd truncover;
  input Skole:$64. bil:BEST. bio:BEST. bhk:BEST. dan:BEST. eng:BEST. fra:BEST. fk:BEST. geo:BEST. his:BEST. hsh:BEST. idr:BEST. kt:BEST. kri:BEST. kri_rel:BEST. mat:BEST. mus:BEST. nt:BEST. sam:BEST. tys:BEST. vf:BEST.;
datalines4;
101001,26.167076167,13.341523342,750,229.31203931,63.611793612,29.631449631,22.481572482,13.341523342,56.977886978,38.476658477,67.14987715,30,26.535626536,,129.87714988,29.631449631,33.538083538,10.098280098,29.631449631,12.825552826
Den Classenske Legatskole,26.167076167,13.341523342,750,229.31203931,63.611793612,29.631449631,22.481572482,13.341523342,56.977886978,38.476658477,67.14987715,30,26.535626536,,129.87714988,29.631449631,33.538083538,10.098280098,29.631449631,12.825552826
0. klasse,,,750,,,,,,,,,,,,,,,,,
1. klasse,30,0,,390,0,0,0,0,0,0,60,30,30,,150,30,30,0,0,0
2. klasse,30,0,,390,0,0,0,0,0,0,60,30,30,,150,60,30,0,0,0
3. klasse,60,0,,270,60,0,0,0,30,0,60,30,30,,150,60,60,0,0,0
4. klasse,60,0,,180,60,0,0,0,60,60,60,30,30,,120,60,60,0,0,0
5. klasse,60,0,,180,90,0,0,0,60,60,90,30,30,,120,60,60,0,0,0
6. klasse,0,0,,180,90,0,0,0,90,150,90,30,30,,120,0,60,0,0,0
7. klasse,0,60,,150,90,90,60,60,90,60,60,30,0,,120,0,0,0,90,0
8. klasse,0,30,,150,90,90,60,30,90,0,60,30,30,,120,0,0,60,90,60
9. klasse,0,30,,180,90,90,90,30,90,0,60,30,30,,120,0,0,30,90,60
101003,25.327868852,10.737704918,750,235,58.360655738,25.327868852,19.180327869,13.606557377,40.245901639,35.081967213,70.081967213,30,29.016393443,,131.96721311,32.37704918,34.918032787,8.0327868852,25.327868852,12.295081967
Nyboder Skole,25.327868852,10.737704918,750,235,58.360655738,25.327868852,19.180327869,13.606557377,40.245901639,35.081967213,70.081967213,30,29.016393443,,131.96721311,32.37704918,34.918032787,8.0327868852,25.327868852,12.295081967
0. klasse,,,750,,,,,,,,,,,,,,,,,
1. klasse,30,0,,390,0,0,0,0,0,0,60,30,30,,150,30,30,0,0,0
2. klasse,30,0,,360,0,0,0,0,0,0,90,30,30,,150,60,30,0,0,0
3. klasse,60,0,,240,60,0,0,0,30,0,60,30,30,,150,60,60,0,0,0
4. klasse,30,0,,180,60,0,0,0,60,60,60,30,30,,120,60,60,0,0,0
5. klasse,30,0,,180,90,0,0,0,60,120,90,30,30,,120,30,60,0,0,0
6. klasse,30,0,,180,90,0,0,0,90,90,90,30,30,,120,30,60,0,0,0
7. klasse,0,30,,150,90,90,60,30,60,60,60,30,0,,120,0,0,0,90,60
8. klasse,0,30,,150,90,90,60,60,30,0,60,30,30,,120,0,0,60,90,60
9. klasse,0,60,,180,90,90,90,60,60,0,60,30,60,,120,0,0,30,90,0
101005,24.047619048,12.777777778,750,225.79365079,62.222222222,27.857142857,21.428571429,12.777777778,43.174603175,38.174603175,70.238095238,30,26.507936508,,130.31746032,30.873015873,34.444444444,8.7301587302,27.857142857,11.587301587
Sølvgades Skole,24.047619048,12.777777778,750,225.79365079,62.222222222,27.857142857,21.428571429,12.777777778,43.174603175,38.174603175,70.238095238,30,26.507936508,,130.31746032,30.873015873,34.444444444,8.7301587302,27.857142857,11.587301587
0. klasse,,,750,,,,,,,,,,,,,,,,,
1. klasse,30,0,,390,0,0,0,0,0,0,60,30,30,,150,30,30,0,0,0
2. klasse,30,0,,360,0,0,0,0,0,0,90,30,30,,150,60,30,0,0,0
3. klasse,60,0,,240,60,0,0,0,30,0,60,30,30,,150,60,60,0,0,0
4. klasse,30,0,,180,60,0,0,0,60,90,60,30,30,,120,60,60,0,0,0
5. klasse,30,0,,180,90,0,0,0,60,90,90,30,30,,120,30,60,0,0,0
6. klasse,30,0,,180,90,0,0,0,90,90,90,30,30,,120,30,60,0,0,0
7. klasse,0,60,,150,90,90,60,60,60,60,60,30,0,,120,0,0,0,90,0
8. klasse,0,30,,150,90,90,60,30,30,0,60,30,30,,120,0,0,60,90,60
9. klasse,0,30,,180,90,90,90,30,60,0,60,30,30,,120,0,0,30,90,60
101007,26.218487395,11.911764706,750,227.07983193,60.693277311,27.605042017,21.113445378,12.605042017,35.168067227,34.222689076,66.617647059,30,26.596638655,,131.65966387,32.079831933,34.033613445,8.8865546218,27.605042017,8.6974789916&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Feb 2018 18:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/440052#M4714</guid>
      <dc:creator>Marleneek</dc:creator>
      <dc:date>2018-02-25T18:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variables from rows</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/440054#M4715</link>
      <description>&lt;P&gt;This is very different than what you showed in the first images, that only had the first column of data. Is it only the first column you're interested in working with?&lt;/P&gt;</description>
      <pubDate>Sun, 25 Feb 2018 18:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/440054#M4715</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-25T18:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variables from rows</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/440082#M4717</link>
      <description>&lt;P&gt;Yes, because the other columns are okay. My desired output is in this form, minus the first three variables:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ARBEJDE.TIMETAL2006_2007;
  infile datalines dsd truncover;
  input aar:11. kommunenr:$3. kommunetx:$17. skolekode:11. skoletx:$100. kltrin:$200. trin:$12. dan:32. eng:32. tys:32. fra:32. kri:32. rel:32. his:32. sam:32. idr:32. mus:32. bil:32. mat:32. fk:32. geo:32. bio:32. nt:32. til:32. bhv:32. kla:32. hsh:32. Elev_normal:32. Elev_special:32. Timer_special:32. _920:32. _60:32. _63:32. _70:32. _800:32. _902:32. insttype:$4.;
datalines4;
2006,101,København,101001,Den Classenske Legatskole,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,750,0,0,,,,,,,,,,1012
2006,101,København,101001,Den Classenske Legatskole,1,1,330,0,0,0,30,0,0,0,60,60,30,150,0,0,0,30,0,0,30,0,,,,,,,,,,1012
2006,101,København,101001,Den Classenske Legatskole,2,2,270,0,0,0,30,0,0,0,60,60,60,150,0,0,0,30,0,0,30,0,,,,,,,,,,1012
2006,101,København,101001,Den Classenske Legatskole,3,3,210,60,0,0,30,0,30,0,60,60,60,150,0,0,0,60,0,0,30,0,,,,,,,,,,1012
2006,101,København,101001,Den Classenske Legatskole,4,4,180,60,0,0,30,0,30,0,60,60,60,120,0,0,0,60,0,0,30,60,,,,,,,,,,1012
2006,101,København,101001,Den Classenske Legatskole,5,5,150,90,0,0,30,0,30,0,90,60,60,120,0,0,0,60,0,0,30,60,,,,,,,,,,1012
2006,101,København,101001,Den Classenske Legatskole,6,6,180,90,0,0,30,0,60,0,60,0,0,120,0,0,0,60,0,0,30,60,,,,,,,,,,1012
2006,101,København,101001,Den Classenske Legatskole,7,7,150,90,90,90,0,0,60,0,60,0,0,120,60,60,60,0,0,0,30,60,,,,,,,,,,1012
2006,101,København,101001,Den Classenske Legatskole,8,8,150,90,90,90,60,0,30,60,60,0,0,120,60,30,30,0,60,0,30,0,,,,,,,,,,1012
2006,101,København,101001,Den Classenske Legatskole,9,9,180,90,90,0,30,0,60,30,60,0,0,120,90,30,30,0,180,0,30,0,,,,,,,,,,1012
2006,101,København,101001,Den Classenske Legatskole,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,1012
2007,101,København,101001,Den Classenske Legatskole,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,750,0,0,,,,,,,,,,1012
2007,101,København,101001,Den Classenske Legatskole,1,1,390,0,0,0,30,0,0,0,60,60,30,150,0,0,0,30,0,0,30,0,,,,,,,,,,1012
2007,101,København,101001,Den Classenske Legatskole,2,2,300,0,0,0,30,0,0,0,60,60,60,150,0,0,0,30,0,0,30,0,,,,,,,,,,1012
2007,101,København,101001,Den Classenske Legatskole,3,3,240,60,0,0,30,0,30,0,60,60,60,150,0,0,0,60,0,0,30,0,,,,,,,,,,1012
2007,101,København,101001,Den Classenske Legatskole,4,4,180,60,0,0,30,0,30,0,90,60,60,120,0,0,0,60,0,0,30,60,,,,,,,,,,1012
2007,101,København,101001,Den Classenske Legatskole,5,5,150,90,0,0,30,0,30,0,90,60,60,120,0,0,0,60,0,0,30,60,,,,,,,,,,1012
2007,101,København,101001,Den Classenske Legatskole,6,6,180,90,0,0,30,0,60,0,90,60,0,120,0,0,0,60,0,0,30,120,,,,,,,,,,1012
2007,101,København,101001,Den Classenske Legatskole,7,7,150,90,90,90,0,0,60,0,60,0,0,120,60,60,60,0,0,0,30,120,,,,,,,,,,1012
2007,101,København,101001,Den Classenske Legatskole,8,8,150,90,90,90,30,0,30,60,60,0,0,120,90,30,30,0,51,0,30,0,,,,,,,,,,1012
2007,101,København,101001,Den Classenske Legatskole,9,9,180,90,90,90,30,0,30,30,60,0,0,120,60,30,30,0,51,0,30,0,,,,,,,,,,1012
2007,101,København,101001,Den Classenske Legatskole,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,1012
2006,101,København,101003,Nyboder Skole,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,750,0,0,,,,,,,,,,1012
2006,101,København,101003,Nyboder Skole,1,1,330,0,0,0,30,0,0,0,60,60,60,150,0,0,0,30,0,0,30,0,,,,,,,,,,1012
2006,101,København,101003,Nyboder Skole,2,2,330,0,0,0,30,0,0,0,60,60,60,150,0,0,0,30,0,0,30,0,,,,,,,,,,1012
2006,101,København,101003,Nyboder Skole,3,3,210,60,0,0,30,0,30,0,60,60,60,150,0,0,0,60,0,0,30,0,,,,,,,,,,1012
2006,101,København,101003,Nyboder Skole,4,4,180,60,0,0,30,0,30,0,60,60,60,120,0,0,0,60,0,0,30,90,,,,,,,,,,1012
2006,101,København,101003,Nyboder Skole,5,5,180,90,0,0,30,0,30,0,90,30,60,120,0,0,0,60,0,0,30,60,,,,,,,,,,1012
2006,101,København,101003,Nyboder Skole,6,6,150,90,0,0,30,0,60,0,60,30,0,120,0,0,0,60,0,0,30,120,,,,,,,,,,1012
2006,101,København,101003,Nyboder Skole,7,7,150,90,90,90,0,0,60,0,60,0,0,120,60,60,60,0,0,0,30,60,,,,,,,,,,1012
2006,101,København,101003,Nyboder Skole,8,8,180,90,90,90,30,0,30,60,60,0,0,120,90,30,30,0,60,0,30,0,,,,,,,,,,1012
2006,101,København,101003,Nyboder Skole,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,1012
2006,101,København,101003,Nyboder Skole,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,1012
2007,101,København,10100&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Feb 2018 22:20:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/440082#M4717</guid>
      <dc:creator>Marleneek</dc:creator>
      <dc:date>2018-02-25T22:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variables from rows</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/440089#M4718</link>
      <description>&lt;P&gt;Ok,&amp;nbsp;this should get you started:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have (keep=Skole);
    retain flag 0 ID Name;

    if anyalpha(skole)=0 and find(skole, '.')=0 then
        ID=skole;
    else if anydigit(skole)=0 then
        Name=skole;
    else
        do;
            Record=Skole;
            output;
        end;
    keep name record ID;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Feb 2018 22:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/440089#M4718</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-25T22:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variables from rows</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/441170#M4748</link>
      <description>&lt;P&gt;Thank you! It did get me started quite well. I now have run into another&amp;nbsp;issue. "Uddannelsescenter Nygård &amp;nbsp;- 10.klasseskolen" appears in the RECORD&amp;nbsp;column, where it instead should appear in the SKOLE&amp;nbsp;column with "10. klasse" in the RECORD column. As you can see in the picture and code SAS also generates a new row (748) with "Måløhøj skole - Østerhøj" in the SKOLE column and "10. klasse" in the RECORD column, which I don't want because it doesn't exist in the file I imported from excel.&lt;/P&gt;&lt;P&gt;I think the issue SAS has is that the ID number is the same for the two schools. I want the output to be that&lt;/P&gt;&lt;P&gt;"151013 Måløhøjvej Skole - Østerhøj" runs from 0-9 klasse (grade) followed by a row with "151013&amp;nbsp;&lt;SPAN&gt;Uddannelsescenter Nygård &amp;nbsp;- 10.klasseskolen" with "10.klasse" in the RECORD column.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Skærmbillede 2018-03-01 kl. 12.12.11.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18906iEFE323E11184FA35/image-size/large?v=v2&amp;amp;px=999" role="button" title="Skærmbillede 2018-03-01 kl. 12.12.11.png" alt="Skærmbillede 2018-03-01 kl. 12.12.11.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;2010,151012,Skovvejens Skole - Øst,2. klasse,330,0,0,0,30,0,0,150,0,30,0,0,60,30,0,120,30,0,0
2010,151012,Skovvejens Skole - Øst,3. klasse,240,60,0,0,30,0,0,150,0,60,0,0,60,30,0,120,30,0,0
2010,151012,Skovvejens Skole - Øst,4. klasse,180,60,0,0,30,0,0,120,0,60,0,0,30,60,60,90,30,0,0
2010,151012,Skovvejens Skole - Øst,5. klasse,180,90,0,0,30,0,0,120,0,60,0,0,30,30,90,90,30,0,0
2010,151012,Skovvejens Skole - Øst,6. klasse,180,90,0,0,30,0,0,120,0,60,0,0,0,30,120,60,30,0,0
2010,151012,Skovvejens Skole - Øst,7. klasse,180,90,90,90,30,0,0,120,60,0,60,30,0,0,90,60,30,0,0
2010,151012,Skovvejens Skole - Øst,8. klasse,180,90,120,120,0,0,60,120,60,0,60,60,0,0,0,60,30,0,60
2010,151012,Skovvejens Skole - Øst,9. klasse,150,90,120,120,30,0,60,120,90,0,30,30,0,0,0,60,30,0,60
2010,151013,Måløvhøj Skole - Østerhøj,0. klasse,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,750,0
2010,151013,Måløvhøj Skole - Østerhøj,1. klasse,330,0,0,0,60,0,0,150,0,30,0,0,30,30,0,120,30,0,0
2010,151013,Måløvhøj Skole - Østerhøj,2. klasse,330,0,0,0,30,0,0,150,0,30,0,0,60,30,0,120,30,0,0
2010,151013,Måløvhøj Skole - Østerhøj,3. klasse,240,60,0,0,30,0,0,150,0,60,0,0,60,30,0,120,30,0,0
2010,151013,Måløvhøj Skole - Østerhøj,4. klasse,180,60,0,0,30,0,0,120,0,60,0,0,30,60,60,90,30,0,0
2010,151013,Måløvhøj Skole - Østerhøj,5. klasse,180,90,0,0,30,0,0,120,0,60,0,0,60,30,90,90,30,0,0
2010,151013,Måløvhøj Skole - Østerhøj,6. klasse,180,90,0,0,30,0,0,120,0,60,0,0,0,30,120,60,30,0,0
2010,151013,Måløvhøj Skole - Østerhøj,7. klasse,180,90,90,0,30,0,0,120,60,0,60,30,0,0,90,60,30,0,0
2010,151013,Måløvhøj Skole - Østerhøj,8. klasse,180,90,120,0,0,0,60,120,60,0,60,60,0,0,0,60,30,0,0
2010,151013,Måløvhøj Skole - Østerhøj,9. klasse,150,90,120,0,30,0,60,120,90,0,30,30,0,0,0,60,30,0,60
2010,153013,Måløvhøj Skole - Østerhøj,Uddannelsescenter Nygård - 10.Klasseskolen,180,120,120,120,0,0,60,120,60,0,0,0,0,0,0,0,20,0,180
2010,153013,Måløvhøj Skole - Østerhøj,10. klasse,180,120,120,120,0,0,60,120,60,0,0,0,0,0,0,0,20,0,180
2010,153018,Brøndbyøster Skole,0. klasse,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,750,0
2010,153018,Brøndbyøster Skole,1. klasse,330,0,0,0,60,0,0,150,0,30,0,0,45,45,0,60,30,0,0
2010,153018,Brøndbyøster Skole,2. klasse,300,0,0,0,30,0,0,150,0,60,0,0,60,60,0,60,30,0,0&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Mar 2018 12:31:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Creating-new-variables-from-rows/m-p/441170#M4748</guid>
      <dc:creator>Marleneek</dc:creator>
      <dc:date>2018-03-01T12:31:56Z</dc:date>
    </item>
  </channel>
</rss>

