<?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: Question to convert the field type in Data Management Studio 2.4 in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Re-Question-to-convert-the-field-type-in-Data-Management-Studio/m-p/202929#M4484</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This was answered here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="269845" __jive_macro_name="message" class="jive_macro jive_macro_message" href="https://communities.sas.com/" modifiedtitle="true" title="Re: Question to include value '0' as prefix for the field values in Data Management Studio 2.4"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but to save you a click here is the solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;/* Pre-processing Expression*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;string desired_output&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;hidden integer i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;desired_output = ''&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;i = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;/*Expression*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if len(`COCD`) &amp;lt; 4&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; begin&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; desired_output = `COCD`&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; while i &amp;lt;&amp;nbsp; (4 - len(`COCD`))&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; begin&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; desired_output = '0' &amp;amp; desired_output&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; i = i + 1&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; end&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; end&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;else&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; desired_output = `COCD`&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; i = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" href="https://communities.sas.com/servlet/JiveServlet/showImage/2-269845-10155/dm_expression.png" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;&lt;IMG alt="dm_expression.png" class="jive-image jiveImage" height="207" src="https://communities.sas.com/legacyfs/online/10156_dm_expression.png" style="border: 0px; font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px; font-family: inherit;" width="207" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Apr 2015 17:17:19 GMT</pubDate>
    <dc:creator>skillman</dc:creator>
    <dc:date>2015-04-24T17:17:19Z</dc:date>
    <item>
      <title>Re: Question to convert the field type in Data Management Studio 2.4</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Re-Question-to-convert-the-field-type-in-Data-Management-Studio/m-p/202928#M4483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried the above tostring function and it is working fine. Thank you so much for the above solution and also regret for the late reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one more question to ask, I have the field COCD with the len 1, 2, 3, and 4 digits. The COCD column must consist of 4 len number as per our requirement so i have to prefix each company code with '0' to make it 4 digit. Is there any solution or functionality i can use to change the len to 4 digits?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used below the expression but not yielding result:&lt;/P&gt;&lt;P&gt;if len(COCD) == 1 then cocd_text = left(000,COCD)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="WIDTH: 198px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" width="78"&gt;COCD&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none;" width="120"&gt;Required Output &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: medium none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;0001&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: medium none;"&gt;2&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;0002&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: medium none;"&gt;11&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;0011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: medium none;"&gt;22&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;0022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: medium none;"&gt;333&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;0333&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" style="border-top: medium none;"&gt;4444&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none; border-top: medium none;"&gt;4444&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shaheen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2015 10:30:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Re-Question-to-convert-the-field-type-in-Data-Management-Studio/m-p/202928#M4483</guid>
      <dc:creator>Shah</dc:creator>
      <dc:date>2015-04-23T10:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Question to convert the field type in Data Management Studio 2.4</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Re-Question-to-convert-the-field-type-in-Data-Management-Studio/m-p/202929#M4484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This was answered here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="269845" __jive_macro_name="message" class="jive_macro jive_macro_message" href="https://communities.sas.com/" modifiedtitle="true" title="Re: Question to include value '0' as prefix for the field values in Data Management Studio 2.4"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but to save you a click here is the solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;/* Pre-processing Expression*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;string desired_output&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;hidden integer i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;desired_output = ''&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;i = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;/*Expression*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if len(`COCD`) &amp;lt; 4&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; begin&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; desired_output = `COCD`&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; while i &amp;lt;&amp;nbsp; (4 - len(`COCD`))&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; begin&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; desired_output = '0' &amp;amp; desired_output&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; i = i + 1&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; end&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; end&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;else&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; desired_output = `COCD`&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; i = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" href="https://communities.sas.com/servlet/JiveServlet/showImage/2-269845-10155/dm_expression.png" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;&lt;IMG alt="dm_expression.png" class="jive-image jiveImage" height="207" src="https://communities.sas.com/legacyfs/online/10156_dm_expression.png" style="border: 0px; font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px; font-family: inherit;" width="207" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2015 17:17:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Re-Question-to-convert-the-field-type-in-Data-Management-Studio/m-p/202929#M4484</guid>
      <dc:creator>skillman</dc:creator>
      <dc:date>2015-04-24T17:17:19Z</dc:date>
    </item>
  </channel>
</rss>

