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.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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