In SAS proc sql, incrementing can be done using the following ways:
proc sql;
select max(id)+1 into :new_id from my_table;
quit;
proc sql;
select id, calculated id+1 as new_id
from my_table;
quit;
data my_table;
set my_table;
new_id = id + 1;
run;
Note: The above examples assume the variable being incremented is called "id".
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-09-04 11:00:00 +0000
Seen: 8 times
Last updated: Mar 17 '22
How can ADOMD.NET be used to deploy UDFs (User defined functions) to SSAS?
How can a database in SQL Server Managed Instance be backed up to the local file system?
How can a file be restored on Google Cloud for SQL Server 2019 without the use of buckets?
How does MySQL master-slave replication work on Windows?
What is the SAS coding method to change Row 1 into a variable without using proc SQL?
What is the process for creating a Checkbox List using Entity Framework in ASP.Net core web api?
How can a counter be added specifically for one record using SQL/SAS?
What is the process for installing SASS/Compass in the DDEV web container?