DATA Step, Macro, Functions and more

Infile error

Reply
Occasional Contributor
Posts: 5

Infile error

Hi

I'm trying to import data, using the SAS Enterprise guide 9.2.
I've made a copy of a bunch of dbf-files, and want to import them in SAS.

However, for two of them it works out perfectly, but for three of them I get an error saying:
ERROR: File is in use, C:\Documents and Settings\tder\Local
Settings\Temp\SEG588\Bonsuit-1afed9ac1d624546a5506bdb837f5867.txt.
NOTE: The SAS System stopped processing this step because of errors.

Looking at the code, it uses first a DATA step and then an infile statement. The error occurs during that infile procedure.

Of course, the file isn't in use or opened in any way, and I can't figure out what else might be the problem. Especially because two files, which I copied and used in the same way, were imported without a problem.

Thanks for the help,
Thomas
Super Contributor
Super Contributor
Posts: 3,174

Re: Infile error

Use of INFILE is not normally a standalone "procedure" but it is part of a DATA step. You will receive a most effective response if you take the time to share your SAS-generated log that gets the error - ideally, the entire log with all SAS code revealed.

Also, there are SAS NOTEs regarding the "file in use" message you are receiving.

Lastly, information about your SAS version, OS platform, whether executing SAS local or remote-connected will help as well.

Scott Barry
SBBWorks, Inc.
Occasional Contributor
Posts: 5

Re: Infile error

Ok, I'm working with SAS 9.2, on Windows, with a SAS local connection.

This is the complete log that gets the error. I had only included a part of it in the previous post.

Code generated by a SAS task

Generated on Friday, April 16, 2010 at 2:01:02 PM
By task: Import Data

Source file: F:\DLA\MEET EN WEETCEL\E -
Documentatie\Documentatie\Databestanden\Cultuur, Jeugd,
Sport\CWB\DATA CWB 20100414\Bonsuit.DBF
Server: Local File System

Output data: SASUSER.Bonsuit10
Server: Local
-------------------------------------------------------------------- */

/* --------------------------------------------------------------------
This DATA step reads the data values from a temporary text file
created by the Import Data task. The values within the temporary
text file were extracted from the dBase file.
-------------------------------------------------------------------- */
24 DATA SASUSER.Bonsuit10;
25 LENGTH
26 BONID $ 13
27 AANVRAAGID $ 8
28 GIDS 8
29 SEIZOENID $ 4 ;
30 FORMAT
31 BONID $CHAR13.
32 AANVRAAGID $CHAR8.
33 GIDS BEST12.
34 SEIZOENID $CHAR4. ;
35 INFORMAT
36 BONID $CHAR13.
37 AANVRAAGID $CHAR8.
38 GIDS BEST12.
39 SEIZOENID $CHAR4. ;
40 INFILE 'C:\Documents and Settings\tder\Local
40 ! Settings\Temp\SEG5868\Bonsuit-cfc0e737ab5e41eb9226176a36705da1.txt'
41 LRECL=1
42 ENCODING="WLATIN1"
43 TERMSTR=CRLF
44 DLM='7F'x
45 MISSOVER
46 DSD ;
47 INPUT
48 BONID : $CHAR13.
49 AANVRAAGID : $CHAR8.
50 GIDS : BEST32.
51 SEIZOENID : $CHAR4. ;
52 RUN;

2 The SAS System 13:59 Friday, April 16, 2010

ERROR: File is in use, C:\Documents and Settings\tder\Local
Settings\Temp\SEG5868\Bonsuit-cfc0e737ab5e41eb9226176a36705da1.txt.
NOTE: The SAS System stopped processing this step because of errors.

WARNING: The data set SASUSER.BONSUIT10 may be incomplete. When this step was stopped there were 0
observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds


53
54 QUIT; RUN;
55

I had already checked the SAS notes, especially "Problem Note 18166: DATA step with data lines may fail in SAS Enterprise Guide".

The suggestion to add DLM='09'x doesn't work. (I've replaced DLM='7F'x by that.)

Thomas
Trusted Advisor
Posts: 2,116

Re: Infile error

Since this problem is in code and data generated by SAS itself, you are probably going to need to call tech support to get it resolved.

An alternative approach to import would be to use ODBC; however that depends on your software supporting the .dbf file type providing it.
Occasional Contributor
Posts: 5

Re: Infile error

Ok, thanks for the answer.
I think I'll go for the tech support.
Ask a Question
Discussion stats
  • 4 replies
  • 1126 views
  • 0 likes
  • 3 in conversation