<?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 assign sequencing and sub sequencing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-sequencing-and-sub-sequencing/m-p/751988#M236816</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/163076"&gt;@Azeem112&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;In the code I'm only adding sequence to the function so I'm only sorting the function.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't think this answers my question. How do you wind up with an output (which you are showing us) that is sorted by both FUNCTION and REFERENCE? We need to understand how the ouptut was created or we can't provide code to get there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And contrary to your statement above, you are adding sequence to two different columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please clarify the entire process.&lt;/P&gt;</description>
    <pubDate>Sun, 04 Jul 2021 17:46:21 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-07-04T17:46:21Z</dc:date>
    <item>
      <title>How to assign sequencing and sub sequencing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-sequencing-and-sub-sequencing/m-p/751983#M236812</link>
      <description>&lt;P&gt;I have a table that has a few columns, I need to work on three columns of character type. Function, title, and reference,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Function | Title&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| reference&lt;/P&gt;&lt;P&gt;BA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | Title_1&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; Z&amp;nbsp;&lt;/P&gt;&lt;P&gt;IT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp;Title_2&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; C&lt;/P&gt;&lt;P&gt;BA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp;Title_3&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;MA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp;Title_4&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;H&lt;/P&gt;&lt;P&gt;IT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp;Title_5&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;F&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to assign a 7.n sequence to each unique function and 7.n.m sequence to title based onn reference number&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;n and m are integers 1---n numbers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output would be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Function&amp;nbsp; &amp;nbsp; &amp;nbsp; | Title&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | reference&lt;/P&gt;&lt;P&gt;7.1 BA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 7.1.1 Title_3&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;7.1 BA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 7.1.2 Title_1&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; Z&amp;nbsp;&lt;/P&gt;&lt;P&gt;7.2 IT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | 7.2.1 Title_2&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; C&lt;/P&gt;&lt;P&gt;7.2 IT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | 7.2.2 Title_5&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;F&lt;/P&gt;&lt;P&gt;7.3 MA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | 7.3.1 Title_4&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;H&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;using proc sort I've managed to sort and using by function I've managed to add sequence on unique function, then I'm using proc sql to update. but that's not a good approach, and I don't know how to do subsequence on the title.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;below is my code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data = obs_start;
by function;
run;

data updatedFunction;
length updatedFunction $8000.;
count = 1;
   do until (last.function);
      set obs_start;
        by function notsorted;
		if first.function then
      		updatedFunction=cat('7.', count + 1 , " ", function );
		else updatedFunction=cat('7.', count , " ", function );
   	end;
	keep updatedFunction Function;
run;

proc sql noprint;
update obs_start t1
set function = (select updatedFunction from updatedFunction t2 where t1.Function eq t2.Function);
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please guide that how the above functionality can be achieved using minimum steps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 15:44:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-sequencing-and-sub-sequencing/m-p/751983#M236812</guid>
      <dc:creator>Azeem112</dc:creator>
      <dc:date>2021-07-04T15:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign sequencing and sub sequencing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-sequencing-and-sub-sequencing/m-p/751984#M236813</link>
      <description>&lt;P&gt;It's not clear how you go from input data to output data. It seems as if the output data is sorted by FUNCTION and REFERENCE. But your PROC SORT only sorts by FUNCTION.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you offer some clarification here?&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 16:33:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-sequencing-and-sub-sequencing/m-p/751984#M236813</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-04T16:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign sequencing and sub sequencing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-sequencing-and-sub-sequencing/m-p/751986#M236814</link>
      <description>&lt;P&gt;In the code I'm only adding sequence to the function so I'm only sorting the function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 17:35:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-sequencing-and-sub-sequencing/m-p/751986#M236814</guid>
      <dc:creator>Azeem112</dc:creator>
      <dc:date>2021-07-04T17:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign sequencing and sub sequencing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-sequencing-and-sub-sequencing/m-p/751988#M236816</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/163076"&gt;@Azeem112&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;In the code I'm only adding sequence to the function so I'm only sorting the function.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't think this answers my question. How do you wind up with an output (which you are showing us) that is sorted by both FUNCTION and REFERENCE? We need to understand how the ouptut was created or we can't provide code to get there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And contrary to your statement above, you are adding sequence to two different columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please clarify the entire process.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 17:46:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-sequencing-and-sub-sequencing/m-p/751988#M236816</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-04T17:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign sequencing and sub sequencing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-sequencing-and-sub-sequencing/m-p/751992#M236817</link>
      <description>&lt;P&gt;Output generation is in two process&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;part 1) sort the data by function and reference, the result would be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Function | Title&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | reference&lt;/P&gt;&lt;P&gt;BA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | Title_3&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;BA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | Title_1&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; Z&amp;nbsp;&lt;/P&gt;&lt;P&gt;IT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| Title_2&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; C&lt;/P&gt;&lt;P&gt;IT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| Title_5&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;F&lt;/P&gt;&lt;P&gt;MA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| Title_4&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;H&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Part 2) Add sequence in function as 7.n and subsequence in the title as 7.n.m, n and m are positve whole numbers starting from 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the output of this process would be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Function&amp;nbsp; &amp;nbsp; &amp;nbsp; | Title&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | reference&lt;/P&gt;&lt;P&gt;7.1 BA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 7.1.1 Title_3&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;7.1 BA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 7.1.2 Title_1&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; Z&amp;nbsp;&lt;/P&gt;&lt;P&gt;7.2 IT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | 7.2.1 Title_2&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; C&lt;/P&gt;&lt;P&gt;7.2 IT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | 7.2.2 Title_5&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;F&lt;/P&gt;&lt;P&gt;7.3 MA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | 7.3.1 Title_4&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;H&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hope it explains the query&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 18:09:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-sequencing-and-sub-sequencing/m-p/751992#M236817</guid>
      <dc:creator>Azeem112</dc:creator>
      <dc:date>2021-07-04T18:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign sequencing and sub sequencing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-sequencing-and-sub-sequencing/m-p/751999#M236819</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
    by function reference;
run;

data want;
	length function title $ 16;
    set have;
    by function;
    if first.function then seq1+1;
    if first.function then seq2=0;
    seq2+1;
    function=cat('7.',seq1,' ',function);
    title=cat('7.',seq1,'.',seq2,' ',title);
    drop seq1 seq2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 04 Jul 2021 20:18:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-sequencing-and-sub-sequencing/m-p/751999#M236819</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-04T20:18:10Z</dc:date>
    </item>
  </channel>
</rss>

