<?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: creating a data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836956#M330938</link>
    <description>I am getting error:&lt;BR /&gt;201 data young_crash21_new;&lt;BR /&gt;202 set young_crash21;&lt;BR /&gt;203 if type='D' and age&amp;lt;=21 then flag1=1; else flag1=0;&lt;BR /&gt;204 if type='O' and age&amp;lt;=20 then flag2=1; else flag2=0;&lt;BR /&gt;205 run;&lt;BR /&gt;&lt;BR /&gt;NOTE: There were 30241 observations read from the data set WORK.YOUNG_CRASH21.&lt;BR /&gt;NOTE: The data set WORK.YOUNG_CRASH21_NEW has 30241 observations and 11 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.05 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;206 proc sql;&lt;BR /&gt;207 create table want as select * from young_crash21_new&lt;BR /&gt;208 group by report_no&lt;BR /&gt;209 having max(flag1)=1 and max(flag2)=1;&lt;BR /&gt;NOTE: The query requires remerging summary statistics back with the original data.&lt;BR /&gt;NOTE: Table WORK.WANT created, with 0 rows and 11 columns.&lt;BR /&gt;&lt;BR /&gt;210 quit;&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.07 seconds&lt;BR /&gt;cpu time 0.04 seconds&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 05 Oct 2022 14:28:15 GMT</pubDate>
    <dc:creator>kbhagat</dc:creator>
    <dc:date>2022-10-05T14:28:15Z</dc:date>
    <item>
      <title>creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836948#M330933</link>
      <description>&lt;P class=""&gt;Hello Everyone,&lt;/P&gt;&lt;P class=""&gt;I have crash data in which I have information on what type of person is involved in the crash: Driver (D), Occupant (O), and Passenger (P). I also have the report number per crash and person Id per person which means if there are 5 people involved in a crash then all 5 will have the same report number but different person IDs. I also have an age variable in the data. I am trying to create sample data where drivers should be 18 years or younger and passengers should be more than one and less than 20 years.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Here are my codes:&lt;/P&gt;&lt;P class=""&gt;/*D- Driver&lt;/P&gt;&lt;P class=""&gt;P- Pedestrian&lt;/P&gt;&lt;P class=""&gt;O- Occupant*/&lt;/P&gt;&lt;P class=""&gt;proc freq data = young.person21;&lt;/P&gt;&lt;P class=""&gt;table PERSON_TYPE;&lt;/P&gt;&lt;P class=""&gt;run;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;proc contents data= young.person21;&lt;/P&gt;&lt;P class=""&gt;run;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;/*Finding number of drivers &amp;gt;= 18 years and more than one Passengers under age 20 involved in a crash&lt;/P&gt;&lt;P class=""&gt;257981 observations and 6 variables*/&lt;/P&gt;&lt;P class=""&gt;data person21;&lt;/P&gt;&lt;P class=""&gt;retain INJ_SEVER_CODE REPORT_NO VEHICLE_ID PERSON_ID age;&lt;/P&gt;&lt;P class=""&gt;length INJ_SEVER_CODE $5. Report_no $10. age 8.;&lt;/P&gt;&lt;P class=""&gt;format INJ_SEVER_CODE $5. Report_no $10. age 8.;&lt;/P&gt;&lt;P class=""&gt;informat INJ_SEVER_CODE $5. Report_no $10. age 8.;&lt;/P&gt;&lt;P class=""&gt;set young.person21;&lt;/P&gt;&lt;P class=""&gt;keep INJ_SEVER_CODE REPORT_NO VEHICLE_ID PERSON_ID AGE person_type ACC_DATE LIC_NUM;&lt;/P&gt;&lt;P class=""&gt;run;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;data young_crash21;&lt;/P&gt;&lt;P class=""&gt;length type $15.;&lt;/P&gt;&lt;P class=""&gt;set person21;&lt;/P&gt;&lt;P class=""&gt;if age &amp;lt;= 18 and person_type = 'D' then Type= "Young Driver";&lt;/P&gt;&lt;P class=""&gt;if age &amp;lt;= 20 and person_type = 'O' then Type= "Passenger";&lt;/P&gt;&lt;P class=""&gt;if Type in ('Young Driver' ,'Passenger');&lt;/P&gt;&lt;P class=""&gt;run;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;/*30241 observations and 7 variable*/&lt;/P&gt;&lt;P class=""&gt;data young_crash21_1;&lt;/P&gt;&lt;P class=""&gt;set person21;&lt;/P&gt;&lt;P class=""&gt;if age &amp;lt;= 18 and person_type = 'D' then Type1= "Young Driver";&lt;/P&gt;&lt;P class=""&gt;if age &amp;lt;= 20 and person_type = 'O' then Type2= "Passenger";&lt;/P&gt;&lt;P class=""&gt;if Type1= 'Young Driver' or Type2= 'Passenger';&lt;/P&gt;&lt;P class=""&gt;run;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;proc freq data = young_crash21_1;&lt;/P&gt;&lt;P class=""&gt;table Lic_num;&lt;/P&gt;&lt;P class=""&gt;run;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;/*First method*/&lt;/P&gt;&lt;P class=""&gt;proc sort data = young_crash21;&lt;/P&gt;&lt;P class=""&gt;by report_no;&lt;/P&gt;&lt;P class=""&gt;run;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;data young_crash21_count;&lt;/P&gt;&lt;P class=""&gt;set young_crash21;&lt;/P&gt;&lt;P class=""&gt;count+1;&lt;/P&gt;&lt;P class=""&gt;by report_no;&lt;/P&gt;&lt;P class=""&gt;if first.report_no then count=1;&lt;/P&gt;&lt;P class=""&gt;run;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;/*Second method*/&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;proc sort data= young_crash21 out= young_crash21_count1;&lt;/P&gt;&lt;P class=""&gt;by type report_no;&lt;/P&gt;&lt;P class=""&gt;run;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;data young_crash21_count2;;&lt;/P&gt;&lt;P class=""&gt;set young_crash21_count1;&lt;/P&gt;&lt;P class=""&gt;count + 1;&lt;/P&gt;&lt;P class=""&gt;by type report_no;&lt;/P&gt;&lt;P class=""&gt;if first.type or first.report_no then count = 1;&lt;/P&gt;&lt;P class=""&gt;run;&lt;/P&gt;&lt;P class=""&gt;I am stuck here. I don't know how to capture only that crash where the driver is less than and equal to 18 years. That particular crash has more than one passenger who is less than 20 years old. In the final data by using my codes I do see a few cases where the driver is older than 18 years and I don't know how to get rid of it.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Please help&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 14:05:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836948#M330933</guid>
      <dc:creator>kbhagat</dc:creator>
      <dc:date>2022-10-05T14:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836951#M330935</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I am trying to create sample data where drivers should be 18 years or younger and passengers should be more than one and less than 20 years.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;UNTESTED CODE (because no data has been provided)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data young_crash21_new;
    set young_crash21;
    if type='D' and age&amp;lt;=21 then flag1=1; else flag1=0;
    if type='O' and age&amp;lt;=20 then flag2=1; else flag2=0;
run;
proc sql;
    create table want as select * from young_crash21_new
    group by report_no 
    having max(flag1)=1 and max(flag2)=1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Oct 2022 14:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836951#M330935</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-10-05T14:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836954#M330936</link>
      <description>&lt;P&gt;Thank you for the response. Let me try these codes thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 14:25:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836954#M330936</guid>
      <dc:creator>kbhagat</dc:creator>
      <dc:date>2022-10-05T14:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836956#M330938</link>
      <description>I am getting error:&lt;BR /&gt;201 data young_crash21_new;&lt;BR /&gt;202 set young_crash21;&lt;BR /&gt;203 if type='D' and age&amp;lt;=21 then flag1=1; else flag1=0;&lt;BR /&gt;204 if type='O' and age&amp;lt;=20 then flag2=1; else flag2=0;&lt;BR /&gt;205 run;&lt;BR /&gt;&lt;BR /&gt;NOTE: There were 30241 observations read from the data set WORK.YOUNG_CRASH21.&lt;BR /&gt;NOTE: The data set WORK.YOUNG_CRASH21_NEW has 30241 observations and 11 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.05 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;206 proc sql;&lt;BR /&gt;207 create table want as select * from young_crash21_new&lt;BR /&gt;208 group by report_no&lt;BR /&gt;209 having max(flag1)=1 and max(flag2)=1;&lt;BR /&gt;NOTE: The query requires remerging summary statistics back with the original data.&lt;BR /&gt;NOTE: Table WORK.WANT created, with 0 rows and 11 columns.&lt;BR /&gt;&lt;BR /&gt;210 quit;&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.07 seconds&lt;BR /&gt;cpu time 0.04 seconds&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Oct 2022 14:28:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836956#M330938</guid>
      <dc:creator>kbhagat</dc:creator>
      <dc:date>2022-10-05T14:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836972#M330944</link>
      <description>&lt;P&gt;I don't see an error. 🤷‍&lt;span class="lia-unicode-emoji" title=":male_sign:"&gt;♂️&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 15:00:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836972#M330944</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-10-05T15:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836976#M330947</link>
      <description>&lt;P&gt;It is not an error but a note and it is giving 0 observation in the final data set (want)&lt;/P&gt;&lt;P&gt;NOTE: The query requires remerging summary statistics back with the original data.&lt;BR /&gt;NOTE: Table WORK.WANT created, with 0 rows and 11 columns.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 15:09:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836976#M330947</guid>
      <dc:creator>kbhagat</dc:creator>
      <dc:date>2022-10-05T15:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836983#M330950</link>
      <description>&lt;P&gt;Since you haven't shared any data, maybe that's the correct answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can share a portion of your actual data, please do so. If you can't share it, please make up some data.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Data MUST be presented as working SAS data step code, which you can type in yourself or by following &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;these instructions&lt;/A&gt;. Do not provide data other ways, I will not be able to use it.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 15:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836983#M330950</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-10-05T15:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836994#M330955</link>
      <description>&lt;P&gt;Will this data work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 16:13:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/836994#M330955</guid>
      <dc:creator>kbhagat</dc:creator>
      <dc:date>2022-10-05T16:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837009#M330959</link>
      <description>&lt;P&gt;No, it does not work. Repeating my earlier request:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Data MUST be presented as working SAS data step code, which you can type in yourself or by following&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self" rel="nofollow noopener noreferrer"&gt;these instructions&lt;/A&gt;&lt;SPAN&gt;. &lt;FONT color="#FF0000"&gt;Do not provide data other ways, I will not be able to use it.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This code should be included in your reply by copying as text and then pasting it into the window that appears when you click on the "little running man" icon.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 16:42:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837009#M330959</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-10-05T16:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837013#M330960</link>
      <description>&lt;P&gt;data test;&lt;BR /&gt;input Report_no$ Vehicle_id Person_id age Person_type$;&lt;BR /&gt;datalines;&lt;BR /&gt;123456 101075 1541 22 Driver&lt;BR /&gt;123456 101076 1542 40 Driver&lt;BR /&gt;123456 101076 1543 16 Passenger&lt;BR /&gt;123456 101076 1544 54 Passenger&lt;BR /&gt;A05656 101077 1545 25 Passenger&lt;BR /&gt;A07651 100918 1546 24 Driver&lt;BR /&gt;A07651 100919 1547 18 Passenger&lt;BR /&gt;A07651 100919 1548 17 Passenger&lt;BR /&gt;A0074 8840 1336 18 Driver&lt;BR /&gt;A0085 8853 1337 21 Driver&lt;BR /&gt;A0085 8853 1338 3 Passenger&lt;BR /&gt;A075 1009 528 17 Driver&lt;BR /&gt;A075 1009 529 19 Passenger&lt;BR /&gt;A075 1009 530 18 Passenger&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 16:49:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837013#M330960</guid>
      <dc:creator>kbhagat</dc:creator>
      <dc:date>2022-10-05T16:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837015#M330962</link>
      <description>&lt;P&gt;I want you to do the programming that you can do, and I'll do the part that you are having trouble with. We have code where the variable PERSON_TYPE has values D or O, but that's not the data you provided. Please straighten that out, either by code or by adjusting the data.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 17:08:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837015#M330962</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-10-05T17:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837016#M330963</link>
      <description>&lt;P&gt;D is Driver and O is Passenger. Does it matter?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 17:11:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837016#M330963</guid>
      <dc:creator>kbhagat</dc:creator>
      <dc:date>2022-10-05T17:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837017#M330964</link>
      <description>&lt;P&gt;data test;&lt;BR /&gt;input Report_no$ Vehicle_id Person_id age Person_type$;&lt;BR /&gt;datalines;&lt;BR /&gt;123456 101075 1541 22 D&lt;BR /&gt;123456 101076 1542 40 D&lt;BR /&gt;123456 101076 1543 16 O&lt;BR /&gt;123456 101076 1544 54 O&lt;BR /&gt;A05656 101077 1545 25 O&lt;BR /&gt;A07651 100918 1546 24 D&lt;BR /&gt;A07651 100919 1547 18 O&lt;BR /&gt;A07651 100919 1548 17 O&lt;BR /&gt;A0074 8840 1336 18 D&lt;BR /&gt;A0085 8853 1337 21 D&lt;BR /&gt;A0085 8853 1338 3 O&lt;BR /&gt;A075 1009 528 17 D&lt;BR /&gt;A075 1009 529 19 O&lt;BR /&gt;A075 1009 530 18 O&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 17:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837017#M330964</guid>
      <dc:creator>kbhagat</dc:creator>
      <dc:date>2022-10-05T17:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837021#M330966</link>
      <description>&lt;P&gt;The variables names don't match and the coding won't match for comparisons, eg type = "D" vs person_type="D" and/or person_type = "Driver" all require the appropriate data values and variable names. So it does matter.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on the last input data this works as expected:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input Report_no$ Vehicle_id Person_id age Person_type$;
datalines;
123456 101075 1541 22 D
123456 101076 1542 40 D
123456 101076 1543 16 O
123456 101076 1544 54 O
A05656 101077 1545 25 O
A07651 100918 1546 24 D
A07651 100919 1547 18 O
A07651 100919 1548 17 O
A0074 8840 1336 18 D
A0085 8853 1337 21 D
A0085 8853 1338 3 O
A075 1009 528 17 D
A075 1009 529 19 O
A075 1009 530 18 O
;

run;

data young_crash21_new;
    set test;
    if person_type='D' and age&amp;lt;=21 then flag1=1; else flag1=0;
    if person_type='O' and age&amp;lt;=20 then flag2=1; else flag2=0;
run;
proc sql;
    create table want as select * from young_crash21_new
    group by report_no 
    having max(flag1)=1 and max(flag2)=1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Oct 2022 17:33:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837021#M330966</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-05T17:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837026#M330969</link>
      <description>&lt;P&gt;Thank you so much. This actually worked!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 18:06:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837026#M330969</guid>
      <dc:creator>kbhagat</dc:creator>
      <dc:date>2022-10-05T18:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837033#M330973</link>
      <description>You should probably mark PaigeMillers solution as correct, all I did was align variable names from his code.</description>
      <pubDate>Wed, 05 Oct 2022 19:19:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837033#M330973</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-05T19:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837035#M330974</link>
      <description>Cool!</description>
      <pubDate>Wed, 05 Oct 2022 19:52:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837035#M330974</guid>
      <dc:creator>kbhagat</dc:creator>
      <dc:date>2022-10-05T19:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837036#M330975</link>
      <description>&lt;P&gt;it is not letting me change but his solution is definitely correct.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 19:55:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837036#M330975</guid>
      <dc:creator>kbhagat</dc:creator>
      <dc:date>2022-10-05T19:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: creating a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837242#M331033</link>
      <description>&lt;P&gt;Hello Paige,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help today. The codes you provided yesterday did help me. So, the final dataset has both young drivers and passengers. But, In one crash there is more than one passenger involved in some cases. How can I create those criteria in the same SAS codes you provided yesterday?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&amp;nbsp;&lt;/P&gt;&lt;P&gt;Komal&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 18:32:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-data/m-p/837242#M331033</guid>
      <dc:creator>kbhagat</dc:creator>
      <dc:date>2022-10-06T18:32:43Z</dc:date>
    </item>
  </channel>
</rss>

