DATA Step, Macro, Functions and more

How to get last 3 bytes in a variable

Reply
N/A
Posts: 0

How to get last 3 bytes in a variable

Hi,
I need to get last 3 bytes in a variable length variable, irrespective of what ever total length that variable is.

thanks,
sasbase
Respected Advisor
Posts: 3,799

Re: How to get last 3 bytes in a variable

Posted in reply to deleted_user
This looks promising.

[pre]
data test;
infile cards dlm=', .;';
input word :$24. @@;
length L3 $3;
L3= substrN(word,length(word)-2);
cards4;
Hi,
I need to get last 3 bytes in a variable length variable, irrespective of what ever total length that variable is.

thanks,
sasbase
;;;;
run;

proc contents;
run;
proc print;
run;
[/pre]
Ask a Question
Discussion stats
  • 1 reply
  • 114 views
  • 0 likes
  • 2 in conversation