DATA Step, Macro, Functions and more

truncating while importing how to handle

Reply
Frequent Contributor
Posts: 84

truncating while importing how to handle

I have a data set which has address column.

While importing it is truncating.how to handle this situations.

Respected Advisor
Posts: 3,894

Re: truncating while importing how to handle

Provide much more information to us - and if you're lucky then while collecting this information you might even understand by yourself what's happening and how to resolve it.

Super User
Posts: 10,500

Re: truncating while importing how to handle

Did you use proc import? If so what was the source file type?

You can search this forum for truncated and you'll find a number of related posts, especially if the data source is Excel.

Frequent Contributor
Posts: 84

Re: truncating while importing how to handle

it's a csv file. i am importing through proc import. Yes i will search in this group. Thanks.

what are the differences(adv and dis adv) in Proc import and  infile. which one is best to use.

Regular Contributor
Posts: 168

Re: truncating while importing how to handle

Again you can find numerous answers if you search in this forum like 'differences between infile and proc import' or simply 'proc import'

Super User
Posts: 6,941

Re: truncating while importing how to handle

PROC IMPORT makes an educated guess about the file structure and then creates a suitable data step to read the data.

This means that a change in the file structure (or the data in the first n records inspected by proc import) will result in an automatic structural change in the dataset, which may cause problems farther down the line.

A manually written DATA step to read an external file will show unexpected data, either by causing a WARNING or ERROR condition, or at least by writing ERROR messages to the log. This will enable you to catch faulty data before it causes serious trouble.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 29

Re: truncating while importing how to handle

use guessingrows=32767 for proc import and give a try.

Super User
Super User
Posts: 7,403

Re: truncating while importing how to handle

Clue is in the title there, guessingrows.  If your ok with letting SAS guess your data then go ahead, I would recommend writing a specific import program yourself for the data you know.

Ask a Question
Discussion stats
  • 7 replies
  • 279 views
  • 2 likes
  • 7 in conversation