Hello All,
I am using DI Studio to create a job to export a data set as a csv file. I am using the File Writer transformation. The job exports the data set and creates the csv file, but I am not getting the column headings in the data set as the first row in the csv file. What do I have to do in my DI job to make the column heading show up. Here is the code generated by the job
/******************************************************************************
* Job: Test_CSV A5HUSR61.BR0001LL *
* Description: *
* *
* Metadata Server: 340srv10 *
* Port: 8562 *
* Location: /shri_test/Exceed Data *
* *
* Server: SASApp A5HUSR61.AR000002 *
* *
* Source Table: ABSENT_LATE_REASON_DIM - A5HUSR61.B6000002 *
* Current.ABSENT_LATE_REASON_DIM *
* Target Table: Test_File2 - A5HUSR61.CB0000S3 *
* D:\DATA\CPO_DROP\ED_Test\exceed_Test2 *
* .csv *
* *
* Generated on: Friday, May 7, 2010 8:52:28 AM EDT *
* Generated by: sas@340SRV10 *
* Version: SAS Data Integration Studio 4.2 *
******************************************************************************/
/* General macro variables */
%let jobID = %quote(A5HUSR61.BR0001LL);
%let etls_jobName = %nrquote(Test_CSV);
%let etls_userID = %nrquote(sas@340SRV10);
/* Setup to capture return codes */
%global job_rc trans_rc sqlrc;
%let sysrc = 0;
%let job_rc = 0;
%let trans_rc = 0;
%let sqlrc = 0;
%global syserr;
%macro rcSet(error);
%if (&error gt &trans_rc) %then
%let trans_rc = &error;
%if (&error gt &job_rc) %then
%let job_rc = &error;
%mend rcSet;
%macro rcSetDS(error);
if &error gt input(symget('trans_rc'),12.) then
call symput('trans_rc',trim(left(put(&error,12.))));
if &error gt input(symget('job_rc'),12.) then
call symput('job_rc',trim(left(put(&error,12.))));
%mend rcSetDS;
/* Create metadata macro variables */
%let IOMServer = %nrquote(SASApp);
%let metaPort = %nrquote(8562);
%let metaServer = %nrquote(340srv10);
/* Set metadata options */
options metaport = &metaPort
metaserver = "&metaServer";
/* Setup for capturing job status */
%let etls_startTime = %sysfunc(datetime(),datetime.);
%let etls_recordsBefore = 0;
%let etls_recordsAfter = 0;
%let etls_lib = 0;
%let etls_table = 0;
%global etls_debug;
%macro etls_setDebug;
%if %str(&etls_debug) ne 0 %then
OPTIONS MPRINT%str(;);
%mend;
%etls_setDebug;
/*============================================================================*
* Step: File Writer A5HUSR61.$0000021 *
* Transform: File Writer *
* Description: *
* *
* Source Table: ABSENT_LATE_REASON_DIM - A5HUSR61.B6000002 *
* Current.ABSENT_LATE_REASON_DIM *
* Target Table: Test_File2 - A5HUSR61.CB0000S3 *
* D:\DATA\CPO_DROP\ED_Test\exceed_Test2 *
* .csv *
*============================================================================*/
%let transformID = %quote(A5HUSR61.$0000021);
%let trans_rc = 0;
%let etls_stepStartTime = %sysfunc(datetime(), datetime20.);
%let SYSLAST = %nrquote(Current.ABSENT_LATE_REASON_DIM);
data _null_;
set &SYSLAST;
attrib ABSENT_LATE_REASON_SK length = 8
format = 7.
informat = 7.;
attrib SCHOOL_ID length = $20
format = $20.
informat = $20.;
attrib ABSENT_LATE_REASON_CODE length = $6
format = $6.
informat = $6.;
attrib ABSENT_LATE_REASON_DESC length = $20
format = $20.
informat = $20.;
attrib ABSENT_LATE_REASON_SHORT_DESC length = $7
format = $7.
informat = $7.;
attrib AUTHORIZED_FLG length = $1
format = $1.
informat = $1.;
attrib EXCUSED_FLG length = $1
format = $1.
informat = $1.;
quote='"';
file 'D:\DATA\CPO_DROP\ED_Test\exceed_Test2.csv' dlm=',';
put
quote +(-1) ABSENT_LATE_REASON_SK +(-1) quote
quote +(-1) SCHOOL_ID +(-1) quote
quote +(-1) ABSENT_LATE_REASON_CODE +(-1) quote
quote +(-1) ABSENT_LATE_REASON_DESC +(-1) quote
quote +(-1) ABSENT_LATE_REASON_SHORT_DESC +(-1) quote
quote +(-1) AUTHORIZED_FLG +(-1) quote
quote +(-1) EXCUSED_FLG +(-1) quote
;
run;
%rcSet(&syserr);
Thanks for your help
Shri