<?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: A short question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13130#M1823</link>
    <description>Hi:&lt;BR /&gt;
  This task seems tailor-made for PROC FREQ. Is there a reason you want a DATA step when PROC FREQ will create an output data set with the exact information you need???&lt;BR /&gt;
&lt;BR /&gt;
  Just curious.&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
    <pubDate>Tue, 14 Jun 2011 14:20:48 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2011-06-14T14:20:48Z</dc:date>
    <item>
      <title>A short question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13129#M1822</link>
      <description>I have a data like the one below. For each person (with ID), he went to either cinema (1,2) at different time. Just ignore the variable date. I want to know how a program can be developed in the DATA step to resolve the following question:&lt;BR /&gt;
&lt;BR /&gt;
Get a summary for each person (ID) in terms of their frequency of visit to the two cinemas, using only the DATA step? &lt;BR /&gt;
&lt;BR /&gt;
I want to program to get the results &lt;BR /&gt;
&lt;BR /&gt;
Cinema	ID	Date&lt;BR /&gt;
1	1	11/02/2007&lt;BR /&gt;
1	2	11/02/2007&lt;BR /&gt;
1	2	15/04/2007&lt;BR /&gt;
1	2	20/06/2007&lt;BR /&gt;
1	3	14/11/2007&lt;BR /&gt;
2	1	05/01/2007&lt;BR /&gt;
2	1	12/05/2007&lt;BR /&gt;
2	2	08/08/2007&lt;BR /&gt;
&lt;BR /&gt;
The result should look like this:&lt;BR /&gt;
Cinema	ID	Freq&lt;BR /&gt;
1	1	1&lt;BR /&gt;
1	2	3&lt;BR /&gt;
1	3	1&lt;BR /&gt;
2	1	2&lt;BR /&gt;
2	2	1</description>
      <pubDate>Tue, 14 Jun 2011 13:34:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13129#M1822</guid>
      <dc:creator>bncoxuk</dc:creator>
      <dc:date>2011-06-14T13:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: A short question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13130#M1823</link>
      <description>Hi:&lt;BR /&gt;
  This task seems tailor-made for PROC FREQ. Is there a reason you want a DATA step when PROC FREQ will create an output data set with the exact information you need???&lt;BR /&gt;
&lt;BR /&gt;
  Just curious.&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 14 Jun 2011 14:20:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13130#M1823</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-06-14T14:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: A short question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13131#M1824</link>
      <description>Hi, I got a dataset which requires the use of DATA step to handle it. Better to use DATA step rather than any procedure.</description>
      <pubDate>Tue, 14 Jun 2011 14:28:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13131#M1824</guid>
      <dc:creator>bncoxuk</dc:creator>
      <dc:date>2011-06-14T14:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: A short question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13132#M1825</link>
      <description>Again - why would you need/want to "require" a DATA step, if the task can be completed in fewer SAS programming statements and possibly more efficiently?&lt;BR /&gt;
&lt;BR /&gt;
And, so, with a DATA step, you must first sort your data, and then use BY GROUP PROCESSING to identify FIRST. and LAST. conditions for your defined BY variable list and the &lt;BREAK_VARIABLE_NAME&gt;.&lt;BR /&gt;
&lt;BR /&gt;
Explore the available DOC -- see the GOOGLE search below.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
data step by group processing site:sas.com&lt;/BREAK_VARIABLE_NAME&gt;</description>
      <pubDate>Tue, 14 Jun 2011 14:42:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13132#M1825</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2011-06-14T14:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: A short question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13133#M1826</link>
      <description>Thanks, I will try to get a solution using first. and last. Cheers.</description>
      <pubDate>Tue, 14 Jun 2011 15:00:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13133#M1826</guid>
      <dc:creator>bncoxuk</dc:creator>
      <dc:date>2011-06-14T15:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: A short question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13134#M1827</link>
      <description>While I agree that proc freq would be the logical way to go, if you must use a data step this should get you started.&lt;BR /&gt;
&lt;BR /&gt;
data cinema;&lt;BR /&gt;
  input cinema id date ddmmyy10.;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 1 11/02/2007&lt;BR /&gt;
1 2 11/02/2007&lt;BR /&gt;
1 2 15/04/2007&lt;BR /&gt;
1 2 20/06/2007&lt;BR /&gt;
1 3 14/11/2007&lt;BR /&gt;
2 1 05/01/2007&lt;BR /&gt;
2 1 12/05/2007&lt;BR /&gt;
2 2 08/08/2007&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data cinema2 (drop=date total);&lt;BR /&gt;
  retain total;&lt;BR /&gt;
  set cinema;&lt;BR /&gt;
  by cinema id notsorted;&lt;BR /&gt;
&lt;BR /&gt;
  if first.id then total = 0;&lt;BR /&gt;
  total+1;&lt;BR /&gt;
  count = total;&lt;BR /&gt;
  if last.id;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Rich</description>
      <pubDate>Thu, 16 Jun 2011 22:54:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13134#M1827</guid>
      <dc:creator>rtritz</dc:creator>
      <dc:date>2011-06-16T22:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: A short question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13135#M1828</link>
      <description>Data ;&lt;BR /&gt;
do freq = 1 by 1 until( last.id ) ;&lt;BR /&gt;
set your_data ;&lt;BR /&gt;
By cinema id ;&lt;BR /&gt;
End;&lt;BR /&gt;
Run;&lt;BR /&gt;
Almost as short as PROC FREQ</description>
      <pubDate>Fri, 17 Jun 2011 07:19:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13135#M1828</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-06-17T07:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: A short question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13136#M1829</link>
      <description>Oh dear, such a neat and clever approach.&lt;BR /&gt;
&lt;BR /&gt;
Any resource to recommend?</description>
      <pubDate>Fri, 17 Jun 2011 11:39:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13136#M1829</guid>
      <dc:creator>Kevin_Graduate</dc:creator>
      <dc:date>2011-06-17T11:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: A short question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13137#M1830</link>
      <description>Kevin&lt;BR /&gt;
 &lt;BR /&gt;
you are the resource&lt;BR /&gt;
(just like all other posters)&lt;BR /&gt;
  &lt;BR /&gt;
here is the resource &lt;BR /&gt;
(just like a lot of other discussion forums)&lt;BR /&gt;
 &lt;BR /&gt;
how long the list of SAS-lists?&lt;BR /&gt;
longer than we can imagine!&lt;BR /&gt;
 &lt;BR /&gt;
What it used to be, was bit list server (circa 1986 ++ )&lt;BR /&gt;
later, sas-l on mirrored mail servers&lt;BR /&gt;
and "use net"&lt;BR /&gt;
 &lt;BR /&gt;
later google bought comp,soft-sys.sas&lt;BR /&gt;
. . . . or ... brought comp.soft-sys.sas into google groups&lt;BR /&gt;
and a (loose) gateway between was maintained&lt;BR /&gt;
 &lt;BR /&gt;
but, I think, I heard it's no  longer effective&lt;BR /&gt;
 (call it defective?)&lt;BR /&gt;
 &lt;BR /&gt;
and we fragment the discussions some more&lt;BR /&gt;
  &lt;BR /&gt;
volume on SAS-L used to be around 80 messages per day (I could almost cope)&lt;BR /&gt;
(before support.sas.com/forums)&lt;BR /&gt;
(before spam)&lt;BR /&gt;
 &lt;BR /&gt;
possible we now have 80+ discussion channels&lt;BR /&gt;
 &lt;BR /&gt;
fragmentation is not always bad&lt;BR /&gt;
&lt;BR /&gt;
but does make it difficult  - - - to&lt;BR /&gt;
keep up&lt;BR /&gt;
to date</description>
      <pubDate>Fri, 17 Jun 2011 16:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13137#M1830</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-06-17T16:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: A short question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13138#M1831</link>
      <description>try this:&lt;BR /&gt;
&lt;BR /&gt;
proc freq data=cinema;&lt;BR /&gt;
tables cinema*id/norow nocol nopercent nocum out=b;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 20 Jun 2011 11:29:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/A-short-question/m-p/13138#M1831</guid>
      <dc:creator>sas_</dc:creator>
      <dc:date>2011-06-20T11:29:04Z</dc:date>
    </item>
  </channel>
</rss>

