BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8
When importing data, the some of zip and ndc numbers are imported as '0' instead of their values.This happened after many loads.
How do I update/replace the dataset where the zip ad ndc numbers are '0''s with their original values.I have a dataset where I have the actual values.
I tried update as follows:
data final;
update spdata(where=provider='MEDCO' and file_date='2009-04)) zip_ndc;
by patient_id;
run;

zip_ndc has three variables:patient_id zip and ndc.
When I use patient_id in the by statement , it fails saying that there are multiple values under the by group.
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Possibly consider a MERGE or MODIFY. From the SAS support http://support.sas.com/ here is a technical document on the MODIFY statement in the DATA step processing. You must determine what SAS variables represent a sufficiently granular key (BY statement variable list) to perform the master file update.

Scott Barry
SBBWorks, Inc.

TS-250
DATA Step Programming Using the MODIFY Statement
http://support.sas.com/techsup/technote/ts250.html

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 623 views
  • 0 likes
  • 2 in conversation