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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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