<?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: REg:Formats no increase format  should be from a,b,c........za,zb,zc in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/REg-Formats-no-increase-format-should-be-from-a-b-c-za-zb-zc/m-p/54236#M15026</link>
    <description>The COLLATE function may work for your needs, or just create a static list of substring character values to reference / assign based on the offset, using SUBSTR and your count variable with a DATA step, as shown below:&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
retain a2z 'abcdefghijklmnopqrstuvwxyz';&lt;BR /&gt;
do x=1 to length(a2z);&lt;BR /&gt;
  v = substr(a2z,x,1);&lt;BR /&gt;
  put v= x=;&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Thu, 22 Jul 2010 12:33:43 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-07-22T12:33:43Z</dc:date>
    <item>
      <title>REg:Formats no increase format  should be from a,b,c........za,zb,zc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/REg-Formats-no-increase-format-should-be-from-a-b-c-za-zb-zc/m-p/54235#M15025</link>
      <description>Hi i am having a dataset having two vaiables no and name of city .i am having 30000 incremantal data of number if no is increasing then &lt;BR /&gt;
no  city&lt;BR /&gt;
234 mumbai&lt;BR /&gt;
123 chennai&lt;BR /&gt;
999 Hyderabad&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
12456  Delhi&lt;BR /&gt;
32455  Bhopal&lt;BR /&gt;
&lt;BR /&gt;
As the city is increasing it should create a format as 1=Mumbai 2=chennai like that.... the no of city names are there.</description>
      <pubDate>Thu, 22 Jul 2010 12:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/REg-Formats-no-increase-format-should-be-from-a-b-c-za-zb-zc/m-p/54235#M15025</guid>
      <dc:creator>sas_</dc:creator>
      <dc:date>2010-07-22T12:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: REg:Formats no increase format  should be from a,b,c........za,zb,zc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/REg-Formats-no-increase-format-should-be-from-a-b-c-za-zb-zc/m-p/54236#M15026</link>
      <description>The COLLATE function may work for your needs, or just create a static list of substring character values to reference / assign based on the offset, using SUBSTR and your count variable with a DATA step, as shown below:&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
retain a2z 'abcdefghijklmnopqrstuvwxyz';&lt;BR /&gt;
do x=1 to length(a2z);&lt;BR /&gt;
  v = substr(a2z,x,1);&lt;BR /&gt;
  put v= x=;&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 22 Jul 2010 12:33:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/REg-Formats-no-increase-format-should-be-from-a-b-c-za-zb-zc/m-p/54236#M15026</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-07-22T12:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: REg:Formats no increase format  should be from a,b,c........za,zb,zc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/REg-Formats-no-increase-format-should-be-from-a-b-c-za-zb-zc/m-p/54237#M15027</link>
      <description>Hi.&lt;BR /&gt;
&lt;BR /&gt;
Try this example. But it isn't clear for me that if there would be 30000 unique ids&lt;BR /&gt;
then the new_format would be equals 'aaab', 'aaac' and so on. I mean that new_format equals two symbols or it may be more then two symbols.&lt;BR /&gt;
The example is for two letters.&lt;BR /&gt;
&lt;BR /&gt;
  [pre]&lt;BR /&gt;
&lt;BR /&gt;
  data n; do no=1 to 702 ; output;output;output; end; run;&lt;BR /&gt;
&lt;BR /&gt;
  data t; length f $1.  new_format $3. fc $1.; retain fc ' '  f ' ' k 1  j 0 new_format ' '; set n; by no;&lt;BR /&gt;
  if first.no then do;&lt;BR /&gt;
  j=j+1;&lt;BR /&gt;
  if j gt 26 then j=1;&lt;BR /&gt;
  if k gt 26 then k=1;&lt;BR /&gt;
  fc=scan('a b c d e f g h i j k l m n o p q r s t u v w x y z',k,' ');&lt;BR /&gt;
  f=scan('a b c d e f g h i j k l m n o p q r s t u v w x y z',j,' ');&lt;BR /&gt;
  if mod(no,26)=0 and no gt 26 then k=k+1;&lt;BR /&gt;
  if no le 26 then new_format=f; else new_format=fc||f;&lt;BR /&gt;
  end;&lt;BR /&gt;
  keep no new_format;&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
  [/pre]&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Oleg.</description>
      <pubDate>Fri, 23 Jul 2010 05:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/REg-Formats-no-increase-format-should-be-from-a-b-c-za-zb-zc/m-p/54237#M15027</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2010-07-23T05:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: REg:Formats no increase format  should be from a,b,c........za,zb,zc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/REg-Formats-no-increase-format-should-be-from-a-b-c-za-zb-zc/m-p/54238#M15028</link>
      <description>&amp;gt; now i want the format like this in to new vaiable as&lt;BR /&gt;
&amp;gt; i am having 30000 observations as no increase it&lt;BR /&gt;
&amp;gt; should give format like this&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;  if no is 24566  new_format=za&lt;BR /&gt;
&amp;gt; if no is 24567  new_format=zb&lt;BR /&gt;
&amp;gt;  if no is 24568 new_format=zc&lt;BR /&gt;
&lt;BR /&gt;
Hmmmmm...I think format dataset would be a better choice for this kind question.&lt;BR /&gt;
And as your said, there should be 702 obs(i.e. 26*26+26=702).Counld not be 'no is 24568 ';&lt;BR /&gt;
And also your 'no' is numeric variable.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data format;&lt;BR /&gt;
 length label $2.;&lt;BR /&gt;
 retain fmtname 'fmt' type 'N' ;&lt;BR /&gt;
 do label='a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' ;&lt;BR /&gt;
  start+1;&lt;BR /&gt;
  output;&lt;BR /&gt;
 end;&lt;BR /&gt;
 do x='a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' ;&lt;BR /&gt;
  do y='a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' ;&lt;BR /&gt;
   start+1;&lt;BR /&gt;
   label=cats(x,y);&lt;BR /&gt;
   output;&lt;BR /&gt;
   end;&lt;BR /&gt;
 end;&lt;BR /&gt;
 drop x y;&lt;BR /&gt;
 run;&lt;BR /&gt;
 data n; *To build up your original dataset;&lt;BR /&gt;
 do no=1 to 702 ; &lt;BR /&gt;
 output;&lt;BR /&gt;
 end;&lt;BR /&gt;
run;&lt;BR /&gt;
proc format cntlin=format;&lt;BR /&gt;
run;&lt;BR /&gt;
data temp;&lt;BR /&gt;
 set n;&lt;BR /&gt;
 new_format=put(no,fmt.);&lt;BR /&gt;
run;&lt;BR /&gt;
proc print data=temp(obs=40) noobs;run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Fri, 23 Jul 2010 08:22:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/REg-Formats-no-increase-format-should-be-from-a-b-c-za-zb-zc/m-p/54238#M15028</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-07-23T08:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: REg:Formats no increase format  should be from a,b,c........za,zb,zc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/REg-Formats-no-increase-format-should-be-from-a-b-c-za-zb-zc/m-p/54239#M15029</link>
      <description>is this counting in "base 26" (like decimals are base=10, hex is base=16 and binary is base=2)?&lt;BR /&gt;
But, I'm not sure what letter should take the place of a zero, perhaps it should be base27.&lt;BR /&gt;
If so, it should be possible to derive the new_format "number" from a decimal number, with something (probably better with logs)&lt;BR /&gt;
   new_format = substr( '0abcdefghijklmnopqrstuvwxyz', 1+int( no/ 27), 1) !! substr( '0abcdefghijklmnopqrstuvwxyz', 1+mod( no, 27), 1)  ;&lt;BR /&gt;
  &lt;BR /&gt;
Log base 27 can be derived with the code in the knowledgebase at &lt;A href="http://support.sas.com/kb/10/332.html" target="_blank"&gt;http://support.sas.com/kb/10/332.html&lt;/A&gt;&lt;BR /&gt;
  &lt;BR /&gt;
Will original poster sas_ please explain &lt;BR /&gt;
1&lt;BR /&gt;
what the new_format should be for no=27 (the first new_format after " z" )&lt;BR /&gt;
2&lt;BR /&gt;
what rules apply for numbers greater than new_format= zz&lt;BR /&gt;
 &lt;BR /&gt;
peterC</description>
      <pubDate>Fri, 23 Jul 2010 09:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/REg-Formats-no-increase-format-should-be-from-a-b-c-za-zb-zc/m-p/54239#M15029</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-07-23T09:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: REg:Formats no increase format  should be from a,b,c........za,zb,zc</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/REg-Formats-no-increase-format-should-be-from-a-b-c-za-zb-zc/m-p/54240#M15030</link>
      <description>Hi.Peter.&lt;BR /&gt;
Your 'base 26' would be some right.And something you thought would be further profound.&lt;BR /&gt;
I also am confused that why this author want to use this mapping.&lt;BR /&gt;
And your HyperLink,i readed,It is pretty useful. Learned it from you. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Sat, 24 Jul 2010 09:57:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/REg-Formats-no-increase-format-should-be-from-a-b-c-za-zb-zc/m-p/54240#M15030</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-07-24T09:57:40Z</dc:date>
    </item>
  </channel>
</rss>

