Prev: Proc import with mutiple datatype for one column
Next: How to specify the ESTIMATE statement in PROC MIXED
From: Mark Sussman on 25 Feb 2010 17:56 Hello all, I have some rather large database that I've had to import manually since they don't have delimiters or column headers and I've been successful until I got to this database. I've included the log of my code below. I'm not sure how to fix a "lost card" and hows that affecting my output. 2 /*%import(Hoener - FPPS leave_final.txt)*/ 3 DATA abbey.FPPSlevbal_final_Hoener; 4 INFILE 'Z:\ABBEY\Data Received 2.17.2010\Hoener - FPPS leave_final.txt'; 5 INPUT 6 SSN $0001-0009 7 Name $ 0010-0047 8 EFF_PP 0048-0053 9 ANNL_ERND_PP 0054-0059 10 ANNL_USD_PP 0060-0065 11 ANNL_BAL $ 0066-0071 12 ANNI_DECR 0072-0077 13 SICK_ERND_PP 0078-0083 14 SICK_USD_PP 0084-0089 15 SICK_BAL 0090-0095 16 SICK_DECR $ 0096-0101 17 CRDT_ERND_PP $ 0102-0107 18 CRDT_USD_PP 0108-0113 19 CRDT_PD_PP $ 0114-0119 20 CRDT_BAL 0120-0125 21 COMP_ERND_PP 0126-0131 22 COMP_OSD_PP $ 0132-0137 23 COMP_PD_PP 0138-0143 24 COMP_BAL 0144-0149 25 TIME_ERND_PP 0150-0155 26 TIME_USD_PP 0156-0161 27 TIME_BAL 0162-0167 28 RCMP_ERND_PP $ 0168-0173 29 RCMP_USS_PP 0174-0179 30 RCMP_BAL 0180-0185 31 HOME_ERNS_PP 0186-0189 32 HOME_USD_PP $ 0190-0193 33 HOME_BAL 0194-0197 34 MILT_USD_PP 0198-0203 35 MILT_BAL 0204-0209 36 OTHR_USD_PP $ 0210-0215 37 OTHR_BAL 0216-0221 38 RSTR_ERND_PP 0222-0227 39 RSTR_USD_PP $ 0228-0233 40 RSTR_BAL 0234-0239 41 LSHR_ERND_PP 0240-0245 42 LSHR_USD_PP 0246-0251 43 LSHR_BAL 0252-0257 44 LWOP_USD_PP 0258-0263 45 LWOP_BAL 0264-0269 46 AWOP_USD_PP 0270-0275 47 AWOP_BAL 0276-0281 48 FURL_USD_PP 0282-0287 49 FURL_BAL 0288-0293 50 SUSP_USC_PP 0294-0299 51 SUSP_BAL 0300-0305 52 FECA_USD_PP 0306-0309 53 FECA_BAL 0310-0313 54 SPEC_ANNL_BAL 0314-0319 55 SPEC_SICK_BAL 0320-0325 56 TCMP_ERND_PP 0326-0331 57 TCMP_USD_PP 0332-0337 58 TCMP_BAL 0338-0343 59 RSRV_USD_PP 0344-0349 60 RSRV_BAL 0350-0355 61 ; 62 /*proc sort; by ssn eff_pp; */ 63 RUN; NOTE: The infile 'Z:\ABBEY\Data Received 2.17.2010\Hoener - FPPS leave_final.txt' is: File Name=Z:\ABBEY\Data Received 2.17.2010\Hoener - FPPS leave_final.txt, RECFM=V,LRECL=256 NOTE: LOST CARD. SSN=486646388 Name=HOENER, THEODOR W EFF_PP=200912 ANNL_ERND_PP=800 ANNL_USD_PP=3200 ANNL_BAL=008345 ANNI_DECR=0 SICK_ERND_PP=0 SICK_USD_PP=400 SICK_BAL=0 SICK_DECR=049815 CRDT_ERND_PP=000000 CRDT_USD_PP=0 CRDT_PD_PP=000000 CRDT_BAL=0 COMP_ERND_PP=0 COMP_OSD_PP=000130 COMP_PD_PP=0 COMP_BAL=0 TIME_ERND_PP=0 TIME_USD_PP=0 TIME_BAL=0 RCMP_ERND_PP=000000 RCMP_USS_PP=0 RCMP_BAL=0 HOME_ERNS_PP=0 HOME_USD_PP=0000 HOME_BAL=0 MILT_USD_PP=0 MILT_BAL=0 OTHR_USD_PP=000000 OTHR_BAL=0 RSTR_ERND_PP=0 RSTR_USD_PP=000000 RSTR_BAL=0 LSHR_ERND_PP=0 LSHR_USD_PP=0 LSHR_BAL=486646 LWOP_USD_PP=. LWOP_BAL=. AWOP_USD_PP=. AWOP_BAL=. FURL_USD_PP=. FURL_BAL=. SUSP_USC_PP=. SUSP_BAL=. FECA_USD_PP=. FECA_BAL=. SPEC_ANNL_BAL=. SPEC_SICK_BAL=. TCMP_ERND_PP=. TCMP_USD_PP=. TCMP_BAL=. RSRV_USD_PP=. RSRV_BAL=. _ERROR_=1 _N_=6 NOTE: 97 records were read from the infile 'Z:\ABBEY\Data Received 2.17.2010\Hoener - FPPS leave_final.txt'. The minimum record length was 256. The maximum record length was 256. One or more lines were truncated. NOTE: SAS went to a new line when INPUT statement reached past the end of a line. NOTE: The data set ABBEY.FPPSLEVBAL_FINAL_HOENER has 5 observations and 55 variables.
From: Joe Matise on 25 Feb 2010 20:12 Your LRECL is 256 (default) but your input is beyond that. You need to add a LRECL statement to INFILE to make it longer than 256 (at least 355 here). -Joe On Thu, Feb 25, 2010 at 4:56 PM, Mark Sussman <msussman(a)gmail.com> wrote: > Hello all, > > I have some rather large database that I've had to import manually > since they don't have delimiters or column headers and I've been > successful until I got to this database. I've included the log of my > code below. I'm not sure how to fix a "lost card" and hows that > affecting my output. > > 2 /*%import(Hoener - FPPS leave_final.txt)*/ > 3 DATA abbey.FPPSlevbal_final_Hoener; > 4 INFILE 'Z:\ABBEY\Data Received 2.17.2010\Hoener - FPPS > leave_final.txt'; > 5 INPUT > 6 SSN $0001-0009 > 7 Name $ 0010-0047 > 8 EFF_PP 0048-0053 > 9 ANNL_ERND_PP 0054-0059 > 10 ANNL_USD_PP 0060-0065 > 11 ANNL_BAL $ 0066-0071 > 12 ANNI_DECR 0072-0077 > 13 SICK_ERND_PP 0078-0083 > 14 SICK_USD_PP 0084-0089 > 15 SICK_BAL 0090-0095 > 16 SICK_DECR $ 0096-0101 > 17 CRDT_ERND_PP $ 0102-0107 > 18 CRDT_USD_PP 0108-0113 > 19 CRDT_PD_PP $ 0114-0119 > 20 CRDT_BAL 0120-0125 > 21 COMP_ERND_PP 0126-0131 > 22 COMP_OSD_PP $ 0132-0137 > 23 COMP_PD_PP 0138-0143 > 24 COMP_BAL 0144-0149 > 25 TIME_ERND_PP 0150-0155 > 26 TIME_USD_PP 0156-0161 > 27 TIME_BAL 0162-0167 > 28 RCMP_ERND_PP $ 0168-0173 > 29 RCMP_USS_PP 0174-0179 > 30 RCMP_BAL 0180-0185 > 31 HOME_ERNS_PP 0186-0189 > 32 HOME_USD_PP $ 0190-0193 > 33 HOME_BAL 0194-0197 > 34 MILT_USD_PP 0198-0203 > 35 MILT_BAL 0204-0209 > 36 OTHR_USD_PP $ 0210-0215 > 37 OTHR_BAL 0216-0221 > 38 RSTR_ERND_PP 0222-0227 > 39 RSTR_USD_PP $ 0228-0233 > 40 RSTR_BAL 0234-0239 > 41 LSHR_ERND_PP 0240-0245 > 42 LSHR_USD_PP 0246-0251 > 43 LSHR_BAL 0252-0257 > 44 LWOP_USD_PP 0258-0263 > 45 LWOP_BAL 0264-0269 > 46 AWOP_USD_PP 0270-0275 > 47 AWOP_BAL 0276-0281 > 48 FURL_USD_PP 0282-0287 > 49 FURL_BAL 0288-0293 > 50 SUSP_USC_PP 0294-0299 > 51 SUSP_BAL 0300-0305 > 52 FECA_USD_PP 0306-0309 > 53 FECA_BAL 0310-0313 > 54 SPEC_ANNL_BAL 0314-0319 > 55 SPEC_SICK_BAL 0320-0325 > 56 TCMP_ERND_PP 0326-0331 > 57 TCMP_USD_PP 0332-0337 > 58 TCMP_BAL 0338-0343 > 59 RSRV_USD_PP 0344-0349 > 60 RSRV_BAL 0350-0355 > 61 ; > 62 /*proc sort; by ssn eff_pp; */ > 63 RUN; > > NOTE: The infile 'Z:\ABBEY\Data Received 2.17.2010\Hoener - FPPS > leave_final.txt' is: > File Name=Z:\ABBEY\Data Received 2.17.2010\Hoener - FPPS > leave_final.txt, > RECFM=V,LRECL=256 > > NOTE: LOST CARD. > SSN=486646388 Name=HOENER, THEODOR W EFF_PP=200912 ANNL_ERND_PP=800 > ANNL_USD_PP=3200 ANNL_BAL=008345 > ANNI_DECR=0 SICK_ERND_PP=0 SICK_USD_PP=400 SICK_BAL=0 SICK_DECR=049815 > CRDT_ERND_PP=000000 > CRDT_USD_PP=0 CRDT_PD_PP=000000 CRDT_BAL=0 COMP_ERND_PP=0 > COMP_OSD_PP=000130 COMP_PD_PP=0 COMP_BAL=0 > TIME_ERND_PP=0 TIME_USD_PP=0 TIME_BAL=0 RCMP_ERND_PP=000000 > RCMP_USS_PP=0 RCMP_BAL=0 HOME_ERNS_PP=0 > HOME_USD_PP=0000 HOME_BAL=0 MILT_USD_PP=0 MILT_BAL=0 > OTHR_USD_PP=000000 OTHR_BAL=0 RSTR_ERND_PP=0 > RSTR_USD_PP=000000 RSTR_BAL=0 LSHR_ERND_PP=0 LSHR_USD_PP=0 > LSHR_BAL=486646 LWOP_USD_PP=. LWOP_BAL=. > AWOP_USD_PP=. AWOP_BAL=. FURL_USD_PP=. FURL_BAL=. SUSP_USC_PP=. > SUSP_BAL=. FECA_USD_PP=. FECA_BAL=. > SPEC_ANNL_BAL=. SPEC_SICK_BAL=. TCMP_ERND_PP=. TCMP_USD_PP=. > TCMP_BAL=. RSRV_USD_PP=. RSRV_BAL=. > _ERROR_=1 _N_=6 > NOTE: 97 records were read from the infile 'Z:\ABBEY\Data Received > 2.17.2010\Hoener - FPPS > leave_final.txt'. > The minimum record length was 256. > The maximum record length was 256. > One or more lines were truncated. > NOTE: SAS went to a new line when INPUT statement reached past the end > of a line. > NOTE: The data set ABBEY.FPPSLEVBAL_FINAL_HOENER has 5 observations > and 55 variables. >
From: Mike Zdeb on 25 Feb 2010 21:26
hi ... if you are using PC SAS, the longest record you can read without providing some info to SAS about record length is 256 characters look at the end of your LOG file ... ******************** 60 RSRV_BAL 0350-0355 61 ; 62 /*proc sort; by ssn eff_pp; */ 63 RUN; NOTE: 97 records were read from the infile 'Z:\ABBEY\Data Received 2.17.2010\Hoener - FPPS leave_final.txt'. The minimum record length was 256. The maximum record length was 256. One or more lines were truncated. NOTE: SAS went to a new line when INPUT statement reached past the end of a line. NOTE: The data set ABBEY.FPPSLEVBAL_FINAL_HOENER has 5 observations and 55 variables. ******************** your INPUT statement reads to column 355 .. look at he message from SAS it thinks you have 256 character records also, you read 97 records and produced only 5 observations that's another hint that something is wrong so, try ... INFILE 'Z:\ABBEY\Data Received 2.17.2010\Hoener - FPPS leave_final.txt' lrecl=355 truncover; ps LOST CARD from the era of "dropped card decks" ... there was not enough data in the input file to provide a value for each variable in your INPUT statement ... so one interpretation is that you "lost a card" off the bottom of the card deck and that card had the rest of the required data (you must have "lost it") pps who assigned that file name ... all those blank spaces ... what if you have one too many ??? -- Mike Zdeb U(a)Albany School of Public Health One University Place Rensselaer, New York 12144-3456 P/518-402-6479 F/630-604-1475 > Hello all, > > I have some rather large database that I've had to import manually > since they don't have delimiters or column headers and I've been > successful until I got to this database. I've included the log of my > code below. I'm not sure how to fix a "lost card" and hows that > affecting my output. > > 2 /*%import(Hoener - FPPS leave_final.txt)*/ > 3 DATA abbey.FPPSlevbal_final_Hoener; > 4 INFILE 'Z:\ABBEY\Data Received 2.17.2010\Hoener - FPPS > leave_final.txt'; > 5 INPUT > 6 SSN $0001-0009 > 7 Name $ 0010-0047 > 8 EFF_PP 0048-0053 > 9 ANNL_ERND_PP 0054-0059 > 10 ANNL_USD_PP 0060-0065 > 11 ANNL_BAL $ 0066-0071 > 12 ANNI_DECR 0072-0077 > 13 SICK_ERND_PP 0078-0083 > 14 SICK_USD_PP 0084-0089 > 15 SICK_BAL 0090-0095 > 16 SICK_DECR $ 0096-0101 > 17 CRDT_ERND_PP $ 0102-0107 > 18 CRDT_USD_PP 0108-0113 > 19 CRDT_PD_PP $ 0114-0119 > 20 CRDT_BAL 0120-0125 > 21 COMP_ERND_PP 0126-0131 > 22 COMP_OSD_PP $ 0132-0137 > 23 COMP_PD_PP 0138-0143 > 24 COMP_BAL 0144-0149 > 25 TIME_ERND_PP 0150-0155 > 26 TIME_USD_PP 0156-0161 > 27 TIME_BAL 0162-0167 > 28 RCMP_ERND_PP $ 0168-0173 > 29 RCMP_USS_PP 0174-0179 > 30 RCMP_BAL 0180-0185 > 31 HOME_ERNS_PP 0186-0189 > 32 HOME_USD_PP $ 0190-0193 > 33 HOME_BAL 0194-0197 > 34 MILT_USD_PP 0198-0203 > 35 MILT_BAL 0204-0209 > 36 OTHR_USD_PP $ 0210-0215 > 37 OTHR_BAL 0216-0221 > 38 RSTR_ERND_PP 0222-0227 > 39 RSTR_USD_PP $ 0228-0233 > 40 RSTR_BAL 0234-0239 > 41 LSHR_ERND_PP 0240-0245 > 42 LSHR_USD_PP 0246-0251 > 43 LSHR_BAL 0252-0257 > 44 LWOP_USD_PP 0258-0263 > 45 LWOP_BAL 0264-0269 > 46 AWOP_USD_PP 0270-0275 > 47 AWOP_BAL 0276-0281 > 48 FURL_USD_PP 0282-0287 > 49 FURL_BAL 0288-0293 > 50 SUSP_USC_PP 0294-0299 > 51 SUSP_BAL 0300-0305 > 52 FECA_USD_PP 0306-0309 > 53 FECA_BAL 0310-0313 > 54 SPEC_ANNL_BAL 0314-0319 > 55 SPEC_SICK_BAL 0320-0325 > 56 TCMP_ERND_PP 0326-0331 > 57 TCMP_USD_PP 0332-0337 > 58 TCMP_BAL 0338-0343 > 59 RSRV_USD_PP 0344-0349 > 60 RSRV_BAL 0350-0355 > 61 ; > 62 /*proc sort; by ssn eff_pp; */ > 63 RUN; > > NOTE: The infile 'Z:\ABBEY\Data Received 2.17.2010\Hoener - FPPS > leave_final.txt' is: > File Name=Z:\ABBEY\Data Received 2.17.2010\Hoener - FPPS > leave_final.txt, > RECFM=V,LRECL=256 > > NOTE: LOST CARD. > SSN=486646388 Name=HOENER, THEODOR W EFF_PP=200912 ANNL_ERND_PP=800 > ANNL_USD_PP=3200 ANNL_BAL=008345 > ANNI_DECR=0 SICK_ERND_PP=0 SICK_USD_PP=400 SICK_BAL=0 SICK_DECR=049815 > CRDT_ERND_PP=000000 > CRDT_USD_PP=0 CRDT_PD_PP=000000 CRDT_BAL=0 COMP_ERND_PP=0 > COMP_OSD_PP=000130 COMP_PD_PP=0 COMP_BAL=0 > TIME_ERND_PP=0 TIME_USD_PP=0 TIME_BAL=0 RCMP_ERND_PP=000000 > RCMP_USS_PP=0 RCMP_BAL=0 HOME_ERNS_PP=0 > HOME_USD_PP=0000 HOME_BAL=0 MILT_USD_PP=0 MILT_BAL=0 > OTHR_USD_PP=000000 OTHR_BAL=0 RSTR_ERND_PP=0 > RSTR_USD_PP=000000 RSTR_BAL=0 LSHR_ERND_PP=0 LSHR_USD_PP=0 > LSHR_BAL=486646 LWOP_USD_PP=. LWOP_BAL=. > AWOP_USD_PP=. AWOP_BAL=. FURL_USD_PP=. FURL_BAL=. SUSP_USC_PP=. > SUSP_BAL=. FECA_USD_PP=. FECA_BAL=. > SPEC_ANNL_BAL=. SPEC_SICK_BAL=. TCMP_ERND_PP=. TCMP_USD_PP=. > TCMP_BAL=. RSRV_USD_PP=. RSRV_BAL=. > _ERROR_=1 _N_=6 > NOTE: 97 records were read from the infile 'Z:\ABBEY\Data Received > 2.17.2010\Hoener - FPPS > leave_final.txt'. > The minimum record length was 256. > The maximum record length was 256. > One or more lines were truncated. > NOTE: SAS went to a new line when INPUT statement reached past the end > of a line. > NOTE: The data set ABBEY.FPPSLEVBAL_FINAL_HOENER has 5 observations > and 55 variables. > |