From: Sri on

Hi,

What are the possible ways of removing first character and last 3
characters from a string.
eg. variable values: A876479003, A675846003, A6842003

Thanks,
Sri
From: Ya on
On May 14, 2:28 pm, Sri <sriseep...(a)gmail.com> wrote:
> Hi,
>
> What are the possible ways of removing first character and last 3
> characters from a string.
> eg. variable values: A876479003, A675846003, A6842003
>
> Thanks,
> Sri

short=substr(long,4,length(long)-6);
From: Arthur Tabachneck on
Sri,

I think that a slight variant of Ya's suggested code will do what you
want. For example:

data want;
set have;
want=substr(have,2,length(have)-4);
run;

HTH,
Art
-----------
On May 14, 5:30 pm, Ya <huang8...(a)gmail.com> wrote:
> On May 14, 2:28 pm, Sri <sriseep...(a)gmail.com> wrote:
>
> > Hi,
>
> > What are the possible ways of removing first character and last 3
> > characters from a string.
> > eg. variable values: A876479003, A675846003, A6842003
>
> > Thanks,
> > Sri
>
> short=substr(long,4,length(long)-6);