BookmarkSubscribeRSS Feed
joon1
Quartz | Level 8

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

2 REPLIES 2
Astounding
PROC Star

 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.

joon1
Quartz | Level 8

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

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