<?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 labels in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772257#M245197</link>
    <description />
    <pubDate>Tue, 05 Oct 2021 19:17:30 GMT</pubDate>
    <dc:creator>Guerraje</dc:creator>
    <dc:date>2021-10-05T19:17:30Z</dc:date>
    <item>
      <title>Creating labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772243#M245192</link>
      <description>&lt;P&gt;I am working on creating groups and giving them new lables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create two groups NHW (NonHispanicWhite) and OTHER.&lt;/P&gt;&lt;P&gt;Right now the data allows for 7 different answers for race/ethnicity. I am trying to make this into two groups and label them accordingly. The way I am trying to do this is have everyone who answered 1 be NHW and everyone who answered 2,3,4,5,6,7 be OTHER. NHW is to = 1 and Other is to = 0 and then have the correct labels. My code is below of me attempting this: Pop is what race/ethnicity is coded as in my data dictionary&lt;/P&gt;&lt;P&gt;Lastly, i am trying to see if race/ethnicity has a correlation with hesitancy which is what my last piece of code is down there.&amp;nbsp;&lt;/P&gt;&lt;P&gt;not sure if I should be using a IF ELSE statement or the PROC FORMAT&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA WORK.vaccine_hesitancy_data;&lt;/P&gt;&lt;P&gt;SET WORK.vaccine_hesitancy_data;&lt;/P&gt;&lt;P&gt;PROC FORMAT;&lt;BR /&gt;VALUE POP 1= 'NHW'&lt;BR /&gt;2,3,4,5,6,7,= 'Other';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC FREQ data=WORK.vaccine_hesitancy_data;&lt;BR /&gt;TABLES (POP) * VACCINEHESITANT/ MISSING CHISQ;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 18:52:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772243#M245192</guid>
      <dc:creator>Guerraje</dc:creator>
      <dc:date>2021-10-05T18:52:21Z</dc:date>
    </item>
    <item>
      <title>Grouping data together and giving them new variable names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772236#M245203</link>
      <description>&lt;P&gt;I am working on a project where I am trying to find levels of hesitancy in different demographics.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;right now I am trying to group my race and ethnicity group into two groups instead of seven since some groups have too low of respondents to work with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My race/ethnicity is coded as 'pop' in the data dictionary.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to make everyone who answered 1 = NHW (nonhispanic white)&lt;/P&gt;&lt;P&gt;I am trying to make everyone who answered anything other than that (2,3,4,5,6,7) = 0&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to make 1's label be NHM&lt;/P&gt;&lt;P&gt;I am trying to make 0's label be Other&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;lastly I am trying to run a table to see their hesitancy which I have already coded for. Below is my current code attempting this. Thank you for any insight! I am not sure if I should be using an IF ELSE statement or possibily a PROC FORMAT&lt;/P&gt;&lt;P&gt;*******************************************&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA WORK.vaccine_hesitancy_data;&lt;/P&gt;&lt;P&gt;SET WORK.vaccine_hesitancy_data;&lt;/P&gt;&lt;P&gt;PROC FORMAT;&lt;BR /&gt;VALUE POP 1= 'NHW'&lt;BR /&gt;2,3,4,5,6,7,= 'Other';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC FREQ data=WORK.vaccine_hesitancy_data;&lt;BR /&gt;TABLES (POP) * VACCINEHESITANT/ MISSING CHISQ;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 17:32:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772236#M245203</guid>
      <dc:creator>Guerraje</dc:creator>
      <dc:date>2021-10-05T17:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772250#M245193</link>
      <description>&lt;P&gt;You need to associate the FORMAT with a variable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format pop pop.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Assuming the variable is also POP but I suspect that ETHNIC or RACE is more likely.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 19:06:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772250#M245193</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2021-10-05T19:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772251#M245194</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

PROC FORMAT;
VALUE POP_FMT
1= 'NHW'
2,3,4,5,6,7,= 'Other';
RUN;


PROC FREQ data=vaccine_hesitancy_data;

TABLES (POP) * VACCINEHESITANT/ MISSING CHISQ;

format POP POP_FMT.;

RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You didn't apply the format.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And just a note that your first two lines (DATA/SET) do nothing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/401680"&gt;@Guerraje&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am working on creating groups and giving them new lables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to create two groups NHW (NonHispanicWhite) and OTHER.&lt;/P&gt;
&lt;P&gt;Right now the data allows for 7 different answers for race/ethnicity. I am trying to make this into two groups and label them accordingly. The way I am trying to do this is have everyone who answered 1 be NHW and everyone who answered 2,3,4,5,6,7 be OTHER. NHW is to = 1 and Other is to = 0 and then have the correct labels. My code is below of me attempting this: Pop is what race/ethnicity is coded as in my data dictionary&lt;/P&gt;
&lt;P&gt;Lastly, i am trying to see if race/ethnicity has a correlation with hesitancy which is what my last piece of code is down there.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;not sure if I should be using a IF ELSE statement or the PROC FORMAT&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA WORK.vaccine_hesitancy_data;&lt;/P&gt;
&lt;P&gt;SET WORK.vaccine_hesitancy_data;&lt;/P&gt;
&lt;P&gt;PROC FORMAT;&lt;BR /&gt;VALUE POP 1= 'NHW'&lt;BR /&gt;2,3,4,5,6,7,= 'Other';&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;PROC FREQ data=WORK.vaccine_hesitancy_data;&lt;BR /&gt;TABLES (POP) * VACCINEHESITANT/ MISSING CHISQ;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 19:07:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772251#M245194</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-05T19:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772255#M245196</link>
      <description>When running that code my table is still split up in all seven responses possible for race/ethnicity instead of two groups</description>
      <pubDate>Tue, 05 Oct 2021 19:16:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772255#M245196</guid>
      <dc:creator>Guerraje</dc:creator>
      <dc:date>2021-10-05T19:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Creating labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772257#M245197</link>
      <description />
      <pubDate>Tue, 05 Oct 2021 19:17:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772257#M245197</guid>
      <dc:creator>Guerraje</dc:creator>
      <dc:date>2021-10-05T19:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Creating labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772259#M245198</link>
      <description>Show your full code and log and please.</description>
      <pubDate>Tue, 05 Oct 2021 19:23:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772259#M245198</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-05T19:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Creating labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772262#M245199</link>
      <description>1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;68&lt;BR /&gt;69 PROC FORMAT;&lt;BR /&gt;70 VALUE POP_FMT&lt;BR /&gt;71 1= 'NHW'&lt;BR /&gt;72 2,3,4,5,6,7,= 'Other';&lt;BR /&gt;_&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant,&lt;BR /&gt;a missing value, LOW, OTHER.&lt;BR /&gt;&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;&lt;BR /&gt;NOTE: The previous statement has been deleted.&lt;BR /&gt;73 RUN;&lt;BR /&gt;&lt;BR /&gt;NOTE: PROCEDURE FORMAT used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 269.43k&lt;BR /&gt;OS Memory 34992.00k&lt;BR /&gt;Timestamp 10/05/2021 07:28:55 PM&lt;BR /&gt;Step Count 128 Switch Count 0&lt;BR /&gt;Page Faults 0&lt;BR /&gt;Page Reclaims 14&lt;BR /&gt;Page Swaps 0&lt;BR /&gt;Voluntary Context Switches 0&lt;BR /&gt;Involuntary Context Switches 0&lt;BR /&gt;Block Input Operations 0&lt;BR /&gt;Block Output Operations 16&lt;BR /&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;74&lt;BR /&gt;75&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;76 PROC FREQ data=vaccine_hesitancy_data;&lt;BR /&gt;77&lt;BR /&gt;78 TABLES (POP) * VACCINEHESITANT/ MISSING CHISQ;&lt;BR /&gt;79&lt;BR /&gt;80 format POP POP_FMT.;&lt;BR /&gt;81&lt;BR /&gt;82 RUN;&lt;BR /&gt;&lt;BR /&gt;NOTE: There were 5993 observations read from the data set WORK.VACCINE_HESITANCY_DATA.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.06 seconds&lt;BR /&gt;user cpu time 0.06 seconds&lt;BR /&gt;system cpu time 0.01 seconds&lt;BR /&gt;memory 3488.06k&lt;BR /&gt;OS Memory 36540.00k&lt;BR /&gt;Timestamp 10/05/2021 07:28:55 PM&lt;BR /&gt;Step Count 129 Switch Count 4&lt;BR /&gt;Page Faults 0&lt;BR /&gt;Page Reclaims 376&lt;BR /&gt;Page Swaps 0&lt;BR /&gt;Voluntary Context Switches 21&lt;BR /&gt;Involuntary Context Switches 0&lt;BR /&gt;Block Input Operations 816&lt;BR /&gt;Block Output Operations 536&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;83&lt;BR /&gt;84 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;94&lt;BR /&gt;User: u57317860&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Oct 2021 19:29:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772262#M245199</guid>
      <dc:creator>Guerraje</dc:creator>
      <dc:date>2021-10-05T19:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772263#M245200</link>
      <description>&lt;P&gt;As asked this is my entire code, this contains everything I am working on.&lt;/P&gt;&lt;P&gt;I am stuck at a few places in this code. This forum i am trying to target the race/ethnicity and trying to combine it into the two groups of NHW and other which is at the bottom.&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Generated Code (IMPORT) */&lt;BR /&gt;/* Source File: vaccine_hesitancy_data.csv */&lt;BR /&gt;/* Source Path: /home/u57317860/Capstone data */&lt;BR /&gt;/* Code generated on: 9/24/21, 4:45 AM */&lt;/P&gt;&lt;P&gt;%web_drop_table(WORK.vaccine_hesitancy_data);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;FILENAME REFFILE '/home/u57317860/Capstone data/vaccine_hesitancy_data.csv';&lt;/P&gt;&lt;P&gt;PROC IMPORT DATAFILE=REFFILE&lt;BR /&gt;DBMS=CSV&lt;BR /&gt;OUT=WORK.vaccine_hesitancy_data;&lt;BR /&gt;GETNAMES=YES;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC CONTENTS DATA=WORK.vaccine_hesitancy_data; RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%web_open_table(WORK.vaccine_hesitancy_data);&lt;/P&gt;&lt;P&gt;DATA WORK.vaccine_hesitancy_data;&lt;/P&gt;&lt;P&gt;SET WORK.vaccine_hesitancy_data;&lt;/P&gt;&lt;P&gt;IF VACCINEUPTAKE= 0 AND VACCINEINTEND IN (2,3,4,5,9) THEN VACCINEHESITANT=1;&lt;BR /&gt;ELSE VACCINEHESITANT= 0;&lt;BR /&gt;IF SEX IN ("Unknow", "") THEN DELETE;&lt;/P&gt;&lt;P&gt;RUN;&lt;BR /&gt;PROC FREQ data=WORK.vaccine_hesitancy_data;&lt;BR /&gt;TABLES (VACCINEUPTAKE VACCINEINTEND SEX) * VACCINEHESITANT/ MISSING CHISQ;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC TTEST data=WORK.vaccine_hesitancy_data;&lt;BR /&gt;VAR AGE;&lt;BR /&gt;CLASS VACCINEHESITANT;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC FREQ data=WORK.vaccine_hesitancy_data;&lt;BR /&gt;TABLES (SEX AGE POP EDUCATION IMPACTPHYSICAL IMPACTMENTAL IMPACTFAMILY IMPACTEMPLOYMENT) * VACCINEHESITANT/ MISSING CHISQ;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;*********ATTEMPTING TO RUN EDUCATION VARIABLE*******************;&lt;BR /&gt;PROC FREQ data=WORK.vaccine_hesitancy_data;&lt;BR /&gt;TABLES (EDUCATION) * VACCINEHESITANT/ MISSING CHISQ;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;*********ATTEMPTING TO CREATE AGE VARIABLES AND RUN T TEST *****;&lt;BR /&gt;DATA WORK.vaccine_hesitancy_data;&lt;/P&gt;&lt;P&gt;SET WORK.vaccine_hesitancy_data;&lt;BR /&gt;if AGE &amp;lt; 30 then AGE_NEW = "18-30";&lt;BR /&gt;else if AGE = &amp;gt;30 then AGE_NEW = "30-65";&lt;/P&gt;&lt;P&gt;DATA WORK.vaccine_hesitancy_data;&lt;/P&gt;&lt;P&gt;SET WORK.vaccine_hesitancy_data;&lt;/P&gt;&lt;P&gt;IF AGE &amp;gt; 65 THEN AGE NEW= "65+";&lt;BR /&gt;ELSE IF AGE = &amp;lt; 65+ THEN AGE NEW = "UNDER65+";&lt;/P&gt;&lt;P&gt;PROC FREQ data=WORK.vaccine_hesitancy_data;&lt;BR /&gt;TABLES (AGE) * VACCINEHESITANT/ MISSING CHISQ;&lt;/P&gt;&lt;P&gt;PROC TTEST data=WORK.vaccine_hesitancy_data;&lt;BR /&gt;VAR AGE;&lt;BR /&gt;CLASS VACCINEHESITANT;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;************* Trying to turn race/ethnicity into two variables nhw and other****;&lt;BR /&gt;PROC FORMAT;&lt;BR /&gt;VALUE POP_FMT&lt;BR /&gt;1= 'NHW'&lt;BR /&gt;2,3,4,5,6,7,= 'Other';&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC FREQ data=vaccine_hesitancy_data;&lt;/P&gt;&lt;P&gt;TABLES (POP) * VACCINEHESITANT/ MISSING CHISQ;&lt;/P&gt;&lt;P&gt;format POP POP_FMT.;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;****************** HAS ANYONE THAT LIVES WITH YOU TESTED POSITIVE this code deletes the unknown delete the if then if we decide not to do this *****;&lt;BR /&gt;DATA WORK.vaccine_hesitancy_data;&lt;/P&gt;&lt;P&gt;SET WORK.vaccine_hesitancy_data;&lt;BR /&gt;IF livetestpos = '.' then delete;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC FREQ data=WORK.vaccine_hesitancy_data;&lt;/P&gt;&lt;P&gt;TABLES (livetestpos) * VACCINEHESITANT/ MISSING CHISQ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 19:31:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772263#M245200</guid>
      <dc:creator>Guerraje</dc:creator>
      <dc:date>2021-10-05T19:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772274#M245201</link>
      <description>&lt;P&gt;Your PROC Format has a value list ending in a comma, hence it says something is missing.&lt;/P&gt;
&lt;P&gt;Instead of&lt;/P&gt;
&lt;PRE&gt;PROC FORMAT;
VALUE POP_FMT
1= 'NHW'
2,3,4,5,6,7&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/FONT&gt;= 'Other';
RUN;

&lt;/PRE&gt;
&lt;P&gt;The format value list should be:&lt;/P&gt;
&lt;PRE&gt;PROC FORMAT;
VALUE POP_FMT
1= 'NHW'
2,3,4,5,6,7= 'Other';
RUN;


&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your intent was to include missing values you have to include the missing value indicator . in the list.&lt;/P&gt;
&lt;P&gt;Or better if you did want missing values in the other category is to use:&lt;/P&gt;
&lt;PRE&gt;PROC FORMAT;
VALUE POP_FMT
1= 'NHW'
other = 'Other';
RUN;
&lt;/PRE&gt;
&lt;P&gt;the "other" in a value list says to apply this label to all values not explicitly included in another range list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since your syntax was incorrect the format was not created. So there was no format available to apply to your Proc Print (or other procedures) output.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 20:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772274#M245201</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-10-05T20:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating labels</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772276#M245202</link>
      <description>&lt;P&gt;DO NOT code like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WORK.vaccine_hesitancy_data;

SET WORK.vaccine_hesitancy_data;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This means each time you're replacing your original data set. If you make a mistake you've destroyed your original data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, organize your code so that you have it as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Data import&lt;/LI&gt;
&lt;LI&gt;Data wrangling -&amp;gt; includes cleaning, recategorizing, labelling etc&lt;/LI&gt;
&lt;LI&gt;Supplemental processes - example formats or adding other data for lookups&lt;/LI&gt;
&lt;LI&gt;Data analysis/reporting&amp;nbsp; all together. If in the process of analysis, you realize you need a new variable go back to Step 2 and fix it there.&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;FYI - given your code I suspect your data wasn't imported correctly and got truncated somewhere. I would recommend not using PROC IMPORT or verifying the data against the source again. In the example below I've used GUESSINGROWS=MAX to ensure the data is read in correctly, but it will slow down the read.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your ultimate issue is a bug in your format code - you have an extra comma in there - see the ERROR in the log?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a fully revised code that should be cleaner for you but obviously untested since I don't have your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
/*****************
Import data
******************/
FILENAME REFFILE '/home/u57317860/Capstone data/vaccine_hesitancy_data.csv';


PROC IMPORT DATAFILE=REFFILE
DBMS=CSV
OUT=WORK.vaccine_hesitancy_data;
GETNAMES=YES;
GUESSINGROWS=MAX;
RUN;

PROC CONTENTS DATA=WORK.vaccine_hesitancy_data;
 RUN;


DATA vax_data;

SET vaccine_hesitancy_data;

IF VACCINEUPTAKE= 0 AND VACCINEINTEND IN (2,3,4,5,9) THEN VACCINEHESITANT=1;
ELSE VACCINEHESITANT= 0;

*check if the value is UNKNOWN;
IF SEX IN ("Unknow", "") THEN DELETE;

if AGE &amp;lt; 30 then AGE_CAT30 = "18-30";
else if AGE = &amp;gt;30 then AGE_CAT30 = "30-65";

IF AGE &amp;gt; 65 THEN AGE_CAT65= "65+";
ELSE IF AGE = &amp;lt; 65+ THEN AGE_CAT65 = "UNDER65+";



RUN;


PROC FREQ data=vax_data;
TABLES (VACCINEUPTAKE VACCINEINTEND SEX) * VACCINEHESITANT/ MISSING CHISQ;
RUN;

PROC TTEST data=vax_data;
VAR AGE;
CLASS VACCINEHESITANT;
RUN;


PROC FREQ data=vax_data;
TABLES (SEX AGE POP EDUCATION IMPACTPHYSICAL IMPACTMENTAL IMPACTFAMILY IMPACTEMPLOYMENT) * VACCINEHESITANT/ MISSING CHISQ;
RUN;

*********ATTEMPTING TO RUN EDUCATION VARIABLE*******************;
PROC FREQ data=WORK.vax_data;
TABLES (EDUCATION) * VACCINEHESITANT/ MISSING CHISQ;
RUN;




PROC FREQ data=WORK.vax_data;
TABLES (AGE) * VACCINEHESITANT/ MISSING CHISQ;

PROC TTEST data=WORK.vax_data;
VAR AGE;
CLASS VACCINEHESITANT;
RUN;

PROC FORMAT;
VALUE POP_FMT
1= 'NHW'
2,3,4,5,6,7 = 'Other';
RUN;


PROC FREQ data=vax_data;

TABLES (POP) * VACCINEHESITANT/ MISSING CHISQ;

format POP POP_FMT.;

RUN;


PROC FREQ data=WORK.vax_data;
where not missing(livetestpos);
TABLES (livetestpos) * VACCINEHESITANT/ MISSING CHISQ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 20:25:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772276#M245202</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-05T20:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping data together and giving them new variable names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772277#M245204</link>
      <description>&lt;P&gt;Essentially identical question combined.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 20:21:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-labels/m-p/772277#M245204</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-10-05T20:21:16Z</dc:date>
    </item>
  </channel>
</rss>

