- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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/.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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/.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
TomKari, Boa Tarde!
Eu consegui, utilizei o exemplo que você passou.
Muito Obrigado!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Seja bem-vindo!
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Obrigado!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Please English first . I have to go to sleep now. will be back soon after a beauty sleep.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
PG, Thanks. So detail explanation for me .
Ksharp