04-14-2015 01:09 PM
I have 2 SAS tables, HRIS and FAKC. Both tables have a unique ID of NBKID. The HRIS table has 276,438 records, and the FAKC table has 415 records.
I need a SAS procedure to update records in the HRIS table, based on fields in the FAKC table.
Specifically, when the NBKID’s match, I need to update the HRIS table field LobName, with the FAKC table field value FakcLobName, and the field AltLob with the value “FAKC”.
Actually I need to update other fields as well, but if you can help me with this, I can probably figure the rest out
I'm new to SAS and just learning, so please be specific in you reply.
Thanks in advance for your help
04-14-2015 01:16 PM
Assuming all fields need to be updated and that if a record isn't found in HRIS table it needs to be added use the UPDATE statement.
04-14-2015 01:32 PM
All fields do not need to be updated (HRIS has 151 fields & FAKC has 26 fields). The only fields that need to be updated are AltLob & LobName.
The HRIS LobName field needs to be updated with the value of the FAKC LobName field. And the AltLob field needs to be populated with "FAKC".
All of the records in the FAKC table have a matching record in the HRIS table. But not visa versa.
Please provide the required code or an example of how to use the Update statement. I'm new to SAS and just learning.
04-14-2015 02:21 PM
The links above have code and detailed comments. If you only have certain fields that need updating only keep those in your dataset use the keep = on the update statement.
update master transaction(keep=nbkid field1_update field2_update);