Mon Oct 18, 2021 11:43 pm
Login Register Lost Password? Contact Us


Fetch Logical File List error

Comments and questions related to the Enterprise Control Language

Thu Apr 09, 2015 2:23 pm Change Time Zone

Hi,

When i try to run the below code in scheduler concept, i am getting the error.

Code: Select all
Import STD;

EXPORT GetTime() := FUNCTION
//function to get time
string6 getTime() := BEGINC++
// Declarations
struct tm localt; // localtime in "tm" structure
time_t timeinsecs; // variable to store time in secs

// Get time in sec since Epoch
time(&timeinsecs);
// Convert to local time
localtime_r(&timeinsecs,&localt);
// Format the local time value
strftime(__result, 8, "%H%M%S", &localt); // Formats the localtime to HHMMSS

ENDC++;

return getTime();
END;

Export Normalized_Term_Process := Module
base_pattern := 'innovation::case_law::test_schedule';
basepath := '~' + base_pattern;
schedulelog := 'schedulelog';
outfile_name := 'rfc_anchors';
search_pattern := base_pattern+'::'+outfile_name+'_*';
ds1 := STD.File.LogicalFileList(search_pattern);

split_count := count(ds1)+1;
//split_count := 1;
count_split := 2;
start_index := ((split_count-1)*count_split)+1;
end_index := split_count * count_split;

myrec := record
integer id;
string25 name;
end;

rec_log := Record
integer split_index;
string file_name;
string12 file_time;
End;

all_data := DATASET([{1, 'bala'},{2, 'arun'},{3,'David'}, {4, 'mike'}, {5, 'Michael'},{6,'Hari'}], myrec)[start_index..end_index];


OutputFile := basepath + '::' + outfile_name + '_' + split_count;
OutputFileName := basepath + '::' + outfile_name + '_' + (split_count-1);
Dellog := basepath +'::'+schedulelog+'_'+(split_count-3);
Inlog :=  basepath +'::'+schedulelog+'_'+(split_count-2);
Outlog :=  basepath +'::'+schedulelog+'_'+ (split_count-1);

Split_Data_Output := Output(all_data,, OutputFile, Overwrite);

t11 := GetTime();
t12 := t11[1..2]+':'+t11[3..4]+':'+t11[5..6];
//t2 := GetTime();

ds_schedule := if(split_count>2, DATASET(Inlog, rec_log, thor) , DATASET([], rec_log) );
ds_addition := DATASET([{(split_count-1), OutputFileName, t12}], rec_log);
ds_lognew := SORT(ds_schedule + ds_addition, split_index);

schedule_log := Output(ds_lognew, , Outlog, overwrite);


Export Run := Sequential
(
   Split_Data_Output,
   STD.File.DeleteLogicalFile(Dellog, TRUE),
   schedule_log,
   NOTIFY(EVENT('WRITE_SPLIT','Starts writing the split files'));
);
End;

Normalized_Term_Process.Run : WHEN(EVENT('WRITE_SPLIT','*'), COUNT(3));



Error:
FileServices.LogicalFileList cannot access Dali in this context - this normally means it is being called from a thor slave

how to fix the error or how to fetch the logical file list in scheduler concept.

Thanks
gopi
 
Posts: 19
Joined: Mon Sep 12, 2011 11:44 am

Return to ECL

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron