BookmarkSubscribeRSS Feed
Rita2021
Calcite | Level 5

Hello,

 

I have a base that has cnpj and I want to take the cnpj14 field which is in number and transform it to 8

I have for example string below:

Remember that there may be a leading zero and it is not for counting

data one;
val=1234567;
val1=substr(left(val),1,4); run;
How can i proceed?
And another subject how can I convert where filter to text in sql server via sas??
Thank you very much.
 
Rita 
1 REPLY 1
ChrisNZ
Tourmaline | Level 20

Hi Rita,

You need is unclear, you might want to explain more. What's wrong with your code?

Also, please start a new thread for the second question (which is also unclear)

Also please use the appropriate icon when posting code to make it more legible.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 646 views
  • 0 likes
  • 2 in conversation