<?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: How to apply character dollar sign to a list of values in the input statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-apply-character-dollar-sign-to-a-list-of-values-in-the/m-p/677005#M204163</link>
    <description>&lt;P&gt;This should work&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input Subject_Id Gender $ Age Salary (Ques1-Ques5) $;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV id="tap-translate"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Sat, 15 Aug 2020 23:06:06 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-08-15T23:06:06Z</dc:date>
    <item>
      <title>How to apply character dollar sign to a list of values in the input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-apply-character-dollar-sign-to-a-list-of-values-in-the/m-p/677004#M204162</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I really have to put the dollar sign in every time to make this data a character value?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data learn.survey;
	infile '/folders/myfolders/71442_example/survey.txt';
	input Subject_Id Gender $ Age Salary Ques1 $ Ques2 $ Ques3 $ Ques4 $ Ques5 $;
	label 
		subject_id = "Subject ID"
		Age = "Age as of 1/1/2006"
		Salary = "Yearly Salary"
		Ques1 = "The governor doing a good job"
		Ques2 = "The property tax should be lowered"
		Ques3 = "Guns should be banned"
		Ques5 = "The schools need to be expanded"
		;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Because this will not work&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data learn.survey;
	infile '/folders/myfolders/71442_example/survey.txt';
	input Subject_Id Gender $ Age Salary Ques1-Ques5 $;
	label 
		subject_id = "Subject ID"
		Age = "Age as of 1/1/2006"
		Salary = "Yearly Salary"
		Ques1 = "The governor doing a good job"
		Ques2 = "The property tax should be lowered"
		Ques3 = "Guns should be banned"
		Ques5 = "The schools need to be expanded"
		;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 15 Aug 2020 23:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-apply-character-dollar-sign-to-a-list-of-values-in-the/m-p/677004#M204162</guid>
      <dc:creator>skatethejake</dc:creator>
      <dc:date>2020-08-15T23:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply character dollar sign to a list of values in the input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-apply-character-dollar-sign-to-a-list-of-values-in-the/m-p/677005#M204163</link>
      <description>&lt;P&gt;This should work&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input Subject_Id Gender $ Age Salary (Ques1-Ques5) $;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV id="tap-translate"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sat, 15 Aug 2020 23:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-apply-character-dollar-sign-to-a-list-of-values-in-the/m-p/677005#M204163</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-15T23:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply character dollar sign to a list of values in the input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-apply-character-dollar-sign-to-a-list-of-values-in-the/m-p/677007#M204164</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-08-15 at 7.08.46 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48274i9F4F2724CB4FE6A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2020-08-15 at 7.08.46 PM.png" alt="Screen Shot 2020-08-15 at 7.08.46 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; I get this error when I try that, it's weird because the parentheses is clearly closed off&lt;/P&gt;</description>
      <pubDate>Sat, 15 Aug 2020 23:09:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-apply-character-dollar-sign-to-a-list-of-values-in-the/m-p/677007#M204164</guid>
      <dc:creator>skatethejake</dc:creator>
      <dc:date>2020-08-15T23:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply character dollar sign to a list of values in the input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-apply-character-dollar-sign-to-a-list-of-values-in-the/m-p/677009#M204165</link>
      <description>&lt;P&gt;This should work better - the error is giving you a hint:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input Subject_Id Gender $ Age Salary (Ques1-Ques5) ($);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 15 Aug 2020 23:40:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-apply-character-dollar-sign-to-a-list-of-values-in-the/m-p/677009#M204165</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-08-15T23:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply character dollar sign to a list of values in the input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-apply-character-dollar-sign-to-a-list-of-values-in-the/m-p/677013#M204168</link>
      <description>&lt;P&gt;To apply a format (or in this case a modifier) to a list of variables you need to put both the variable list and the format list in parentheses.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(Ques1-Ques5) ($)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that you only need the $ informat modifier because you have not yet defined the variables. If you had already defined the variables then you wouldn't need to $ in the INPUT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a length statement the length specification applies to all of the variables listed before it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data learn.survey;
  infile '/folders/myfolders/71442_example/survey.txt';
  length Subject_Id 8 Gender $8 Age Salary 8 Ques1-Ques5 $8;
  input Subject_Id -- Ques5 ;
  label 
    subject_id = "Subject ID"
    Age = "Age as of 1/1/2006"
    Salary = "Yearly Salary"
    Ques1 = "The governor doing a good job"
    Ques2 = "The property tax should be lowered"
    Ques3 = "Guns should be banned"
    Ques5 = "The schools need to be expanded"
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Aug 2020 00:22:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-apply-character-dollar-sign-to-a-list-of-values-in-the/m-p/677013#M204168</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-08-16T00:22:29Z</dc:date>
    </item>
  </channel>
</rss>

