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.

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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