BookmarkSubscribeRSS Feed
SASdevAnneMarie
Barite | Level 11

Hello Experts,

 

I'm wondering how to insert on proc sql the row at the and of data with the value LB_UT="Another value"

 

My code is :

 


proc sql;
create table test as select rga.LB_LONG as LB_UT from  PSAEU11.DB_RGA rga, PSAEU11.DB_DOSSIER sousc, PSAEU11.DB_CTRAT_SUPPORT db_ctrat,
             PSAEU11.DB_PROTOCOLE  proto, PSAEU11.DB_TIERS  tiers1,
             PSAEU11.DB_PERSONNE  personne1,
             PSAEU11.DB_PORTEFEUILLE  portef, PSAEU11.DB_TIERS  tiers2, PSAEU11.DB_PERSONNE  personne2,
             PSAEU11.DB_TIERS tiers3, PSAEU11.DB_PERSONNE personne3
             where personne2.S_RAISONSOC="UBS (FRANCE) S.A." and personne3.S_RAISONSOC="AMPLEGEST" and sousc.CD_DOSSIER in ('CHOP','CHOC') and sousc.LP_ETAT_DOSS not in ('ANNUL','A30','CLOSE')
             and sousc.IS_DOSSIER=db_ctrat.IS_DOSSIER
             and  sousc.is_protocole=proto.is_protocole
             and  sousc.is_tiers=tiers1.is_tiers
             and  tiers1.is_personne=personne1.is_personne
             and  (db_ctrat.ID_FAMILLE_PORTEF||' '||db_ctrat.ID_PORTEFEUILLE)=(portef.ID_FAMILLE_PORTEF||' '||portef.ID_PORTEFEUILLE)
             and  portef.is_tiers_depositaire=tiers2.IS_TIERS
             and  tiers2.is_personne=personne2.IS_PERSONNE
             and  sousc.IS_TIERS=tiers3.IS_TIERS
             and tiers3.is_personne=personne3.is_personne
             and db_ctrat.IS_RGA=rga.IS_RGA;
			 quit;

Thank you very much !

3 REPLIES 3
Tom
Super User Tom
Super User

What is it you want to do?
If you want to add an observation to an existing dataset use PROC APPEND of in PROC SQL use the INSERT statement.

SASdevAnneMarie
Barite | Level 11

Thank you, Tom,

 

I don't know how to do it in one step. This code doesn't work :

MarieT_0-1631903622699.png

 

PGStats
Opal | Level 21

Insert into is a separate SQL statement. You must end the preceeding statement with a semicolon before the select into statement.

PG

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1160 views
  • 1 like
  • 3 in conversation