BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
drichmo1
Fluorite | Level 6

Hi I was wondering if there is a way to divide a row by a constant, for example, by 3?

 

Thanks, 

 

David 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

And only because DO OVER is deprecated:

 

const = 3;

array num _NUMERIC_;

do i=1 to dim(num);
    num = num / const; 
end;

 

View solution in original post

7 REPLIES 7
Shmuel
Garnet | Level 18

it is possible:

 

const = 3;

array num _NUMERIC_;

do over num; num = num / const; end;

Reeza
Super User

And only because DO OVER is deprecated:

 

const = 3;

array num _NUMERIC_;

do i=1 to dim(num);
    num = num / const; 
end;

 

Shmuel
Garnet | Level 18

Reeza, may I ask what do you mean by "deprecated" ?

 

I have tested the code, as wriiten originally with DO OVER and it worked without any syntax and even not a anote in the log.

 

As mutch as I know,  DO OVER and DO ... FROM ... TO ... can't be used in same data step. 

Is that the reason ?

Reeza
Super User

No longer recommended. 

For example - I can't find any reference to Do Over in 9.3/9.4 documentation.

It's still supported as legacy code. 

 

Wow...this apparently was from V7 which is in 2000. 

 

http://support.sas.com/techsup/notes/v8/1/780.html

 

 

Beginning with SAS OnlineDoc, Version 7-1, documentation for implicitly subscripted arrays and any related topics (e.g. DO OVER) has been removed. As noted in SAS Language: Reference, Version 6, First Edition, p. 297, implicit arrays are supported only for compatibility with previous releases of the SAS System. These obsolete features have been removed from the documentation to discourage their use in new program development.
Shmuel
Garnet | Level 18

Reeza, Thanks a lot.

 

I'm still using SAS OnLine Doc. of 9.2 version and beeing in age of 70 explains it.

Reeza
Super User

@Shmuel wrote:

 

I'm still using SAS OnLine Doc. of 9.2 version and beeing in age of 70 explains it.


👍🏽🙂

Ksharp
Super User
It is IML thing. IML code is special for vector operation .

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 7 replies
  • 1132 views
  • 2 likes
  • 4 in conversation