<?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: One question about GROUPFORMAT option in MERGE...BY... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122662#M25176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Urvish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right, most of the times GROUPFORMAT would be used with SET statement.&amp;nbsp; Actually I used GROUPFORMAT for only a few times. I ran into this issue when trying to answer someone else's question about merging data sets. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While merging, variables from data sets would not be set to missing at the beginning of each iteration of data step. Of course, at the beginning of the first iteration, all variables would be initialized as missing when no data has been read from data sets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for spending time on this!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 28 Apr 2013 09:41:35 GMT</pubDate>
    <dc:creator>pobel</dc:creator>
    <dc:date>2013-04-28T09:41:35Z</dc:date>
    <item>
      <title>One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122648#M25162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please take a look at the following excerpt of log:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="725" style="border: 1px solid rgb(0, 0, 0); width: 820px; height: 727px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Log&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;23&amp;nbsp;&amp;nbsp; data test;&lt;/P&gt;&lt;P&gt;24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="JEFFREY "; n=1; name1=name; output;&lt;/P&gt;&lt;P&gt;25&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="jEFFREY "; n=2; name1=name; output;&lt;/P&gt;&lt;P&gt;26&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;NOTE: The data set WORK.TEST has 2 observations and 3 variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;NOTE: DATA statement used (Total process time):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;27&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;28&amp;nbsp;&amp;nbsp; data test1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;29&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; merge test sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by name groupformat;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format name $upcase.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if upcase(name)="JEFFREY" then put _all_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;33&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;name=JEFFREY n=1 name1=&lt;SPAN style="color: #0000ff;"&gt;JEFFREY&lt;/SPAN&gt; Sex=&amp;nbsp; Age=. Height=. Weight=. FIRST.name=1 LAST.name=1 _ERROR_=0 _N_=6&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;name=JEFFREY n=2 name1=&lt;SPAN style="color: #0000ff;"&gt;jEFFREY&lt;/SPAN&gt; Sex=M Age=13 Height=62.5 Weight=84 FIRST.name=1 LAST.name=1 _ERROR_=0 _N_=10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;NOTE: There were 2 observations read from the data set WORK.TEST.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;NOTE: There were 19 observations read from the data set SASHELP.CLASS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;NOTE: The data set WORK.TEST1 has 20 observations and 7 variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;NOTE: DATA statement used (Total process time):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.04 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.04 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;When using GROUPFORMAT option in BY statement and the $UPCASE. format on NAME, I except both value "JEFFREY" and "jEFFREY" can match with "Jeffrey".&amp;nbsp; However, "JEFFREY" failed to match "Jeffrey".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would anyone please help me understand why this happens? I wonder what's going on in SAS behind the screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 01:10:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122648#M25162</guid>
      <dc:creator>pobel</dc:creator>
      <dc:date>2013-04-27T01:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122649#M25163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have used the FORMAT statement after BY statement for which SAS is not having any impact of using GROUPFORMAToption in BY statement...To allow SAS to use the formated value of BY variables, you need to use the FORMAT statement before you use GROUPFORMAT option in BY statement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; format name $upcase.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; merge test sashelp.class;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by name groupformat;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if upcase(name)="JEFFREY" then put _all_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not tried this in SAS, but should work...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Urvish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 04:29:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122649#M25163</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2013-04-27T04:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122650#M25164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your response, but it's not because of the FORMAT statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Log:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4632&amp;nbsp; data test1;&lt;/P&gt;&lt;P&gt;4633&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format name $upcase.;&lt;/P&gt;&lt;P&gt;4634&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; merge test sashelp.class;&lt;/P&gt;&lt;P&gt;4635&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by name groupformat;&lt;/P&gt;&lt;P&gt;4636&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if upcase(name)="JEFFREY" then put _all_;&lt;/P&gt;&lt;P&gt;4637&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;name=JEFFREY n=1 name1=JEFFREY Sex=&amp;nbsp; Age=. Height=. Weight=. FIRST.name=1 LAST.name=1 _ERROR_=0 _N_=6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;name=JEFFREY n=2 name1=jEFFREY Sex=M Age=13 Height=62.5 Weight=84 FIRST.name=1 LAST.name=1 _ERROR_=0 _N_=10&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: There were 2 observations read from the data set WORK.TEST.&lt;/P&gt;&lt;P&gt;NOTE: There were 19 observations read from the data set SASHELP.CLASS.&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.TEST1 has 20 observations and 7 variables.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.08 seconds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 04:42:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122650#M25164</guid>
      <dc:creator>pobel</dc:creator>
      <dc:date>2013-04-27T04:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122651#M25165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you don't need to use GROUPGORMAT option...Join two datasets by using proc sql&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;data test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; name = "JEFFERY"; n = 1; name1 = name; output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; name = "jEFFERY"; n = 2; name1 = name; output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; create table both as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; select a.*,b.n&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; from sashelp.class as a, test as b&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; where propcase(a.name) = propcase(b.name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;If still your requirement is not meeting then request you to post proc format code that you have used to create your $upcase format...And also post output you want by combining datasets insted of SAS Log notes...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Urvish&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 16:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122651#M25165</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2013-04-27T16:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122652#M25166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Urvish!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I know we can use PROC SQL and some other ways to do the merge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My real purpose is not to merge two data sets to get a certain result. My purpose is to get to know why the GROUPFORMAT + FORMAT failed to generate the expected result. There should be something that I didn't correctly understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$UPCASE is an internal format in SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Apr 2013 00:16:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122652#M25166</guid>
      <dc:creator>pobel</dc:creator>
      <dc:date>2013-04-28T00:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122653#M25167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot use it to MERGE by formatted values, it will still merge by the actual values.&lt;/P&gt;&lt;P&gt;Really only useful to when setting a single dataset and you want to group based on formatted instead of actual values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plus in your example since you are changing the case of some of the values you would also need to add the NOTSORTED keyword or else the data step will complain that "jeffery" comes after "THOMAS" in alphabetic order.&amp;nbsp; And you cannot use NOTSORTED with more than one dataset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Apr 2013 02:03:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122653#M25167</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-04-28T02:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122654#M25168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom！&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But please try the following example. All observations can merge successfully and no complain about the alphabetic order. &lt;/P&gt;&lt;P&gt;Thanks for your time!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input name $8.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; n=_n_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;henry&lt;/P&gt;&lt;P&gt;HENRY&lt;/P&gt;&lt;P&gt;Henry&lt;/P&gt;&lt;P&gt;HENRY&lt;/P&gt;&lt;P&gt;HenRY&lt;/P&gt;&lt;P&gt;HENry&lt;/P&gt;&lt;P&gt;jeffrey&lt;/P&gt;&lt;P&gt;THOMAS&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format name $upcase.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; merge test sashelp.class(in=okay);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by name groupformat;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not okay then put "Observation " n "is not okay!" name= $8.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Apr 2013 02:33:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122654#M25168</guid>
      <dc:creator>pobel</dc:creator>
      <dc:date>2013-04-28T02:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122655#M25169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure why that one works and this one doesn't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data one ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input id $ @@ ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; copy = id ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; format id $upcase. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; put (_all_) (=);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;a B b c D e&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data two ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input id $ @@ ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; copy2 = id ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; format id $upcase. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; put (_all_) (=);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;A b d&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data check;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; merge one (in=in1) two(in=in2)&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; by id groupformat ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; put (_n_ _all_ in1 in2 first.id last.id) (=) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;_N_=1 id=A copy=a copy2=A in1=1 in2=1 FIRST.id=1 LAST.id=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;_N_=2 id=B copy=B copy2=b in1=1 in2=1 FIRST.id=1 LAST.id=0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;_N_=3 id=B copy=b copy2=b in1=1 in2=1 FIRST.id=0 LAST.id=1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #ff0000;"&gt;ERROR: BY variables are not properly sorted on data set WORK.ONE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;in1=1 in2=0 id=C copy=c copy2=&amp;nbsp; FIRST.id=0 LAST.id=1 _ERROR_=1 _N_=4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: There were 5 observations read from the data set WORK.ONE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: There were 3 observations read from the data set WORK.TWO.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;WARNING: The data set WORK.CHECK may be incomplete.&amp;nbsp; When this step was stopped there were 3 observations and 3 variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;WARNING: Data set WORK.CHECK was not replaced because this step was stopped.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Apr 2013 02:46:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122655#M25169</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-04-28T02:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122656#M25170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, this is totally beyond my understanding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, there will be no ERROR if you add a 'd' in your "data one;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data one ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input id $ @@ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; copy = id ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format id $upcase. ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put (_all_) (=);&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;a&amp;nbsp; B b c &lt;SPAN style="color: #800000;"&gt;&lt;STRONG&gt;d&lt;/STRONG&gt;&lt;/SPAN&gt; D e&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Apr 2013 02:59:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122656#M25170</guid>
      <dc:creator>pobel</dc:creator>
      <dc:date>2013-04-28T02:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122657#M25171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Morning if there is morning...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your main post, you wrote -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;name=JEFFREY n=1 name1=&lt;SPAN style="color: #0000ff;"&gt;JEFFREY&lt;/SPAN&gt; Sex=&amp;nbsp; Age=. Height=. Weight=. FIRST.name=1 LAST.name=1 _ERROR_=0 _N_=6&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;name=JEFFREY n=2 name1=&lt;SPAN style="color: #0000ff;"&gt;jEFFREY&lt;/SPAN&gt; Sex=M Age=13 Height=62.5 Weight=84 FIRST.name=1 LAST.name=1 _ERROR_=0 _N_=10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Here, name1 variable has not associated any format say $upcase.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;And as per your code, you only associate the format to &lt;STRONG&gt;NAME&amp;nbsp; &lt;/STRONG&gt;variable and used as primary key during merging process...You have not used &lt;STRONG&gt;NAME1&amp;nbsp; &lt;/STRONG&gt;variable as key variable for merging the datasets...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;If my understanding about SAS backend process is in line with you then use the following programme...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;data one;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; format name $upcase.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; name = "JEFFREY"; n = 1; name1 = name; output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; name = "jEFFREY"; n = 2; name2 = name; output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;data two;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; format name $upcase.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; set sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;proc sort data = one;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; by name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;proc sort data = two;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; by name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;data both;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; format name name1 $upcase.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; merge one(in = a) two(in = b);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; by &lt;STRONG&gt;name&lt;/STRONG&gt; &lt;STRONG&gt;GROUPFORMAT;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; if upcase(name) = "JEFFREY" then put _all_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;You have not associated the format to name1 variable and SAS used the formated values of variable for BY group processing and that is the reason we get excate match for NAME variable during merging...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Hope this time you get your result...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Urvish&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Apr 2013 06:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122657#M25171</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2013-04-28T06:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122658#M25172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this example but i got ERROR about BY variables are not properly sorted...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per the documentation, if you are using GROUPFORMAT option in BY statement, you need to sort or index the dataset first...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202968.htm" title="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202968.htm"&gt;SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you clear doughts..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Urvish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Apr 2013 06:38:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122658#M25172</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2013-04-28T06:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122659#M25173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Urvish:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good morning and thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We know that in sashelp.class the value is "Jeffrey" for NAME.&lt;/P&gt;&lt;P&gt;The purpose of using variable NAME1 is to store the unformatted value of name, and show in the log which value ('jEFFREY') can be successfully merged to 'Jeffrey' and which ('JEFFREY') cannot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;name=JEFFREY n=1 name1=&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #0000ff;"&gt;JEFFREY&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Sex=&amp;nbsp; Age=. Height=. Weight=.&lt;/SPAN&gt; FIRST.name=1 LAST.name=1 _ERROR_=0 _N_=6&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;name=JEFFREY n=2 name1=&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #0000ff;"&gt;jEFFREY&lt;/SPAN&gt; Sex=M Age=13 Height=62.5 Weight=84 FIRST.name=1 LAST.name=1 _ERROR_=0 _N_=10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I expected both values can be merged to "Jeffrey" when using GROUPFORMAT + FORMAT, but it turned out wrong.&amp;nbsp; So I am not looking for a way to merge datasets, I am looking for a reason why this method didn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Apr 2013 06:47:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122659#M25173</guid>
      <dc:creator>pobel</dc:creator>
      <dc:date>2013-04-28T06:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122660#M25174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Urvish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using SAS 9.1.3 and I didn't get any ERROR message on this example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Apr 2013 06:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122660#M25174</guid>
      <dc:creator>pobel</dc:creator>
      <dc:date>2013-04-28T06:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122661#M25175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried with your code... and also read in SAS Docs and most of the people uses the GROUPFORMAT in SET statement with NOSORTED option in order to manipulate the FIRST.variable and LAST.variable on the basis of formatted values of BY variable insted of actual values...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as per your example, you said it is merging without causing any error...so i think someone from the community having good command on SAS Backend process, can give his or her input to solve it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per my understanding, while merging, SAS retains the values of BY variable in PDV rather than assign it to missing values at the top of data step during each iteration of data step...And in your first comment it seems like SAS is using formatted values of NAME and assign missing values at the top of the data step...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in your second example, SAS is retaining values of variable during each iteration of data step...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it's strange...but will try until i get solution...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Urvish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Apr 2013 09:08:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122661#M25175</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2013-04-28T09:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: One question about GROUPFORMAT option in MERGE...BY...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122662#M25176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Urvish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right, most of the times GROUPFORMAT would be used with SET statement.&amp;nbsp; Actually I used GROUPFORMAT for only a few times. I ran into this issue when trying to answer someone else's question about merging data sets. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While merging, variables from data sets would not be set to missing at the beginning of each iteration of data step. Of course, at the beginning of the first iteration, all variables would be initialized as missing when no data has been read from data sets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for spending time on this!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Apr 2013 09:41:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-question-about-GROUPFORMAT-option-in-MERGE-BY/m-p/122662#M25176</guid>
      <dc:creator>pobel</dc:creator>
      <dc:date>2013-04-28T09:41:35Z</dc:date>
    </item>
  </channel>
</rss>

