I am using app engine to read a flat file for purposes of populating a PeopleSoft table. I have created a file definition layout using the CUST_EXEMPT_DTL table. My question is how should I represent the effective date in my flat file so that when the the record is read and copied using the CopyFieldsTo method the date will properly be loaded in my record object which has an EFFDT field of type date. Im running this on an Oracle database. Here is the code I'm using. Everything else seems to load properly except for the date.
Local File &file1;
Local Rowset &file_rowset;
Local Record &rec_custexemptdtl;
Local SQL &SQL1;
&rec_custexemptdtl = CreateRecord(Record.CUST_EXEMPT_DTL);
&SQL1 = CreateSQL("%INSERT1)"
&file1 = GetFile("I:\IT_Special_Projects\Yellow Projects\PS Billing\Conversion\WOC flat files\Sundance\CUST_EXEMPT_DTL.txt", "R", %FilePath_Absolute);
&file_rowset = &file1.CreateRowset();
If &file1.IsOpen Then
If &file1.SetFileLayout(FileLayout.CUST_EXEMPT_DTL_LAYOUT) Then
&file_rowset = &file1.ReadRowset();
While &file_rowset <> Null
&file_rowset.GetRow(1).CUST_EXEMPT_DTL.CopyFieldsTo(&rec_custexemptdtl);
&rec_custexemptdtl.GetField(Field.ADD_DTTM).Value = %Datetime;
&rec_custexemptdtl.GetField(Field.LAST_UPDATE_DTTM).Value = %Datetime;
&SQL1.Execute(&rec_custexemptdtl);
&file_rowset = &file1.ReadRowset();
End-While;
Else
Error ("PKT_BISCRUB: failed SetFileLayout"
End-If;
Else
Error ("PKT_BISCRUB: failed file open"
End-If;
&file1.Close();
Local File &file1;
Local Rowset &file_rowset;
Local Record &rec_custexemptdtl;
Local SQL &SQL1;
&rec_custexemptdtl = CreateRecord(Record.CUST_EXEMPT_DTL);
&SQL1 = CreateSQL("%INSERT1)"
&file1 = GetFile("I:\IT_Special_Projects\Yellow Projects\PS Billing\Conversion\WOC flat files\Sundance\CUST_EXEMPT_DTL.txt", "R", %FilePath_Absolute);
&file_rowset = &file1.CreateRowset();
If &file1.IsOpen Then
If &file1.SetFileLayout(FileLayout.CUST_EXEMPT_DTL_LAYOUT) Then
&file_rowset = &file1.ReadRowset();
While &file_rowset <> Null
&file_rowset.GetRow(1).CUST_EXEMPT_DTL.CopyFieldsTo(&rec_custexemptdtl);
&rec_custexemptdtl.GetField(Field.ADD_DTTM).Value = %Datetime;
&rec_custexemptdtl.GetField(Field.LAST_UPDATE_DTTM).Value = %Datetime;
&SQL1.Execute(&rec_custexemptdtl);
&file_rowset = &file1.ReadRowset();
End-While;
Else
Error ("PKT_BISCRUB: failed SetFileLayout"
End-If;
Else
Error ("PKT_BISCRUB: failed file open"
End-If;
&file1.Close();