<?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: Beginner Question: Creating Segment / Variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350912#M81639</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/127439"&gt;@bldudley&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;BR /&gt;I am adding my code and log information&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LOG: 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 61         
 62         data profoot.pro_football_segments;
 63         set profoot.pro_football_groups;
 64         label segment = 'Customer Purchase Segments';
 65         if bought_other_merch='Yes' and bought_sweatshirt='Yes' and bought_team_hat='Yes' and bought_team_tshirt='Yes' then
 65       ! segment='All Merch';
 66         &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I should have over 400 observations.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The first time you reference the variable SEGMENT was in the LABEL statement. Since a type had not been assigned prior to that then SAS assumend that SEGMENT was going to be a numeric variable. "Some merch" is not valid for numeric.&lt;/P&gt;
&lt;P&gt;Add&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Length segment $ 20;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;before&lt;/STRONG&gt; the label statement to declare the variable as character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Apr 2017 15:59:31 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-04-18T15:59:31Z</dc:date>
    <item>
      <title>Beginner Question: Creating Segment / Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350898#M81631</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a student learning SAS programming. I've been tasked with creating a segment&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the last results that I am using:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8367i19E125BF3D9AC881/image-size/original?v=1.0&amp;amp;px=-1" alt="LastResults.JPG" title="LastResults.JPG" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now what I need to do is:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; line-height: 115%; border: none windowtext 1.0pt; padding: 0in;"&gt;Create 3 new "Customer Purchase Segments":&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; line-height: 115%; border: none windowtext 1.0pt; padding: 0in;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i)&amp;nbsp; The fans that bought all four merchandise items.&amp;nbsp; Name this "All Merch".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; line-height: 115%; border: none windowtext 1.0pt; padding: 0in;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ii)&amp;nbsp; The fans that did not buy any merchandise items.&amp;nbsp; Name this "No Merch".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; line-height: 115%; border: none windowtext 1.0pt; padding: 0in;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iii)&amp;nbsp; The fans that bought at least one item, but not more than 3 items.&amp;nbsp; "Some Merch".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; line-height: 115%; border: none windowtext 1.0pt; padding: 0in;"&gt;I suspect that I am supposed to use if / then statements, but I'm not sure. Since I have 4 columns of data to consider (highlighted in the image above), I'm not entirely sure how to write this. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; line-height: 115%; border: none windowtext 1.0pt; padding: 0in;"&gt;Please help. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; line-height: 115%; border: none windowtext 1.0pt; padding: 0in;"&gt;Thank you so much, in advance!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 15:23:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350898#M81631</guid>
      <dc:creator>bldudley</dc:creator>
      <dc:date>2017-04-18T15:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Beginner Question: Creating Segment / Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350899#M81632</link>
      <description>&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if bought_hat='Yes' and bought_tshirt='Yes' and bought_other='Yes' and bought_sweatshirt='Yes' then segment='All Merch';&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Apr 2017 15:27:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350899#M81632</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-04-18T15:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Beginner Question: Creating Segment / Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350900#M81633</link>
      <description>&lt;P&gt;Thank you so much for the quick response. Do I need to create the variable first? If so, could you guide me on how that is done? I can't seem to get it work; keep getting errors in my log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, again!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 15:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350900#M81633</guid>
      <dc:creator>bldudley</dc:creator>
      <dc:date>2017-04-18T15:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Beginner Question: Creating Segment / Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350901#M81634</link>
      <description>&lt;P&gt;You have a sample above but I thought I'd point you to some references so you can read up on this if you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS docs that cover IF/THEN statements&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#p0pcj5ajwyngron1wlsq0tet0hce.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#p0pcj5ajwyngron1wlsq0tet0hce.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS Video tutorials list:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/training/tutorial/" target="_blank"&gt;http://support.sas.com/training/tutorial/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Note on the bottom right hand corner you'll find a link to the free SAS programming e-course.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 15:32:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350901#M81634</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-18T15:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Beginner Question: Creating Segment / Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350902#M81635</link>
      <description>&lt;P&gt;Post your log, then we can see what is wrong &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can run the following code on your data to find out what the variable names actually are, as I suspect the ones you see are labels&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data = yourdata; /* &amp;lt;-- Insert your dataset name here */
run;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 15:35:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350902#M81635</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-04-18T15:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Beginner Question: Creating Segment / Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350903#M81636</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/127439"&gt;@bldudley&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you so much for the quick response. Do I need to create the variable first? If so, could you guide me on how that is done? I can't seem to get it work; keep getting errors in my log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you, again!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can't just say "keep getting errors in my log".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show us the SASLOG so we can see what you are seeing.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 15:35:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350903#M81636</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-04-18T15:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Beginner Question: Creating Segment / Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350909#M81637</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I am adding my code and log information&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data profoot.pro_football_segments;
	set profoot.pro_football_groups;
	label segment = 'Customer Purchase Segments';
	if bought_other_merch='Yes' and bought_sweatshirt='Yes' and bought_team_hat='Yes' and bought_team_tshirt='Yes' then segment='All Merch';
	if bought_other_merch='No' and bought_sweatshirt='No' and bought_team_hat='No' and bought_team_tshirt='No' then segment='No Merch';
	Else if 'Some Merch';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LOG: 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 61         
 62         data profoot.pro_football_segments;
 63         set profoot.pro_football_groups;
 64         label segment = 'Customer Purchase Segments';
 65         if bought_other_merch='Yes' and bought_sweatshirt='Yes' and bought_team_hat='Yes' and bought_team_tshirt='Yes' then
 65       ! segment='All Merch';
 66         if bought_other_merch='No' and bought_sweatshirt='No' and bought_team_hat='No' and bought_team_tshirt='No' then
 66       ! segment='No Merch';
 67         Else if 'Some Merch';
 68         run;
 
 NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
       67:10   
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=10153 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=No Bought_Sweatshirt=Yes payment_method=Team Website
 dollars_spent=155 H=. i=5 gender=Male age=46 Marital_Status=Married Game_Attendance=Season Ticket Holder games_attended=8
 Age_bracket=40s segment=  _ERROR_=1 _N_=1
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=10246 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=Yes Bought_Sweatshirt=Yes payment_method=Team Website
 dollars_spent=190 H=. i=5 gender=Female age=19 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=1
 Age_bracket=Under 20 segment=  _ERROR_=1 _N_=2
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=10591 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Stadium Credit
 dollars_spent=135 H=. i=5 gender=Female age=24 Marital_Status=Married Game_Attendance=Attends More Than 50% of Games
 games_attended=5 Age_bracket=20s segment=  _ERROR_=1 _N_=3
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=10791 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Team Website
 dollars_spent=135 H=. i=5 gender=Male age=42 Marital_Status=Married Game_Attendance=Attends Less Than 50% of Games games_attended=2
 Age_bracket=40s segment=  _ERROR_=1 _N_=4
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=11319 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Team Website
 dollars_spent=105 H=. i=5 gender=Male age=32 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=3
 Age_bracket=30s segment=  _ERROR_=1 _N_=5
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=11925 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Stadium Credit
 dollars_spent=105 H=. i=5 gender=Female age=35 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=1
 Age_bracket=30s segment=  _ERROR_=1 _N_=6
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=12369 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=Yes payment_method=Team Website
 dollars_spent=220 H=. i=5 gender=Male age=45 Marital_Status=Married Game_Attendance=Attends More Than 50% of Games games_attended=6
 Age_bracket=40s segment=All Merch _ERROR_=1 _N_=7
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=12524 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=Yes payment_method=Stadium Cash
 dollars_spent=220 H=. i=5 gender=Female age=27 Marital_Status=Married Game_Attendance=Attends More Than 50% of Games
 games_attended=5 Age_bracket=20s segment=All Merch _ERROR_=1 _N_=8
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=12532 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=No Bought_Sweatshirt=Yes payment_method=Stadium Credit
 dollars_spent=155 H=. i=5 gender=Female age=48 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=4
 Age_bracket=40s segment=  _ERROR_=1 _N_=9
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=12539 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Stadium Credit
 dollars_spent=135 H=. i=5 gender=Female age=50 Marital_Status=Single Game_Attendance=Attends More Than 50% of Games games_attended=7
 Age_bracket=50s segment=  _ERROR_=1 _N_=10
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=12784 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=Yes payment_method=Team Website
 dollars_spent=220 H=. i=5 gender=Female age=44 Marital_Status=Married Game_Attendance=Attends More Than 50% of Games
 games_attended=7 Age_bracket=40s segment=All Merch _ERROR_=1 _N_=11
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=12978 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Team Website
 dollars_spent=135 H=. i=5 gender=Female age=25 Marital_Status=Married Game_Attendance=Attends More Than 50% of Games
 games_attended=7 Age_bracket=20s segment=  _ERROR_=1 _N_=12
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=13107 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=Yes payment_method=Stadium Credit
 dollars_spent=220 H=. i=5 gender=Male age=58 Marital_Status=Single Game_Attendance=Attends More Than 50% of Games games_attended=7
 Age_bracket=50s segment=All Merch _ERROR_=1 _N_=13
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=13172 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=No Bought_Sweatshirt=No payment_method=Stadium Cash
 dollars_spent=40 H=. i=5 gender=Male age=25 Marital_Status=Married Game_Attendance=Attends Less Than 50% of Games games_attended=1
 Age_bracket=20s segment=  _ERROR_=1 _N_=14
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=13296 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=Yes payment_method=Stadium Cash
 dollars_spent=220 H=. i=5 gender=Male age=49 Marital_Status=Married Game_Attendance=Attends Less Than 50% of Games games_attended=1
 Age_bracket=40s segment=All Merch _ERROR_=1 _N_=15
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=13308 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=Yes Bought_Sweatshirt=Yes payment_method=Stadium Credit
 dollars_spent=190 H=. i=5 gender=Female age=54 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=1
 Age_bracket=50s segment=  _ERROR_=1 _N_=16
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=13408 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=No Bought_Sweatshirt=No payment_method=Stadium Cash
 dollars_spent=40 H=. i=5 gender=Male age=68 Marital_Status=Married Game_Attendance=Attends Less Than 50% of Games games_attended=1
 Age_bracket=60s segment=  _ERROR_=1 _N_=17
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=13443 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=Yes payment_method=Team Website
 dollars_spent=280 H=. i=5 gender=Male age=45 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=1
 Age_bracket=40s segment=All Merch _ERROR_=1 _N_=18
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 Fan_ID=13668 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=No Bought_Sweatshirt=Yes payment_method=Stadium Cash
 dollars_spent=155 H=. i=5 gender=Female age=52 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=1
 Age_bracket=50s segment=  _ERROR_=1 _N_=19
 NOTE: Invalid numeric data, 'Some Merch' , at line 67 column 10.
 WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
 Fan_ID=13880 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=Yes Bought_Sweatshirt=Yes payment_method=Team Website
 dollars_spent=190 H=. i=5 gender=Male age=48 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=1
 Age_bracket=40s segment=  _ERROR_=1 _N_=20
 NOTE: There were 473 observations read from the data set PROFOOT.PRO_FOOTBALL_GROUPS.
 NOTE: The data set PROFOOT.PRO_FOOTBALL_SEGMENTS has 10 observations and 16 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.02 seconds
       
 
 69         
 70         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 83         &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I should have over 400 observations.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 15:52:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350909#M81637</guid>
      <dc:creator>bldudley</dc:creator>
      <dc:date>2017-04-18T15:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Beginner Question: Creating Segment / Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350912#M81639</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/127439"&gt;@bldudley&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;BR /&gt;I am adding my code and log information&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LOG: 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 61         
 62         data profoot.pro_football_segments;
 63         set profoot.pro_football_groups;
 64         label segment = 'Customer Purchase Segments';
 65         if bought_other_merch='Yes' and bought_sweatshirt='Yes' and bought_team_hat='Yes' and bought_team_tshirt='Yes' then
 65       ! segment='All Merch';
 66         &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I should have over 400 observations.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The first time you reference the variable SEGMENT was in the LABEL statement. Since a type had not been assigned prior to that then SAS assumend that SEGMENT was going to be a numeric variable. "Some merch" is not valid for numeric.&lt;/P&gt;
&lt;P&gt;Add&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Length segment $ 20;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;before&lt;/STRONG&gt; the label statement to declare the variable as character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 15:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350912#M81639</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-18T15:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Beginner Question: Creating Segment / Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350914#M81640</link>
      <description>&lt;P&gt;Thank you. That did help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I'm still a little stuck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm supposed to have 473 observations. I changed the second line from "if" to Else "if" and I had more observations show, but still not all 473. Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data profoot.pro_football_segments;
	set profoot.pro_football_groups;
	Length segment $ 15;
	label segment = 'Customer Purchase Segments';
	if bought_other_merch='Yes' and bought_sweatshirt='Yes' and bought_team_hat='Yes' and bought_team_tshirt='Yes' then segment='All Merch';
	else if bought_other_merch='No' and bought_sweatshirt='No' and bought_team_hat='No' and bought_team_tshirt='No' then segment='No Merch';
	Else if 'Some Merch';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Log after running that data step with length format included:&lt;/P&gt;&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;61&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;62 data profoot.pro_football_segments;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;63 set profoot.pro_football_groups;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;64 Length segment $ 15;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;65 label segment = 'Customer Purchase Segments';&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;66 if bought_other_merch='Yes' and bought_sweatshirt='Yes' and bought_team_hat='Yes' and bought_team_tshirt='Yes' then&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;66 ! segment='All Merch';&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;67 else if bought_other_merch='No' and bought_sweatshirt='No' and bought_team_hat='No' and bought_team_tshirt='No' then&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;67 ! segment='No Merch';&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;68 Else if 'Some Merch';&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;69 run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;68:10&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=10153 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=No Bought_Sweatshirt=Yes payment_method=Team Website&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=155 H=. i=5 gender=Male age=46 Marital_Status=Married Game_Attendance=Season Ticket Holder games_attended=8&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=40s segment= _ERROR_=1 _N_=1&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=10246 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=Yes Bought_Sweatshirt=Yes payment_method=Team Website&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=190 H=. i=5 gender=Female age=19 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=1&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=Under 20 segment= _ERROR_=1 _N_=2&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=10591 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Stadium Credit&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=135 H=. i=5 gender=Female age=24 Marital_Status=Married Game_Attendance=Attends More Than 50% of Games&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;games_attended=5 Age_bracket=20s segment= _ERROR_=1 _N_=3&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=10791 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Team Website&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=135 H=. i=5 gender=Male age=42 Marital_Status=Married Game_Attendance=Attends Less Than 50% of Games games_attended=2&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=40s segment= _ERROR_=1 _N_=4&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=11319 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Team Website&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=105 H=. i=5 gender=Male age=32 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=3&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=30s segment= _ERROR_=1 _N_=5&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=11925 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Stadium Credit&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=105 H=. i=5 gender=Female age=35 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=1&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=30s segment= _ERROR_=1 _N_=6&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=12532 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=No Bought_Sweatshirt=Yes payment_method=Stadium Credit&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=155 H=. i=5 gender=Female age=48 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=4&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=40s segment= _ERROR_=1 _N_=9&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=12539 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Stadium Credit&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=135 H=. i=5 gender=Female age=50 Marital_Status=Single Game_Attendance=Attends More Than 50% of Games games_attended=7&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=50s segment= _ERROR_=1 _N_=10&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=12978 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Team Website&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=135 H=. i=5 gender=Female age=25 Marital_Status=Married Game_Attendance=Attends More Than 50% of Games&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;games_attended=7 Age_bracket=20s segment= _ERROR_=1 _N_=12&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=13172 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=No Bought_Sweatshirt=No payment_method=Stadium Cash&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=40 H=. i=5 gender=Male age=25 Marital_Status=Married Game_Attendance=Attends Less Than 50% of Games games_attended=1&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=20s segment= _ERROR_=1 _N_=14&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=13308 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=Yes Bought_Sweatshirt=Yes payment_method=Stadium Credit&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=190 H=. i=5 gender=Female age=54 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=1&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=50s segment= _ERROR_=1 _N_=16&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=13408 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=No Bought_Sweatshirt=No payment_method=Stadium Cash&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=40 H=. i=5 gender=Male age=68 Marital_Status=Married Game_Attendance=Attends Less Than 50% of Games games_attended=1&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=60s segment= _ERROR_=1 _N_=17&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=13668 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=No Bought_Sweatshirt=Yes payment_method=Stadium Cash&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=155 H=. i=5 gender=Female age=52 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=1&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=50s segment= _ERROR_=1 _N_=19&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=13880 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=Yes Bought_Sweatshirt=Yes payment_method=Team Website&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=190 H=. i=5 gender=Male age=48 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=1&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=40s segment= _ERROR_=1 _N_=20&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=14026 Bought_Team_Hat=No Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Stadium Credit&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=95 H=. i=5 gender=Female age=64 Marital_Status=Married Game_Attendance=Attends More Than 50% of Games games_attended=6&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=60s segment= _ERROR_=1 _N_=22&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=14109 Bought_Team_Hat=No Bought_Team_TShirt=Yes Bought_Other_Merch=No Bought_Sweatshirt=Yes payment_method=Team Website&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=115 H=. i=5 gender=Female age=65 Marital_Status=Married Game_Attendance=Season Ticket Holder games_attended=8&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=60s segment= _ERROR_=1 _N_=23&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=14202 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Stadium Credit&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=135 H=. i=5 gender=Female age=51 Marital_Status=Married Game_Attendance=Attends Less Than 50% of Games&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;games_attended=4 Age_bracket=50s segment= _ERROR_=1 _N_=24&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=14507 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Team Website&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=105 H=. i=5 gender=Male age=48 Marital_Status=Single Game_Attendance=Attends More Than 50% of Games games_attended=5&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=40s segment= _ERROR_=1 _N_=25&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=14730 Bought_Team_Hat=Yes Bought_Team_TShirt=Yes Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Stadium Credit&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=135 H=. i=5 gender=Male age=52 Marital_Status=Married Game_Attendance=Season Ticket Holder games_attended=8&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=50s segment= _ERROR_=1 _N_=26&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, 'Some Merch' , at line 68 column 10.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Fan_ID=14799 Bought_Team_Hat=Yes Bought_Team_TShirt=No Bought_Other_Merch=Yes Bought_Sweatshirt=No payment_method=Team Website&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;dollars_spent=105 H=. i=5 gender=Female age=55 Marital_Status=Single Game_Attendance=Attends Less Than 50% of Games games_attended=3&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Age_bracket=50s segment= _ERROR_=1 _N_=27&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 473 observations read from the data set PROFOOT.PRO_FOOTBALL_GROUPS.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The data set PROFOOT.PRO_FOOTBALL_SEGMENTS has 94 observations and 16 variables.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.01 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.02 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;70&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;71 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;84&lt;/DIV&gt;</description>
      <pubDate>Tue, 18 Apr 2017 16:09:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350914#M81640</guid>
      <dc:creator>bldudley</dc:creator>
      <dc:date>2017-04-18T16:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Beginner Question: Creating Segment / Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350915#M81641</link>
      <description>&lt;P&gt;The ELSE is incorrect, it should be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Else segment =  'Some Merch';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 16:12:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350915#M81641</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-18T16:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Beginner Question: Creating Segment / Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350916#M81642</link>
      <description>&lt;P&gt;Yes! Thank you SO much.&lt;/P&gt;&lt;P&gt;This makes sense to me now.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 16:17:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350916#M81642</guid>
      <dc:creator>bldudley</dc:creator>
      <dc:date>2017-04-18T16:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Beginner Question: Creating Segment / Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350932#M81648</link>
      <description>&lt;P&gt;And another idea:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data profoot.pro_football_segments;
   set profoot.pro_football_groups;
   total_merch= sum(bought_other_merch='Yes',bought_sweatshirt='Yes',bought_team_hat='Yes',bought_team_tshirt='Yes');
   /* typically at this point I would create a custom format for the total and be done*/
   length segment $ 20;
   select (total_merch);
      when (0) segment='No merch';
      when (4) segment='All merch';
      otherwise segment='Some merch';
   end;
run;
&lt;/PRE&gt;
&lt;P&gt;The Total_merch numeric may be useful other purposes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A format like this could be used to format total_merch for analysis or report purposes.&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
value total_merch
0,. = 'No merch'
4   = 'All merch'
1,2,3 = 'Some merch'
;
run;
&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Apr 2017 16:50:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350932#M81648</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-18T16:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Beginner Question: Creating Segment / Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350933#M81649</link>
      <description>&lt;P&gt;Formats, as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;says, make your life easier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition, instead of having Yes or No as the variable's values, if you use 1 or 0 instead of Yes or No, it's a lot less typing because all you have to do is add the four variables together with the SUM function.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 16:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Beginner-Question-Creating-Segment-Variable/m-p/350933#M81649</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-04-18T16:54:20Z</dc:date>
    </item>
  </channel>
</rss>

