DATA Step, Macro, Functions and more

Import problem after merging the STATA file

Posts: 20

Import problem after merging the STATA file



I have the merged dataset between SAS file and STATA file. When I try to import this merged dataset, I face the following error message. It will be grateful if you suggest how to resolve this issue. Thank you



3 Libname temp1 'C:\Users\hakjoon\Documents\social capital and internal control quality\Data';

NOTE: Libref TEMP1 was successfully assigned as follows:

Engine: V9

Physical Name: C:\Users\hakjoon\Documents\social capital and internal control quality\Data

4 data k44; set temp1.finaldata; run;

ERROR: The format REGION was not found or could not be loaded.

NOTE: The SAS System stopped processing this step because of errors.

WARNING: The data set WORK.K44 may be incomplete. When this step was stopped there were 0

observations and 278 variables.

NOTE: DATA statement used (Total process time):

real time 0.32 seconds

cpu time 0.09 seconds

Super User
Posts: 6,754

Re: Import problem after merging the STATA file

[ Edited ]

 As a temporary workaround, you can work with this data by using this line of code first:


options nofmterr;


If you run a PROC CONTENTS on this data set, you will see that at least one variable as a format connected to it.  And the name of the format is REGION.  In theory, that format would take the actual variable values and allow them to be displayed in a "translated" format that is easier for the reader to identify.  For example, it might create this effect:


Instead of printing 1, print "Northeast".

Instead of printing 2, print "South".

Instead of printing 3, print "West Coast".


You can easily find the variable(s) from the PROC CONTENTS output, and find their actual values by examining the data.  It might be harder to track down what the translations are supposed to be.  So far,  you are missing that piece.

Posts: 20

Re: Import problem after merging the STATA file

Posted in reply to Astounding

Hi Astounding,


I am sorry for late response. After doing 'proc content', i find the following variable.




regionNum8REGION. region


In the original dataset, the following is categories of 'region'.

The SAS System


The FREQ Procedure
region Frequency Percent Cumulative
Frequency Cumulative
Percent midwest northeast south west

I still don't know how to fix this import problem. Could you please advise it more easily?


Thank you

Ask a Question
Discussion stats
  • 2 replies
  • 1 like
  • 2 in conversation