Hi - I have sqr process to read the .dat file as input file. But I am getting the file in excel format. I want to convert this XLS file into .dat format. I am unable to do this through the SQR. One of my colleague suggest me go with the Application Engine. Here is the code I am trying to convert the XLS file into .DAT through the App Engine. But I am missing the link between after opening the xls file and writing into .DAT file. Can you help me how to connect between after opening the file and writing the file.
&oWorkApp = CreateObject("COM", "Excel.Application");
ObjectSetProperty(&oWorkApp, "Visible", True);
&oWorkBook = ObjectGetProperty(&oWorkApp, "Workbooks");
&oWorkBook.Open("C:\temp\rates99.xls");
Local File &DATFILE;
Local string &FILE_NAME, &DATA;
&FILE_NAME = "C:\temp\rates.dat";
&DATFILE = GetFile(&FILE_NAME, "r");
&FileName = &DATFILE.Name;
&POS = Find(".", &FileName);
&NEWFILE_NAME = Substring(&FileName, 1, &POS) | "dat";
&DATFILE = GetFile(&NEWFILE_NAME, "N", %FilePath_Absolute);
If &DATFILE.IsOpen Then
While &DATFILE.ReadLine(&DATA);
&DATFILE.WriteLine(&DATA);
End-While;
&DATFILE.Close();
End-If;