SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
FileOpen Error

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
FileOpen Error
Author Message
Rachel



Joined: 23 Aug 2000
Posts: 11

Post FileOpen Error Reply with quote

I am receiving the message : "Line xx: Error Opening File" when I schedule my jobs.

The affected lines of script are as follows :
IniFileGetKey("C:\24x7 Scheduler\Configuration\24x7settings.ini",
"Some Jobs", "configuration", batchjob)
FileOpen(batchjob, "LineMode", "Read", "", file_number)
EOF(file_number, end_of_file)

Does not FileOpen allow multiple reads by different jobs to a single file?


Thu Nov 16, 2000 3:20 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7850

Post Re: FileOpen Error Reply with quote

If you don't close the file, it remains "in use" and other jobs/processes cannor read from it. Don't forget to do FileClose

: I am receiving the message : "Line xx: Error Opening File" when I
: schedule my jobs.

: The affected lines of script are as follows : IniFileGetKey("C:\24x7
: Scheduler\Configuration\24x7settings.ini",
: "Some Jobs", "configuration", batchjob)
: FileOpen(batchjob, "LineMode", "Read", "",
: file_number)
: EOF(file_number, end_of_file)

: Does not FileOpen allow multiple reads by different jobs to a single file?

Thu Nov 16, 2000 8:43 am View user's profile Send private message
Rachel



Joined: 23 Aug 2000
Posts: 11

Post Re: FileOpen Error Reply with quote

: If you don't close the file, it remains "in use" and other
: jobs/processes cannor read from it. Don't forget to do FileClose

My code reads:

IniFileGetKey("C:\24x7 Scheduler\Configuration\24x7settings.ini", "Some Jobs", "configuration", batchjob)
FileOpen(batchjob, "LineMode", "Read", "", file_number)
EOF(file_number, end_of_file)

I have ChooseCase statements after opening the file where a specific email will be sent and the file will be closed with FileClose.

I have used this *.dat file many times and have never encountered this Error Opening File message before. I have checked the Log Viewer and my mailbox; it seems that the scheduled job does not send the notification email when the job has completed because it cannot open the file with the email addresses (I am using SMTP protocol).

Is there another way to send email notifications apart from MailSend within the JAL Script? I would like for emails that cannot be sent out immediately to be put into a queuing system, can 24x7 support this feature?

Sun Nov 19, 2000 10:59 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7850

Post Re: FileOpen Error Reply with quote

1. EOF tests for the end of file, it does not close the file. You should use FileClose statement instead.

2. Mail queuing can be easily implemented using the following method:

Create a directory with name like "Message Queue"

Create a background job named "QueueProcessor" that will on "24x7 Scheduler start-up" event (trigger type). This job should be of JAL script based on usage of the DirWaitForUpdate statement (for more info see example script for DirWaitForUpdate in the online help file). The "QueueProcessor" job will monitor the "Message Queue" directory and if a new file is added, it will read the file and send an email message stored in that file. If the emailing succeeds, the file gets deleted; otherwise the job sleeps for some time (Wait statement) and attempts to send email again. This way, you can implement email queuing.

Now, every MailSend in other jobs can be replaced with FileSave statement that will create a new file containing desired email details to a new file in the "Message Queue" directory. You decide how you format the file. The easiest probably is to do it like an INI file with Subject, Recipient, Text, etc.. keys.

The described method is universal and can be used in other processing that requires some sort of queuing.

: My code reads: IniFileGetKey("C:\24x7
: Scheduler\Configuration\24x7settings.ini", "Some Jobs",
: "configuration", batchjob)
: FileOpen(batchjob, "LineMode", "Read", "",
: file_number)
: EOF(file_number, end_of_file)

: I have ChooseCase statements after opening the file where a specific email
: will be sent and the file will be closed with FileClose.

: I have used this *.dat file many times and have never encountered this Error
: Opening File message before. I have checked the Log Viewer and my mailbox;
: it seems that the scheduled job does not send the notification email when
: the job has completed because it cannot open the file with the email
: addresses (I am using SMTP protocol).

: Is there another way to send email notifications apart from MailSend within
: the JAL Script? I would like for emails that cannot be sent out
: immediately to be put into a queuing system, can 24x7 support this
: feature?

Mon Nov 20, 2000 12:00 am View user's profile Send private message
Rachel



Joined: 23 Aug 2000
Posts: 11

Post Re: FileOpen Error Reply with quote

Thanks for the good advice!

Referring to my earlier question, what scenarios could have caused the "error opening file" messages in the scheduler?

: 1. EOF tests for the end of file, it does not close the file. You should use
: FileClose statement instead.

: 2. Mail queuing can be easily implemented using the following method: Create
: a directory with name like "Message Queue"

: Create a background job named "QueueProcessor" that will on
: "24x7 Scheduler start-up" event (trigger type). This job should
: be of JAL script based on usage of the DirWaitForUpdate statement (for
: more info see example script for DirWaitForUpdate in the online help
: file). The "QueueProcessor" job will monitor the "Message
: Queue" directory and if a new file is added, it will read the file
: and send an email message stored in that file. If the emailing succeeds,
: the file gets deleted; otherwise the job sleeps for some time (Wait
: statement) and attempts to send email again. This way, you can implement
: email queuing.

: Now, every MailSend in other jobs can be replaced with FileSave statement
: that will create a new file containing desired email details to a new file
: in the "Message Queue" directory. You decide how you format the
: file. The easiest probably is to do it like an INI file with Subject,
: Recipient, Text, etc.. keys.

: The described method is universal and can be used in other processing that
: requires some sort of queuing.

Tue Nov 21, 2000 5:50 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7850

Post Re: FileOpen Error Reply with quote

- File does not exist
- File is opened by another job or some other program
- No permissions to access file for the specified operation type
- Disk error

Note that once you do FileOpen without FileClose the file remains opened (locked for other jobs and processes) untill you restart the scheduler. Although, there exist some automatic "garbage" collection process in JAL, it does not guarantee to deallocate all resources such as opened files.

: Thanks for the good advice!

: Referring to my earlier question, what scenarios could have caused the
: "error opening file" messages in the scheduler?

Tue Nov 21, 2000 9:22 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.