File I/O Error 103 when using FileLine Script Function

More
4 years 5 months ago #21579 by bruce.gibbins
AETLP v6.3.8.3 x32

Hi. I have noticed that when using the FileLine() Script function I get an I/O Error 103 each time. I have included a screenshot of the execution log. Initially I thought this may have been network related but the file being read is first moved/staged to my local C Drive for downstream processing. In an effort to mitigate the chance of an OS process hanging onto the file after the MOVE I introduced a very lengthy PAUSE. Just to see if the error continued - which it does. I don't have the file open in any other process (eg.Excel) and have fired up sysinternals Process Explorer to confirm.

The file lands in the local C: Drive location and after the script terminates I am able to open it using Excel or Notepad++. Therefore, there doesn't seem to be any permissions or file in use issues.

To me it seems to be specific to the FileLine(Function).

BTW. All of my testing is interactive through the AETLP UI and running the package directly and there are no other TABS open with transformations that may be using the same file.

Was hoping you may be able to investigate. Thanks in advance.

Attachments:

Please Log in or Create an account to join the conversation.

More
4 years 5 months ago #21580 by bruce.gibbins
Hi.

For anyone visiting this topic in the future. I established that it was indeed NOT a problem with FileLine() function but with how I was passing in the FileName to be used in the function.

The script was attempting to use a Connection Name Variable such as <B2B_Staging> concatenated with the Actual FileName which was a local Package Variable such as <SourceFileName>.

Similiar to
Code:
filename := GetVariable('<B2B_Staging>') + '\' + GetVariable('<SourceFileName>');

The problem is that the <B2B_Staging> connection variable is in itself made up of Variables such as <GLB_STAGING_PATH>\<B2B_EVENT>

It appears that this variable was not getting rendered into the proper nested variable values and what was getting passed to the FileLine() function was a FileName string that contained "<" and ">" symbols which probably manifested themselves as file system redirections or an invalid filename at the very least. This then caused the (misleading) 103 error.

Something like

<B2B_Staging>\filename.csv

instead of

c:\tmp\staging\filename.csv

I was able to correct this by not using the nested connection variable and used GetVariable() on the nested components and then concatenated these together to get the final full path and name.
Code:
FileName := GetVariable('<SourceFileName>'); DirName := GetVariable('<File Operation Target Dir>'); line := FileLine(DirName + '\' + FileName , 4);
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save