08-31-2011 03:53 PM
I am trying to read a text file generated in Mainframe. I used EBCDIC format with recfm=f option. However, SAS stops before it reaches the end-of-file. The input file has 8.2 mil records but SAS stop after it reads 6.2 mil. Does anyone have a solution to this problem?
08-31-2011 04:57 PM
Are you using any truncover or missover options? Have you checked to make sure that your layout is accurate to the file in question, especially in respect to the final length you a defining for a line? If the read is stopping on a consistent line have you inspected the line in question for some annomily?
08-31-2011 05:11 PM
Is it 6.2 out of 8.2 lines in the flat file or observations in the output file?
How did you count the lines in the flat file?
How did you move the file from the mainframe?
08-31-2011 05:15 PM
It is observations. Each line contains one observation. The record counts were gievn in advance by the person who created the flat file. The file was moved using FTP.
08-31-2011 05:35 PM
Can you verify that it was moved as BINARY rather then ASCII? Does it have any PIB or other fields that would contain binary data?
Was it originally fixed length records on the mainframe?
Do you get messages in the SAS log about SAS moving to another record to satisfy the input statements? Does it say that it read the same number of lines as the observations created. Does the data appear to get out of align with the specifications?
I like to use the LIST statement to look at the data.
You might try :
infile ....... ;
if _n_ <= 10 or 6200000 < _n_ ;
Where "62000000" is a small number of records before the point where it is stopping.
09-01-2011 12:13 AM
I assume it was moved as binary. The file was created in a server then moved to mainframe from where I copied to PC. It had fixed length records from the start. 62000000 is a larger number of records at the point when it stopped.
08-31-2011 05:39 PM
Have you tried it including a truncover option? It is possible that all of the records are there, but that some are missing some data, thus reading from the next record.
08-31-2011 08:46 PM
The SAS finished the job w/o generating error message. So there is no error in the log. It is as if there were only 6.2 mil records in the input file. So if the record count was not given in advance there is no way of knowing the SAS finished before it reached the end of file.