DATA Step, Macro, Functions and more


Super Contributor
Posts: 713


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;

zip_ndc has three variablesSmiley Tongueatient_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.
Super Contributor
Super Contributor
Posts: 3,176

Re: update

Possibly consider a MERGE or MODIFY. From the SAS support 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.

DATA Step Programming Using the MODIFY Statement
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation