<?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: less options in Dropdown for HTML form in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209676#M38890</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the quick testing I did, the data step that reads the cards - the line var is created with a length of $200, so if you have many options, the html options syntax will quickly use up this space and you may end up with truncated html options code - the result is that only the first few options display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try adding a length statement e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _NULL_;&lt;/P&gt;&lt;P&gt;file _webout;&lt;/P&gt;&lt;P&gt;length line $2000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may even need to make this longer if there are many options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Mar 2015 03:33:00 GMT</pubDate>
    <dc:creator>MarkBodt_NZ</dc:creator>
    <dc:date>2015-03-30T03:33:00Z</dc:date>
    <item>
      <title>less options in Dropdown for HTML form</title>
      <link>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209672#M38886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi ,&lt;/P&gt;&lt;P&gt;I am building an HTML form with dropdown boxes where the user can select values.. I am getting the value of the dropdown from a flatfile into a dataset and then into a macro variable which I use to display in the HTML page.&lt;/P&gt;&lt;P&gt;through the options are coming up, the drop down displays only max of 5 values. Kindly let me know how I can display the whole list of values . Kindly Advice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;code :&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data work.empnature;&lt;/P&gt;&lt;P&gt;infile " file location" dlm=',';&lt;/P&gt;&lt;P&gt;input&amp;nbsp; emp_nature :$200.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select distinct '&amp;lt;option value=" ' ||strip(emp_nature)||' "&amp;gt;' ||strip(emp_nature)||'&amp;lt;/option&amp;gt;'&lt;/P&gt;&lt;P&gt;into : options separated by ','&lt;/P&gt;&lt;P&gt;from work.empnature;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _NULL_;&lt;/P&gt;&lt;P&gt;file _webout;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;line=resolve(_infile_);&lt;/P&gt;&lt;P&gt;put line;&lt;/P&gt;&lt;P&gt;cards4;&lt;/P&gt;&lt;P&gt;&amp;lt;html&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;table&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Employment&amp;lt;/td&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;td&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;select name ="emp_nature"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;amp;options&lt;/P&gt;&lt;P&gt;&amp;lt;/select&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/table&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;&lt;P&gt;;;;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 06:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209672#M38886</guid>
      <dc:creator>Anand6666</dc:creator>
      <dc:date>2015-03-25T06:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: less options in Dropdown for HTML form</title>
      <link>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209673#M38887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I know, there is no restriction on the number of options being displayed.&lt;/P&gt;&lt;P&gt;I suspect it may be a problem with the value of the macro variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When viewing the Stored Process try and right click on the browser and select View Source...&lt;/P&gt;&lt;P&gt;Then you will see what the browser received from your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 10:36:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209673#M38887</guid>
      <dc:creator>MichaelLarsen</dc:creator>
      <dc:date>2015-03-25T10:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: less options in Dropdown for HTML form</title>
      <link>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209674#M38888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting the values from a dataset into a macro variable, but it doesn't throw the error of my macro exceeding the length. and when I print the macro with the put statement, as a part of the debug part, the macro variable displays all the values in the log . But when it is expected to display the same by substituting the macro variable in the HTML dropdown element, it displays only 2 values.&lt;/P&gt;&lt;P&gt;I can understand if the records from data set are not inserted into the macro variable due to space constrain, but here I have all the values in the macro variable just that it is not displaying properly .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;select name ="emp_nature"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;amp;options&lt;/P&gt;&lt;P&gt;&amp;lt;/select&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Mar 2015 13:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209674#M38888</guid>
      <dc:creator>Anand6666</dc:creator>
      <dc:date>2015-03-29T13:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: less options in Dropdown for HTML form</title>
      <link>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209675#M38889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't use comma between the generated &amp;lt;OPTION&amp;gt; tags.&lt;/P&gt;&lt;P&gt;You need to watch out for characters in your file that HTML will treat as special.&amp;nbsp; You should use HTMLENCODE() function to protect them.&lt;/P&gt;&lt;P&gt;You also might want to switch to using PROC STREAM instead of the custom DATA step.&amp;nbsp; Then you could write the values to a separate file using a data step and avoid the risk of the hitting the maximum macro variable or data step variable length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;select distinct&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;cats('&amp;lt;option value='&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,quote(htmlencode(trim(emp_nature),'amp lt gt quot apos 7bit'))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,'&amp;gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,htmlencode(trim(emp_nature),'amp lt gt quot apos 7bit')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,'&amp;lt;/option&amp;gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;into :options separated by ' '&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;from work.empnature&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Mar 2015 22:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209675#M38889</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-03-29T22:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: less options in Dropdown for HTML form</title>
      <link>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209676#M38890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the quick testing I did, the data step that reads the cards - the line var is created with a length of $200, so if you have many options, the html options syntax will quickly use up this space and you may end up with truncated html options code - the result is that only the first few options display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try adding a length statement e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _NULL_;&lt;/P&gt;&lt;P&gt;file _webout;&lt;/P&gt;&lt;P&gt;length line $2000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may even need to make this longer if there are many options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 03:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209676#M38890</guid>
      <dc:creator>MarkBodt_NZ</dc:creator>
      <dc:date>2015-03-30T03:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: less options in Dropdown for HTML form</title>
      <link>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209677#M38891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Mark.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your solution worked .. simple and precise &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 06:46:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209677#M38891</guid>
      <dc:creator>Anand6666</dc:creator>
      <dc:date>2015-03-30T06:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: less options in Dropdown for HTML form</title>
      <link>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209678#M38892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a ton TOM,&lt;/P&gt;&lt;P&gt;I have now a more refined working code &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 06:48:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/less-options-in-Dropdown-for-HTML-form/m-p/209678#M38892</guid>
      <dc:creator>Anand6666</dc:creator>
      <dc:date>2015-03-30T06:48:07Z</dc:date>
    </item>
  </channel>
</rss>

