DATA Step, Macro, Functions and more

Import problem after merging the STATA file

Reply
New Contributor
Posts: 3

Import problem after merging the STATA file

Hi,

 

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: 5,081

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.

New Contributor
Posts: 3

Re: Import problem after merging the STATA file

Hi Astounding,

 

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

 

 

241

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
421418.61421418.61
547424.17968842.78
651528.771620371.55
644428.4522647100.00

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
  • 100 views
  • 1 like
  • 2 in conversation