I'm used to coding in MatLab, SAS is still new to me when using Do Loops. My goal is to check the row above/before the current row to see if the current and previous row numbers match. If the vector data above the first row matches the current row,…
I have a dataset like the one below, and I am trying to take a running total of events 2 and 3, with a slight twist. I only want to count these events when the Event_1_dt is less than the date in the current record. I'm currently using a macro %do…
I've been trying to rename a set of variables from a scale using arrays and DO loops, but without success. This seems like a very simple task. Any advice on where I'm going wrong?
ARRAY ATRSS (i) ATRSS_1 ATRSS_12 ATRSS_13 ATRSS_25 ATRSS_29 ATRSS_30…
I was having trouble getting the do-while loop to stop after the user has attempted to guess the number 7 times. I'm not sure exactly how to tell the loop to stop and display the timeout message.
Thank you, I appreciate any help!
Code:
import…
I have a lot of sas dataset files that starts with "s" followed by some numbers like s1 s7 s13 s32 etc. (I have a lot).
For each files I run a set of codes, save my last result and then restart with with the following dataset file. Normally, when my…
I am running Mathematica 7, and I am trying to run a simple Do loop in parallel, using ParallelDo. The following standard, sequential code works fine:
len = 10;
A = Table[0, {len}];
Do[
A[[i]] = i*10;
, {i, 1, len}]
However, if I use…
Why does the following code execute six times? Please help me to understand how this works, as I've tried to get it into my head without success.
I thought it would first execute the code once, then increase count to 1, execute it a second time,…
I have this code here:
Dim MasterIndex As String()()
Private Function Lookup(ByVal Search_path As String) As Integer
Dim i As Integer = 0
Do Until MasterIndex(i)(0) Is Nothing
If Search_path = MasterIndex(i)(0) Then
…
I’m aware of Fortran’s column major ordering and to ensure the inner-most loop is indexing the first dimension of the array. What I’m unsure about is which of the following would be faster:
do k=1,100
do j=1, 12
x(:,k) * y(j,:)
…
I have the following subroutine, which is my stepper function in a bigger DEM program. It computes every interaction between particles i and j, then updates the forces. I am now trying, as a first effort, to parallelize this thick O(N^2) loop,…
New to VBA, and I'm attempting to build a Macro that will loop through data that is using a Vlookup to fill in one cell that connects to a different Excel Sheet. I've successfully been able to get the Macro to work, however, it won't stop!
My goal…
Hi I'm new to javascript and I'm sorry if my question is silly for you.
This question was solved with the following code:
let arr = [12, 6, 53]
let a
do {
a = prompt("Enter a number")
a = Number.parseInt(a)
arr.push(a)
}
while (a !=…
Here is my problem: I have a fortran code with a certain amount of nested loops and first I wanted to know if it's possible to optimize (rearranging) them in order to get a time gain? Second I wonder if I could use OpenMP to optimize them?
I have…
I need my loop to check for existing part numbers and only if there is no existing part number to add it to my table. If the part number already exists, to have a message box stating that it already exists. Its adding it to my table just fine, but…
I am doing repeated measure analysis in SAS and I am comparing the differences in the covariance structure information criteria. Rather than just doing each individual analysis I am looking for a way to loop through them and save the outputs to a…