<?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: stripping leading zeros in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/stripping-leading-zeros/m-p/60776#M17234</link>
    <description>I got it to work.  Thanks again for the help.&lt;BR /&gt;
&lt;BR /&gt;
Nick</description>
    <pubDate>Thu, 05 Aug 2010 13:27:26 GMT</pubDate>
    <dc:creator>nickb</dc:creator>
    <dc:date>2010-08-05T13:27:26Z</dc:date>
    <item>
      <title>stripping leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/stripping-leading-zeros/m-p/60772#M17230</link>
      <description>I'm using a data step to build up multiple ftp put statements and I need to remove all leading zeros.  The person ID is the value with the leading zeros.  I'm also trying to figure how to put the quit keyword after the last occurence.  I thought last. would work but it isn't coming out correctly.  &lt;BR /&gt;
&lt;BR /&gt;
Below is the data step.&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
set work.display_data;&lt;BR /&gt;
by person_id_nb;&lt;BR /&gt;
file max_pics;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
line1 = 'cd incoming';&lt;BR /&gt;
line2 = 'put \\location\of\thepics' ||trim(person_id_nb) || '.jpg';&lt;BR /&gt;
Line3 = 'quit';&lt;BR /&gt;
&lt;BR /&gt;
if _N_ = 1 then put line1;&lt;BR /&gt;
put line2;&lt;BR /&gt;
if  _N_ = lastobs then put line3;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 05 Aug 2010 12:45:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/stripping-leading-zeros/m-p/60772#M17230</guid>
      <dc:creator>nickb</dc:creator>
      <dc:date>2010-08-05T12:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: stripping leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/stripping-leading-zeros/m-p/60773#M17231</link>
      <description>Suggest checking the forum archives with SEARCH -- it's a popular topic.  Also, you could use the END= keyword on the SET statement to detect the end-of-file condition.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.

Message was edited by: sbb</description>
      <pubDate>Thu, 05 Aug 2010 13:02:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/stripping-leading-zeros/m-p/60773#M17231</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-08-05T13:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: stripping leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/stripping-leading-zeros/m-p/60774#M17232</link>
      <description>Nick,&lt;BR /&gt;
&lt;BR /&gt;
try somewhat along these lines:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data ids ; id='00123' ; output ; id='04567' ; output ; stop ; run ;&lt;BR /&gt;
data _null_ ;                                                      &lt;BR /&gt;
  set ids end=lastobs ;                                            &lt;BR /&gt;
  if _n_ = 1 then put 'cd incoming' ;                              &lt;BR /&gt;
  idnum = input(id,best.) ;                                        &lt;BR /&gt;
  put 'put \\your_location\' idnum +(-1) '.jpg' ;                  &lt;BR /&gt;
  if lastobs then put 'quit' ;                                     &lt;BR /&gt;
run ;                                                              &lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Robert

Message was edited by: Robert.Bardos</description>
      <pubDate>Thu, 05 Aug 2010 13:12:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/stripping-leading-zeros/m-p/60774#M17232</guid>
      <dc:creator>Robert_Bardos</dc:creator>
      <dc:date>2010-08-05T13:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: stripping leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/stripping-leading-zeros/m-p/60775#M17233</link>
      <description>That works great but what if the id's are coming from a temporary data set?</description>
      <pubDate>Thu, 05 Aug 2010 13:19:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/stripping-leading-zeros/m-p/60775#M17233</guid>
      <dc:creator>nickb</dc:creator>
      <dc:date>2010-08-05T13:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: stripping leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/stripping-leading-zeros/m-p/60776#M17234</link>
      <description>I got it to work.  Thanks again for the help.&lt;BR /&gt;
&lt;BR /&gt;
Nick</description>
      <pubDate>Thu, 05 Aug 2010 13:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/stripping-leading-zeros/m-p/60776#M17234</guid>
      <dc:creator>nickb</dc:creator>
      <dc:date>2010-08-05T13:27:26Z</dc:date>
    </item>
  </channel>
</rss>

