How to concatenate two fields and use as a key for query in SAS sql proc, as is done in the sql snippet of the example?

Asked

Viewed 27 times

-2

Good morning I’m a beginner in SAS and I’m having the following difficulty - Transform the snippet of sql code below to the format of proc sql in SAS.

The SQL code would look like this: Where cod_operadora || '|' || num_contrato in ('003 | 123456789', '001 | 987654321')

Detail: the cod_operator field is a text field and the num_contract field is a numeric field.

How I could convert the sql snippet to SAS proc sql, can help me?

2 answers

-1

You can use the CAT function CAT(Column A || '|'|| Column B) as Concat

-1

You will need to use the CONCAT function().

Ex: CONCAT(cod_operadora, ' | ', num_contrato)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.