BookmarkSubscribeRSS Feed
ArpitSharma
Fluorite | Level 6

1. I think you need to check your input file first. Please use the option "COUNT" to check the exact number of lines in the flat file..

this will give you the number of records in the text file.

After you know the number of records try reading only the first "character" using @ just to check if the file is complete or not.

After getting done with this

Try changing the output parameters

SPACE=(CYL,(500,100),RLSE),

RECFM=FB, LRECL= 250,BLKSIZE=0

Try increasing the assigned cylinders "500" till the point it works....

make sure u put BLKSIZE=0...

This should surely help you out of your problem....

park2039
Calcite | Level 5

The file was not created in the mainframe.  I used the mainframe only as a placeholder. The file was created in another server.

ArpitSharma
Fluorite | Level 6

I understand your point.

But you need to narrow down your problem.

First try to figure out as to how many records in actual are there in Mainframe by using COUNT OPTION of MAINFRAME.

This is bcs sometimes it is possible that the complete file did not get FTP.

Once you are aware of the number of records in the flat file you know EXACTLY how many records are required to be read.

Then as others have specified CHECK use of MISSOVER/TRUNCOVER functions...

Now the problem narrows down to 2 things.

One some problem with SAS CODE.

TWO some problem with mainframe properties of output dataset.

ONE: Check for any missing ";" and also all code. Make sure SAS is not going into any indefinite loop.

TWO: I have encountered problems in mainframe while creating large datasets..In such case defining properties of the output dataset plays a vital role.You will have to go a little deep in to the mainframe commands like :

DISP=(XXXXX), UNIT=(XX,XX),SPACE,RECFM,LRECL,BLKSIZE   etc....

I hope it helps

Doc_Duke
Rhodochrosite | Level 12

Park,

The fact that the data were not created on the mainframe may be key.  If the step to upload the data to the mainframe is flawed, then it doesn't matter what you have done on download. 

If the data started out as text (say on a unix box of some sort), then the user can upload it as text (rather than binary) and you can FTP it down as text.  The FTP service will do the conversion from one coding schema to another.

Doc Muhlbaier

Duke

vachuck
Calcite | Level 5

On your INFILE statement make certain you include the LRECL parameter. Michelle Burlew in her excellent book Reading External Data Files Using SAS notes that external files downloaded from EBCDIC system of fixed length do not contain End-of-Record (EOR) markers. As others have pointed out, you will need to determine the record length of the data set on the mainframe. Are you using $ebcdic informat for character variables and s370ff  informat for numeric variables? As others have noted, check with the person who created the file to see if it contains binary or packed decimal data. I hope this solves your problem.

                                                                   Charles

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 19 replies
  • 4538 views
  • 0 likes
  • 8 in conversation