Esteemed DI Studio Brain Trust,
This is my first DI studio (version 4.9) project so I'm prepared for a "Doh!" moment.
I am trying to create csv external file using transformations from a registered SAS table in the following manner:
[SAS Table] ===> [External File Writer] ==> [Registered External File]
Step 1. Create the external file metadata: My Folder -> Navigate to my CSV File folder -> New -> External File -> Delimited
Step 2. Configure the File Metadata:
General -- Name: Test
External File Location -- File name: <super long path>\test.txt
Delimiters & Parameters -- [x] Comma => all other fields are defaults
Column Definitions -- [Import...] => Get Column Definitions from Existing Table => Navigate to Registered table in Folders view and migrate all columns to the file metadata.
Finish
Step 3: Drag the source table onto the project
Step 4: Drag External File Writer Transformation to project page and link the table to the file writer transformation
Step 5: Drag the Registered File onto the project and link the File Writer transformation to the External File object.
When I run the File Writer transformation, I get data (see attached screen capture) but it is missing the column name header in the first row. I am praying I missed a radio button somewhere.
Kind Regards,
Many Thanks, LinusH! That did the trick. For those of you that would like to see the solution, I attached a second screen shot that takes you through the solution.
Screen capture didn't make it.
Thanks for pointing that out. Newbie mistake, PNG files are not valid file types for attachments. Here is a PDF.
Be sure to specify "2" as the Start Record (File Parameters - Advanced).
Then, DIS assumes you want to insert columns headers in row 1.
Not very intuitive, but External File objects were mostly designed for use with File Reader, which can see from many of the options (like INFILE statement options/override).
Many Thanks, LinusH! That did the trick. For those of you that would like to see the solution, I attached a second screen shot that takes you through the solution.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.