<?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: Format numeric value to character in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Format-numeric-value-to-character/m-p/890336#M351804</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;id_f_f = catx("-",put(id_f,z4.),put(f,z3.));&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 22 Aug 2023 08:55:38 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-08-22T08:55:38Z</dc:date>
    <item>
      <title>Format numeric value to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-numeric-value-to-character/m-p/890333#M351802</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a data ID_F and F (in numeric format), I would like to put the ID_F in format 0000 and F in 000 format.&lt;/P&gt;
&lt;P&gt;Do you know how to do it easily beacause I apply Repet function with IF THEN ELSE condition. Maybe there is some format statement ? I joined the data. Thank you for your help !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="286"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="98"&gt;ID_F (numeric)&lt;/TD&gt;
&lt;TD width="80"&gt;F (numeric)&lt;/TD&gt;
&lt;TD width="108"&gt;ID_F-F (character)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;73&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;0073-001&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;83&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;0083-002&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;45&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;0045-004&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;23&lt;/TD&gt;
&lt;TD&gt;0001-023&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;453&lt;/TD&gt;
&lt;TD&gt;23&lt;/TD&gt;
&lt;TD&gt;0453-023&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Tue, 22 Aug 2023 08:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-numeric-value-to-character/m-p/890333#M351802</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-08-22T08:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Format numeric value to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-numeric-value-to-character/m-p/890336#M351804</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;id_f_f = catx("-",put(id_f,z4.),put(f,z3.));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Aug 2023 08:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-numeric-value-to-character/m-p/890336#M351804</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-08-22T08:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Format numeric value to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-numeric-value-to-character/m-p/890338#M351805</link>
      <description>Thank you, Kurt!</description>
      <pubDate>Tue, 22 Aug 2023 09:00:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-numeric-value-to-character/m-p/890338#M351805</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-08-22T09:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Format numeric value to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-numeric-value-to-character/m-p/890340#M351806</link>
      <description>&lt;P&gt;For the future: do not bother to attach Excel files.&lt;/P&gt;
&lt;P&gt;Many of us won't (or even can't, for security reasons) download Office files.&lt;/P&gt;
&lt;P&gt;Excel spreadsheets do not have the concept of fixed&amp;nbsp; column attributes.&lt;/P&gt;
&lt;P&gt;I would have needed to&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;download the file&lt;/LI&gt;
&lt;LI&gt;upload it to my ODA account&lt;/LI&gt;
&lt;LI&gt;run PROC IMPORT, with no guarantee that the resulting dataset looks like yours&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;For simple issues (like this here), the values and description are sufficient. For more complex issues, post DATA step code (with DATALINES), so we can&amp;nbsp;&lt;EM&gt;exactly&lt;/EM&gt; recreate your dataset with simple copy/paste and submit. It's less work for you and for us.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 09:07:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-numeric-value-to-character/m-p/890340#M351806</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-08-22T09:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Format numeric value to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-numeric-value-to-character/m-p/890342#M351807</link>
      <description>OK Kurt, &lt;BR /&gt;Thank you !</description>
      <pubDate>Tue, 22 Aug 2023 09:33:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-numeric-value-to-character/m-p/890342#M351807</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-08-22T09:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Format numeric value to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-numeric-value-to-character/m-p/890366#M351808</link>
      <description>&lt;P&gt;Suggestion: your subject line should read something like "create character variable from numeric&amp;nbsp; values".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please avoid the use of the word "Format" unless you mean a SAS Format. Format has very specific meaning in SAS related to display of values. Run Proc Contents on any of your data sets and you will see the Format is property of variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For instance the Format to display a numeric value with a fixed number of characters and leading zeroes is the Zw.d format where W is the number of characters and D is the number of decimal positions to show.&lt;/P&gt;
&lt;P&gt;A format of Z4. will display an integer value with 4 characters padding leading zeroes as needed.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 11:31:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-numeric-value-to-character/m-p/890366#M351808</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-08-22T11:31:04Z</dc:date>
    </item>
  </channel>
</rss>

