BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Coloradomis
Fluorite | Level 6

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,

Allen Malone
Institute for Health Research
Kaiser Permanente Colorado
1 ACCEPTED SOLUTION

Accepted Solutions
Coloradomis
Fluorite | Level 6

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.

Allen Malone
Institute for Health Research
Kaiser Permanente Colorado

View solution in original post

4 REPLIES 4
Coloradomis
Fluorite | Level 6

Thanks for pointing that out.   Newbie mistake, PNG files are not valid file types for attachments.  Here is a PDF.

Allen Malone
Institute for Health Research
Kaiser Permanente Colorado
LinusH
Tourmaline | Level 20

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).

Data never sleeps
Coloradomis
Fluorite | Level 6

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.

Allen Malone
Institute for Health Research
Kaiser Permanente Colorado

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

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.

Discussion stats
  • 4 replies
  • 3543 views
  • 0 likes
  • 3 in conversation