SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Source File - Lib

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Source File - Lib
Author Message
Forest



Joined: 23 Nov 2004
Posts: 3

Post Source File - Lib Reply with quote

I've been doing some research related to the @SCRIPT
variable. What I am attempting to do is use
an offline file i.e. JAL with defining a job to
look to a remote ftp & monitor multiple files for modifications.
Once the job has notified a change in file status i.e. timedate
it downloads newer files to a temp directory, renames the old
files with a .bak extension. After renaming the file
the job puts the file in a backup folder and uploads the new
files to many different servers defined via ftp.

There has been a sigificant change with how many
and different extensions.

What I am attempting to accomplish here is one file
such a script.jal so that the job can look to this
file as the "library". As newer named files come in
I would like to just add this filename and type to the
list. These helps leviate time based on going into
the jobs script and adding more files to proccess.

Any ideas on how to build this type of job.
Also whenever I use the @SCRIPT statement I get an
error trying to validate. The error is on line 0, .
Need a solution for that as well.

Thanks,

Forest

Tue Dec 14, 2004 12:36 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Source File - Lib Reply with quote

I would like to suggest not to use an external JAL file, but instead have a flat text file containing file names only, each name on a new line. Lets's call it a "list"
Then you can build a regular script job, debug it, use user-defined functions for more convinience and efficiency, etc... and what's most important this way you can avoid making changes in the script whenever a new file is added to the processing. You simply add file name to the list.
Additional parameters such as specific destination directories or extensions for every file can be also save outside of the job.

The script can then read your "list" file(s) line by line and perform the same operations. Here is an idea how to accomplish that

Dim file_number, number
Dim file_name, string
Dim end_of_file, boolean

// Open file for reading line by line
FileOpen( "C:\\jobs\\myfiles.txt", "LineMode", "Read", "", file_number )

// Read file line by line until the end of file.
// Each file name must be on a separate line

EOF( file_number, end_of_file )
LoopUntil( end_of_file, END_LOOP )
FileRead( file_number, file_name )
// call user-defined statement here that processes that file
// ................
EOF( file_number, end_of_file )
END_LOOP:

// Done
FileClose( file_number )

: I've been doing some research related to the @SCRIPT
: variable. What I am attempting to do is use
: an offline file i.e. JAL with defining a job to
: look to a remote ftp & monitor multiple files for modifications.
: Once the job has notified a change in file status i.e. timedate
: it downloads newer files to a temp directory, renames the old
: files with a .bak extension. After renaming the file
: the job puts the file in a backup folder and uploads the new
: files to many different servers defined via ftp.

: There has been a sigificant change with how many
: and different extensions.

: What I am attempting to accomplish here is one file
: such a script.jal so that the job can look to this
: file as the "library". As newer named files come in
: I would like to just add this filename and type to the
: list. These helps leviate time based on going into
: the jobs script and adding more files to proccess.

: Any ideas on how to build this type of job.
: Also whenever I use the @SCRIPT statement I get an
: error trying to validate. The error is on line 0, .
: Need a solution for that as well.

: Thanks,

: Forest

Tue Dec 14, 2004 1:57 pm 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.