SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

How do I create a csv file with column name header in DI Studio?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

How do I create a csv file with column name header in DI Studio?

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

Accepted Solutions
Solution
a week ago
Occasional Contributor
Posts: 5

Re: How do I create a csv file with column name header in DI Studio?

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


All Replies
Super User
Posts: 13,950

Re: How do I create a csv file with column name header in DI Studio?

Posted in reply to Coloradomis

Screen capture didn't make it.

Occasional Contributor
Posts: 5

Re: How do I create a csv file with column name header in DI Studio?

Posted in reply to Coloradomis

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
Super User
Posts: 5,922

Re: How do I create a csv file with column name header in DI Studio?

Posted in reply to Coloradomis

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
Solution
a week ago
Occasional Contributor
Posts: 5

Re: How do I create a csv file with column name header in DI Studio?

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
☑ This topic is solved.

Need further help from the community? Please ask a new question.

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