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

thanks,
sasbase
1 REPLY 1
data_null__
Jade | Level 19
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]

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 938 views
  • 0 likes
  • 2 in conversation