This trick works as you import any text file or Excel file. The "Field Attributes for Multiple Selections" window appears, and you can change the necessary attributes just once and apply to the many items you picked. Simply SHIFT+Click to select multiple column definitions on the page, then click Modify. There's a shortcut on the Define Field Attributes page of the wizard that you can use to change the attributes for several columns at the same time. It can be tedious to click and modify the properties of each column that you want to import. Sometimes you have an input data file that contains many columns that share the same properties: type, length, and SAS format. Modify the properties for multiple columns - with one step When you click Finish, you end up with a data set that's ready for business:
PREPARED ACCDB FILE HOW TO
Which then tells the Import Data task how to generate the proper INPUT statements: Then click Next, and fill out details for the column names and types: When you select "Fixed columns" as the input text format, you'll see a layout ruler that looks like this:Ĭlick at the column boundaries (referring to your original spec!) and drag the rule lines as needed to define those column boundaries. Beginning with the File->Import Data task, select your source text file and advance to the second page of the wizard. You can use the Import Data wizard to define the boundaries of your columns by adding boundary lines with just click-and-drag operations. Suppose that you're beginning with a spec like this: The "Fixed columns" option on the Import Data task can make this job simple. The SAS DATA step is a perfect tool for reading these files, but defining the columns and their properties can be tedious. We think of CSV files ( files) as the main standard for data exchange among systems, but many legacy systems still produce and consume fixed-width text data formats.
Watch the video to learn more, or scroll down to read my step-by-step tips.
PREPARED ACCDB FILE UPDATE
( Update 23Mar2020) I've recorded a video that shows how to use the Import Data task as a start, and then adapt the code that it generates for reuse in other environments, with other files, and to read multiple text files in a single step. In this article, I'll review a few of the cool things that this task can do for you. I use the tool so often that I take for granted some of its neatest features, and I forget that many new users (and even veteran users) might not know about them. There's no faster method for generating SAS code that reads your data exactly the way you need it. I'm a big fan of the Import Data task in SAS Enterprise Guide, especially for its support of text-based files (CSV, tab delimited, fixed width, and more).