Prev: What is thenature of this error: ERROR: You cannot open WORK._CONVERTDATA.DATA for output access with member-level control because WORK._CONVERTDATA.DATA is in use by
Next: Remove first and last 3 characters of a string
From: Sri on 14 May 2010 17:28 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 14 May 2010 17:30 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 14 May 2010 20:44
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); |