<?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 How to conduct sample check in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640049#M190536</link>
    <description>&lt;P&gt;good day,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is the problem i can't solve&lt;/P&gt;
&lt;P&gt;i have assigned a manual name to my data set as name&lt;/P&gt;
&lt;P&gt;now i want to do some sample check,&lt;/P&gt;
&lt;P&gt;can i randomly draw 5 results out for each name to Verify?&lt;/P&gt;
&lt;P&gt;and i would like to place them in the same row like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;name&amp;nbsp; ||&amp;nbsp; merchant_strip1 ||&amp;nbsp; merchant_strip2 || merchant_strip3 || merchant_strip4 ||merchant_strip5&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is my raw data set&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="403"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="339"&gt;merchant_strip&lt;/TD&gt;
&lt;TD width="64"&gt;Name&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A A ALFA TAXI DI FIORI GENESTRERIOTICH&lt;/TD&gt;
&lt;TD&gt;TAXI&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A A OPTICAL HONG KONG HKG&lt;/TD&gt;
&lt;TD&gt;OPTICAL&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A A OPTICAL HONG KONG HKG&lt;/TD&gt;
&lt;TD&gt;OPTICAL&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A A OPTICAL HONG KONG HK&lt;/TD&gt;
&lt;TD&gt;OPTICAL&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A A OPTICAL YUEN LONG HK&lt;/TD&gt;
&lt;TD&gt;OPTICAL&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A A OPTICAL YUEN LONG HKG&lt;/TD&gt;
&lt;TD&gt;OPTICAL&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A AIRLINE TAXI MISSISSAUGA CAN&lt;/TD&gt;
&lt;TD&gt;TAXI&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A AIX TAXI AIX EN PRO FR *&lt;/TD&gt;
&lt;TD&gt;TAXI&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A ALEHOP AER VALENCIAMANISES ES&lt;/TD&gt;
&lt;TD&gt;ALEHOP&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A B A L TOWING PTY L THORNLEIGH AUS&lt;/TD&gt;
&lt;TD&gt;BURBERRY&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A B C DISCOUNT CARPETS CROWS NEST AU&lt;/TD&gt;
&lt;TD&gt;CARPET&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A B SUPER MARCHE GHAZIABAD IN A B SUPER MARCH&lt;/TD&gt;
&lt;TD&gt;SUPERMARCHE&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A BAGHLOUL TAXI GENEVE CH&lt;/TD&gt;
&lt;TD&gt;TAXI&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A BAKERY CENTRAL&lt;/TD&gt;
&lt;TD&gt;A BAKERY&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A BAKERY SHATIN&lt;/TD&gt;
&lt;TD&gt;A BAKERY&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A BAKERY TAIKOO&lt;/TD&gt;
&lt;TD&gt;A BAKERY&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A BAKERY SHATIN&lt;/TD&gt;
&lt;TD&gt;A BAKERY&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A BAKERY C HKG HKG&lt;/TD&gt;
&lt;TD&gt;A1 BAKERY&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A BAKERY CAFE HONGKONG HK&lt;/TD&gt;
&lt;TD&gt;A1 BAKERY&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;</description>
    <pubDate>Wed, 15 Apr 2020 09:45:51 GMT</pubDate>
    <dc:creator>harrylui</dc:creator>
    <dc:date>2020-04-15T09:45:51Z</dc:date>
    <item>
      <title>How to conduct sample check</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640049#M190536</link>
      <description>&lt;P&gt;good day,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is the problem i can't solve&lt;/P&gt;
&lt;P&gt;i have assigned a manual name to my data set as name&lt;/P&gt;
&lt;P&gt;now i want to do some sample check,&lt;/P&gt;
&lt;P&gt;can i randomly draw 5 results out for each name to Verify?&lt;/P&gt;
&lt;P&gt;and i would like to place them in the same row like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;name&amp;nbsp; ||&amp;nbsp; merchant_strip1 ||&amp;nbsp; merchant_strip2 || merchant_strip3 || merchant_strip4 ||merchant_strip5&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is my raw data set&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="403"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="339"&gt;merchant_strip&lt;/TD&gt;
&lt;TD width="64"&gt;Name&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A A ALFA TAXI DI FIORI GENESTRERIOTICH&lt;/TD&gt;
&lt;TD&gt;TAXI&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A A OPTICAL HONG KONG HKG&lt;/TD&gt;
&lt;TD&gt;OPTICAL&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A A OPTICAL HONG KONG HKG&lt;/TD&gt;
&lt;TD&gt;OPTICAL&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A A OPTICAL HONG KONG HK&lt;/TD&gt;
&lt;TD&gt;OPTICAL&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A A OPTICAL YUEN LONG HK&lt;/TD&gt;
&lt;TD&gt;OPTICAL&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A A OPTICAL YUEN LONG HKG&lt;/TD&gt;
&lt;TD&gt;OPTICAL&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A AIRLINE TAXI MISSISSAUGA CAN&lt;/TD&gt;
&lt;TD&gt;TAXI&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A AIX TAXI AIX EN PRO FR *&lt;/TD&gt;
&lt;TD&gt;TAXI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;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 09:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640049#M190536</guid>
      <dc:creator>harrylui</dc:creator>
      <dc:date>2020-04-15T09:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to conduct sample check</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640051#M190538</link>
      <description>&lt;P&gt;proc surveyselect should be able to get the data, post-processing is required for the layout (maybe proc report with an across-variable).&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 09:49:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640051#M190538</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-04-15T09:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to conduct sample check</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640054#M190540</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I didn’t quite understand your questions,&lt;BR /&gt;can you explain more details&lt;BR /&gt;with a copy of the output table please&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 10:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640054#M190540</guid>
      <dc:creator>kelxxx</dc:creator>
      <dc:date>2020-04-15T10:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to conduct sample check</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640092#M190560</link>
      <description>or how to do sample checking for each group&lt;BR /&gt;&lt;BR /&gt;for example ,i got 3 groups and each group has 100 students.&lt;BR /&gt;and i want to draw 5 out of 100 in each group&lt;BR /&gt;group A   student1 student33 student36 student12 student97&lt;BR /&gt;group B   student15 student67 student56 student77 student19&lt;BR /&gt;group C  student19 student7 student123 student98 student61&lt;BR /&gt;&lt;BR /&gt;so that i can check are these students really belong to group A/B/C because the dataset i have for now may got error</description>
      <pubDate>Wed, 15 Apr 2020 13:00:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640092#M190560</guid>
      <dc:creator>harrylui</dc:creator>
      <dc:date>2020-04-15T13:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to conduct sample check</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640121#M190581</link>
      <description>&lt;P&gt;The SELECTION part is Proc survey select. Your "grouping" variable would be a strata and you would need to sort the data set by that variable first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc surveyselect data=have out=selected sampsize=5;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Strata groupvariablename;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;would select 5 records for each strata. Caution: what do you want if there are not at least 5 records for each and every group? The procedure has an option to select all available SELECTALL to get all of the values if there are fewer in the group than you specified in the SAMPSIZE option.&lt;/P&gt;
&lt;P&gt;A worked example you should be able to run:&lt;/P&gt;
&lt;PRE&gt;proc sort data=sashelp.class out=work.class;
   by sex;
run;

proc surveyselect data=work.class out=work.select
    sampsize=5;
   strata sex;
run;&lt;/PRE&gt;
&lt;P&gt;Then Transpose the resulting data set to get the across if really needed but the results will be grouped by the strata and since it seems like you are going to manually check something else for "accuracy" then the transpose may not be needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 14:56:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640121#M190581</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-04-15T14:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to conduct sample check</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640126#M190586</link>
      <description>&lt;PRE&gt;data have;
length group $1 j $15;
do i=1 to 300;
if i&amp;lt;=100 then group="A";
else if i &amp;lt;=200 then group="B";
else group="C";
j=cats("student",i);
output;
end;
drop i;
run;

proc sort data=have;
   by group;
run;

proc surveyselect data=have  out=Sample(keep=group j) 
                     method=srs n=(5 5 5) noprint;
      strata group;
run;

Proc transpose data=sample out=want(drop=_name_) prefix=student;
by group;
var j;
run;&lt;/PRE&gt;&lt;P&gt;i hope that its what you want&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 15:10:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640126#M190586</guid>
      <dc:creator>kelxxx</dc:creator>
      <dc:date>2020-04-15T15:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to conduct sample check</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640321#M190697</link>
      <description>&lt;P&gt;thanks all for help&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 08:26:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-conduct-sample-check/m-p/640321#M190697</guid>
      <dc:creator>harrylui</dc:creator>
      <dc:date>2020-04-16T08:26:04Z</dc:date>
    </item>
  </channel>
</rss>

