SAS Import Error

Reply
New User
Posts: 1

SAS Import Error

I need help resolving a SAS Import Error.

 

Here is my code

PROC IMPORT OUT= WORK.TInformation2

DATAFILE= "z:\Injury Epi Files\Datasets\CFR\Prelim 2016\08.04.16\tINF2.txt"

DBMS=TAB REPLACE;

GETNAMES=YES;

DATAROW=2;

GUESSINGROWS=6000;

 

RUN;

 

Below is the error message I received.

 

NOTE: The infile 'z:\Injury Epi Files\Datasets\CFR\Prelim 2016\08.04.16\tINF2.txt' is:

Filename=z:\Injury Epi Files\Datasets\CFR\Prelim 2016\08.04.16\tINF2.txt,

RECFM=V,LRECL=32767,File Size (bytes)=2336978,

Last Modified=04Aug2016:10:38:48,

Create Time=17Nov2016:08:55:51

NOTE: Invalid data for INFbrmilk in line 8759 369-430.

NOTE: Invalid data for INFfoodunk in line 8759 451-458.

NOTE: Invalid data for INFmalvicna in line 8759 461-469.

RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0

8759CHAR 183549.31.0.3.8.1588.2.0.2..4.0.4.0.3.0.2..0.0.9.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0..9.1.

ZONE 3333330330303030333303030300303030303030300303030303030303030303030303030303030303030303030303003030

NUMR 1835499319093989158892909299490949093909299090999090909090909090909090909090909090909090909090999919

101 1.9.1.1.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1.0.0..0.1..1.1..1..1..1.2.2..1.1.DIC with severe metabolic

ZONE 3030303030303030303030303030303030303030303030030300303003003003030300303044427676276767626676666662

NUMR 199919191909090909090909090909090909090919090990919919199199199192929919194930794803565250D5412FC930

9 The SAS System 06:42 Wednesday, June 21, 2017

RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0

201 acidosis, and oliguria â€" hypotension ..1.0.1.1.1.1.0.1.0..1.0.0.0.0.0.0.0.0.1.1.1.1.1.pupils fixed

ZONE 66666767226662666677662E8926776766766620030303030303030303003030303030303030303030303030777667266766

NUMR 1394F393C01E40FC97529102030890F45E39FE099190919191919091909919090909090909090919191919190509C3069854

301 -hypoypnic,no gag,no spontanious limb movements.2..2..1.IV Meds: .D5W, Dopamine drip, TPN, phytona

ZONE 2677677666266266626627766766667726666266766667703003003045246673222043522467666662676722554227677666

NUMR D890F90E93CEF0717CEF030FE41E9F530C9D20DF65D5E43929929919960D543A0009457C04F01D9E504290C040EC00894FE1

401 dione, ampicillin, cefotaxime. .0.0..0..0..1.IV Meds: .D5W, TPN,.0. 472

ZONE 666662266766666662266667676662222222030300300300304524667320435225542030

NUMR 49FE5C01D0939CC9EC0356F4189D5E00000090909909909919960D543A09457C040EC909

id=183549 INFgestage=31 INFgestunk=0 INFbirthwt=3 INFbirthwtounc=8 INFbirthwtgrams=1588 INFbirthwtcat=2 INFbirthwtunk=0

INFmultbirth=2 INFmultnum=. INFpreg=4 INFpregunk=0 INFlivebirth=4 INFlivebirthunk=0 INFliving=3 INFlivingunk=0 INFprenatalcare=2

INFprenatal=. INFprenatunk=0 INFvismonth=0 INFmedical=9 INFchronlung=0 INFanemia=0 INFcardiac=0 INFchorio=0 INFhyperten=0

INFdiabetes=0 INFeclampsia=0 INFgenherpes=0 INFhemoglob=0 INFhighmsafp=0 INFhydramnios=0 INFincompcerv=0 INFlowmsafp=0

INFinfdisease=0 INFpreghyper=0 INFpretermlab=0 INFprevinfant=0 INFprevpreterm=0 INFprom=0 INFrenal=0 INFrhsensit=0 INFuterbleed=0

INFmedother=0 INFmedothsp= INFexpipv=9 INFuseddrug=1 INFdrugbirth=1 INFmisotcrx=9 INFusedalc=1 INFalcbirth=1 INFisscare=1

INFissmoney=0 INFisscover=0 INFisscoord=0 INFisstrans=0 INFissphone=0 INFisscultr=0 INFissrelign=0 INFisslanguage=0 INFissrefer=0

INFissspeclist=0 INFissmultprov=0 INFisschcare=0 INFisssupport=0 INFissavserv=0 INFissdistrust=0 INFissunwill=1 INFissallow=0

INFissother=0 INFissothsp= INFissunk=0 INFsmbefpreg=1 INFsmbefpregcig= INFsmbefpregcigunk=1 INFsmanytime=1 INFfirsttricig=

INFfirsttricigunk=1 INFsectricig= INFsectricigunk=1 INFthirdtricig= INFthirdtricigunk=1 INFbreast=2 INFmothinj=2 INFmothinjsp=

INFmetab=1 INFfatacid=1 INFfatacidsp=D INFmetabsp= INFinfect=1 INFallergy=0 INFabgrow=1 INFapnea=1 INFcyanosis=1 INFseizure=1

INFcardiac1=0 INFmetabolic=1 INFmedhisoth=0 INFmedhisothsp= INF72fever=1 INF72sweat=0 INF72lethargy=0 INF72fussy=0 INF72appetite=0

INF72vomit=0 INF72choke=0 INF72diarrhea=0 INF72stool=0 INF72breathe=1 INF72apnea=1 INF72cyanosis=1 INF72seizures=1 INF72other=1

INF72medothsp=pupils fixed-hypoypnic,no gag,no spo INF72infinj=2 INF72infinjsp= INF72vac=2 INF72vacsp= INF72medicate=1

INF72medicatesp=IV Meds: INFbrmilk=. INFform=0 INFformsp=0 INFbbfood=. INFbbfoodsp=0 INFcereal=. INFcerealsp=0 INFfoodoth=.

INFfoodothsp=1 INFfoodunk=. INFmalvicna=. _ERROR_=1 _N_=8758

NOTE: 9290 records were read from the infile 'z:\Injury Epi Files\Datasets\CFR\Prelim 2016\08.04.16\tINF2.txt'.

The minimum record length was 237.

The maximum record length was 631.

NOTE: The data set WORK.TINFORMATION2 has 9290 observations and 131 variables.

NOTE: DATA statement used (Total process time):

real time 0.09 seconds

cpu time 0.07 seconds

 

Errors detected in submitted DATA step. Examine log.

9290 rows created in WORK.TINFORMATION2 from z:\Injury Epi Files\Datasets\CFR\Prelim 2016\08.04.16\tINF2.txt.

 

 

 

ERROR: Import unsuccessful. See SAS Log for details.

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

NOTE: PROCEDURE IMPORT used (Total process time):

real time 8.00 seconds

cpu time 7.67 seconds

 

439

440 GOPTIONS NOACCESSIBLE;

441 %LET _CLIENTTASKLABEL=;

442 %LET _CLIENTPROJECTPATH=;

443 %LET _CLIENTPROJECTNAME=;

444 %LET _SASPROGRAMFILE=;

445

446 ;*';*";*/;quit;run;

447 ODS _ALL_ CLOSE;

10 The SAS System 06:42 Wednesday, June 21, 2017

448

449

450 QUIT; RUN;

 

 

 

Esteemed Advisor
Posts: 6,646

Re: SAS Import Error

Inspect your infile according to this part of the messages:

NOTE: Invalid data for INFbrmilk in line 8759 369-430.
NOTE: Invalid data for INFfoodunk in line 8759 451-458.
NOTE: Invalid data for INFmalvicna in line 8759 461-469.

use a good text editing tool (eg notepad++) where you can navigate to line 8759 and the mentioned columns to see what data you have there.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 1,230

Re: SAS Import Error

Check line 8759 in your input .txt file using programs like notepad or notepad++.

I seems that this row is corrupted and doesn't fit the previous lines format.

 

It can be, also, as a result of different block size.

 

The specific row data is displayed. Error starts at position 369 - according to log info.:

NOTE: Invalid data for INFbrmilk in line 8759 369-430.
.....

RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0

201 acidosis, and oliguria â€" hypotension ..1.0.1.1.1.1.0.1.0..1.0.0.0.0.0.0.0.0.1.1.1.1.1.pupils fixed

ZONE 66666767226662666677662E8926776766766620030303030303030303003030303030303030303030303030777667266766

NUMR 1394F393C01E40FC97529102030890F45E39FE099190919191919091909919090909090909090919191919190509C3069854

301 -hypoypnic,no gag,no spontanious limb movements.2..2..1.IV Meds: .D5W, Dopamine drip, TPN, phytona

ZONE 2677677666266266626627766766667726666266766667703003003045246673222043522467666662676722554227677666

NUMR D890F90E93CEF0717CEF030FE41E9F530C9D20DF65D5E43929929919960D543A0009457C04F01D9E504290C040EC00894FE1

Ask a Question
Discussion stats
  • 2 replies
  • 89 views
  • 0 likes
  • 3 in conversation