<?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: Need to create new colunm base on old data and add leading zero in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-new-colunm-base-on-old-data-and-add-leading-zero/m-p/956022#M373335</link>
    <description>&lt;P&gt;Thankyou so much.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jan 2025 08:22:59 GMT</pubDate>
    <dc:creator>Ekapat</dc:creator>
    <dc:date>2025-01-14T08:22:59Z</dc:date>
    <item>
      <title>Need to create new colunm base on old data and add leading zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-new-colunm-base-on-old-data-and-add-leading-zero/m-p/956015#M373329</link>
      <description>&lt;P&gt;Hi, I have some question&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I have X , Y , Z&amp;nbsp;&lt;/P&gt;&lt;P&gt;and need to create new Xcode , Ycode , Zcode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ekapat_0-1736841416866.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103697i34DF81D93424D37D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ekapat_0-1736841416866.png" alt="Ekapat_0-1736841416866.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to coding on SAS, can I use proc sql ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thankyou so much&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 07:58:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-new-colunm-base-on-old-data-and-add-leading-zero/m-p/956015#M373329</guid>
      <dc:creator>Ekapat</dc:creator>
      <dc:date>2025-01-14T07:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create new colunm base on old data and add leading zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-new-colunm-base-on-old-data-and-add-leading-zero/m-p/956017#M373331</link>
      <description>&lt;P&gt;We can't write code using a picture as data source, so please post data in usable form (a data step using datalines), so that we have all the information required to help you.&lt;/P&gt;
&lt;P&gt;Why do you want to use proc sql?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 08:05:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-new-colunm-base-on-old-data-and-add-leading-zero/m-p/956017#M373331</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2025-01-14T08:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create new colunm base on old data and add leading zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-new-colunm-base-on-old-data-and-add-leading-zero/m-p/956020#M373333</link>
      <description>&lt;P&gt;If x, y and z are numeric, this should give the expected result:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    
    length xCode yCode zCode 8;
    format xCode yCode zCode z2.;
    
    xCode = x;
    yCode = y - 10 * x;
    zCode = z - 10 * y;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jan 2025 08:19:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-new-colunm-base-on-old-data-and-add-leading-zero/m-p/956020#M373333</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2025-01-14T08:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create new colunm base on old data and add leading zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-new-colunm-base-on-old-data-and-add-leading-zero/m-p/956021#M373334</link>
      <description>&lt;P&gt;Sorry please find&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data have;&lt;BR /&gt;infile datalines delimiter=',';&lt;BR /&gt;input X $ Y $ Z $ ;&lt;BR /&gt;datalines;&lt;BR /&gt;1,12, 124&lt;BR /&gt;3,33,334&lt;BR /&gt;10,101,1018&lt;BR /&gt;5,54,543&lt;BR /&gt;9,94,943&lt;BR /&gt;2,28,286&lt;BR /&gt;4,47,471&lt;BR /&gt;3,35,352&lt;BR /&gt;4,48,484&lt;BR /&gt;10 102 1027&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 08:21:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-new-colunm-base-on-old-data-and-add-leading-zero/m-p/956021#M373334</guid>
      <dc:creator>Ekapat</dc:creator>
      <dc:date>2025-01-14T08:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create new colunm base on old data and add leading zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-new-colunm-base-on-old-data-and-add-leading-zero/m-p/956022#M373335</link>
      <description>&lt;P&gt;Thankyou so much.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 08:22:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-new-colunm-base-on-old-data-and-add-leading-zero/m-p/956022#M373335</guid>
      <dc:creator>Ekapat</dc:creator>
      <dc:date>2025-01-14T08:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Need to create new colunm base on old data and add leading zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-create-new-colunm-base-on-old-data-and-add-leading-zero/m-p/956067#M373350</link>
      <description>&lt;P&gt;Are you sure that is even possible?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you want to pull out the least significant digit.&lt;/P&gt;
&lt;P&gt;But then you have this line with X=4 Y=47 and Z=4710.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can any of the three codes be more than one digit?&amp;nbsp; If so how to you determine where to set the boundaries?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What if you have Z=1111&amp;nbsp; is that 1,1,11 ? or perhaps 1,11,1 or perhaps 11,1,1.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 14:32:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-create-new-colunm-base-on-old-data-and-add-leading-zero/m-p/956067#M373350</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-01-14T14:32:03Z</dc:date>
    </item>
  </channel>
</rss>

