Prezados,
É possivel criar um campo auto numerado (IDENTITY) no SAS? Quais são as maneiras de fazer esse processo?
Ex:
CREATE TABLE exemplo
(
COD_CLI INT IDENTITY,
NOME VARCHAR(50),
EMAIL VARCHAR(50)
CONSTRAINT EXEMPLO_PK_COD_CLI PRIMARY KEY(COD_CLI)
);
Obrigado pela atenção!
No, there is no identity option in SAS. Perhaps the undocumented monotonic() function could be useful
http://www.amadeus.co.uk/sas-technical-services/tips-and-techniques/sql/the-monotonic-function/.
No, there is no identity option in SAS. Perhaps the undocumented monotonic() function could be useful
http://www.amadeus.co.uk/sas-technical-services/tips-and-techniques/sql/the-monotonic-function/.
TomKari, Boa Tarde!
Eu consegui, utilizei o exemplo que você passou.
Muito Obrigado!
Seja bem-vindo!
Tom
Obrigado!
I will not ust that undocumented function for the sake of risk. I would like use ODS.
ods listing close;
ods output sql_results=want;
proc sql number;
select * from sashelp.class;
quit;
ods listing;
Ksharp
Ksharp, Bom Dia!
Você tem um exemplo de como usar o código que você mostrou?
Ex:
PROC SQL;
CREATE TABLE MINHA_TABELA AS
SELECT * FROM TABELA_BASE;
RUN;
Please English first . I have to go to sleep now. will be back soon after a beauty sleep.
Ksharp, Good Day!
Do you have an example of how to use the code you showed?
Ex:
PROC SQL;
CREATE TABLE MINHA_TABELA AS
SELECT * FROM TABELA_BASE;
RUN;
Olá. Just follow what Ksharp wrote :
ods listing close;
ods output sql_results=MINHA_TABELA;
proc sql number;
select * from TABELA_BASE;
quit;
ods listing;
The first statement prevents the printing of query results. The second statement directs the query result to dataset MINHA_TABELA. Option number adds a column in the query result to contain record numbers. The last statement restores normal result printing.
MINHA_TABELA will contain the same columns as TABELA_BASE with an extra column for record numbers.
PG
PG, Thanks. So detail explanation for me .
Ksharp
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!
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.