SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
bumping into 32K script limit

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
bumping into 32K script limit
Author Message
~Joe



Joined: 18 Dec 2003
Posts: 42

Post bumping into 32K script limit Reply with quote

I have a script I am working on that is 34K with spaces and characters.
The script is involved at a high level it is: testing for network connectivity, finding files, moving files, looking for special characters in the files and performing conditional processing based on the content, (through case statements), backing up files, deleting old files, and SFTP’ing files to a unix host, and finally sending an e-mail with the results.

I am looking for suggestions to work around the 32K script limitation. Thus far the only options I can think of are:
1) use VB (but I loose the integrated SFTP connectivity I need {and like})
2) create jobs which are called from the main job or nest the JAL jobs. EXAMPLE: JOB1 runs and finishes starting JOB2. JOB2 finishes starting JOB3.)

My main hurdle with option 2 is: How to transfer the environment variable setting between the programs? I could write them to an INI file (a significant I/O increase for 20 scripts) or set the DIM's as global defined in the JAL. (If I define the DIMS globally I am concerned the DIM statements will probably be over written (stepped on) while other scripts are running.

How do you suggest I overcome this issue?

~Joe

Thu Jan 29, 2004 4:25 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: bumping into 32K script limit Reply with quote

1. You can use user-defined functions (Tools/Script Library) and move common parts of the code there.
2. You can use external JAL script files and include them using @SCRIPT tag.

PS. The 32K limits is not the limit for the script, it is the limit for the job definition storage (e.g size of the field for the script)

: I have a script I am working on that is 34K with spaces and characters.
: The script is involved at a high level it is: testing for network
: connectivity, finding files, moving files, looking for special characters
: in the files and performing conditional processing based on the content,
: (through case statements), backing up files, deleting old files, and
: SFTP’ing files to a unix host, and finally sending an e-mail with the
: results.

: I am looking for suggestions to work around the 32K script limitation. Thus
: far the only options I can think of are: 1) use VB (but I loose the
: integrated SFTP connectivity I need {and like})
: 2) create jobs which are called from the main job or nest the JAL jobs.
: EXAMPLE: JOB1 runs and finishes starting JOB2. JOB2 finishes starting
: JOB3.)

: My main hurdle with option 2 is: How to transfer the environment variable
: setting between the programs? I could write them to an INI file (a
: significant I/O increase for 20 scripts) or set the DIM's as global
: defined in the JAL. (If I define the DIMS globally I am concerned the DIM
: statements will probably be over written (stepped on) while other scripts
: are running.

: How do you suggest I overcome this issue?

: ~Joe

Thu Jan 29, 2004 4:31 pm View user's profile Send private message
~Joe



Joined: 18 Dec 2003
Posts: 42

Post Re: bumping into 32K script limit Reply with quote

How would someone, me, know when they are reaching the 32K storage limit?

We are already using several @SCRIPT: to pull in common code into our jobs

The error we are getting is:
BETA: Pathology Charge Import v1.0: Remote job execution error. Exit code: -1. An error occurred while executing automation script: Line 551: Could not connect to server . Service not available. Extended error code: 4.

This occurs when we are testing our “onerror routine” We are expecting the job to continue processing through a CASE statement. But, instead, the job hurls on the first concatex: ConcatEx ("AUTOMATION ERROR Processing Notification - Charge Import (", job_name, ") - File \"", source_file_name, "\"", error_mail_subject)

The error message is correct the server is unavailable. But I need to continue processing the job and let script send an e-mail with the error.

When I try to paste the Concatex line into the “Immediate” window and press F6 to run the code, a “Bad number of arguments” error is returned.

Additional testing came up with a different error. When trying to delete a Read Only file. I get a 24x7 dialog box on the same line, line 551 the Concatex line. “Error Copying file \\path\E4\filename Error: 0 the operation complete successfully. “

What am I doing wrong here?

The is the actual code from the script:

ERROR_HANDLING:

GetLastError (job_error)

ConcatEx ("AUTOMATION ERROR Processing Notification - Charge Import (", job_name, ") - File \"", source_file_name, "\"", error_mail_subject)

ChooseCase (job_progress, END_CHOOSE_CASE_JOB_PROGRESS)
//Failure occurs before any files were moved or copied.

Case 10

ConcatEx ("AUTOMATION ERROR Processing Notification - Charge Import (", job_name, ")", error_mail_subject)

ConcatEx ("The automation error occurred before any file was processed.", error_mail_body)
//The source file has been determined to be invalid but it has not been moved
//to the error subdirectory.

Case 20
…-

Thank you for your help.

~Joe

: 1. You can use user-defined functions (Tools/Script Library) and move common
: parts of the code there.
: 2. You can use external JAL script files and include them using @SCRIPT tag.

: PS. The 32K limits is not the limit for the script, it is the limit for the
: job definition storage (e.g size of the field for the script)

Thu Jan 29, 2004 6:03 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: bumping into 32K script limit Reply with quote

Well, I think if your job script is more than couple of hundreds lines of code then there is something wrong with the job design.

Try to not put everything in one script. If you have any common processing in your script which you use again and again, create a user-defined function and move that code there. If the script does a lot of different things try to partition it into multiple independent jobs. This way you can also create restarting point you can use if you want to rerun only certain parts of the processing.

Regarding the error. I would like to suggest turning on the tracing option (Tools/Options menu; Log page, Trace enabled) and re-running the script with the trace enabled. You can find all script trace files in the Performance Data directory or your can check SCRIPT.LOG file which contains trace for the most recent run.
This trace should clearly show all commands with all executed parameters and their values and this should help you figuring out what went wrong.

: How would someone, me, know when they are reaching the 32K storage limit?

: We are already using several @SCRIPT: to pull in common code into our jobs

: The error we are getting is: BETA: Pathology Charge Import v1.0: Remote job
: execution error. Exit code: -1. An error occurred while executing
: automation script: Line 551: Could not connect to server . Service not
: available. Extended error code: 4.

: This occurs when we are testing our “onerror routine” We are expecting the
: job to continue processing through a CASE statement. But, instead, the job
: hurls on the first concatex: ConcatEx ("AUTOMATION ERROR Processing
: Notification - Charge Import (", job_name, ") - File
: \"", source_file_name, "\"", error_mail_subject)

: The error message is correct the server is unavailable. But I need to
: continue processing the job and let script send an e-mail with the error.

: When I try to paste the Concatex line into the “Immediate” window and press
: F6 to run the code, a “Bad number of arguments” error is returned.

: Additional testing came up with a different error. When trying to delete a
: Read Only file. I get a 24x7 dialog box on the same line, line 551 the
: Concatex line. “Error Copying file \\path\E4\filename Error: 0 the
: operation complete successfully. “

: What am I doing wrong here?

: The is the actual code from the script: ERROR_HANDLING: GetLastError
: (job_error)

: ConcatEx ("AUTOMATION ERROR Processing Notification - Charge Import
: (", job_name, ") - File \"", source_file_name,
: "\"", error_mail_subject)

: ChooseCase (job_progress, END_CHOOSE_CASE_JOB_PROGRESS)
: //Failure occurs before any files were moved or copied.

: Case 10

: ConcatEx ("AUTOMATION ERROR Processing Notification - Charge Import
: (", job_name, ")", error_mail_subject)

: ConcatEx ("The automation error occurred before any file was
: processed.", error_mail_body)
: //The source file has been determined to be invalid but it has not been moved
: //to the error subdirectory.

: Case 20
: …-

: Thank you for your help.

: ~Joe

Fri Jan 30, 2004 1:50 pm View user's profile Send private message
Bill



Joined: 10 Feb 2004
Posts: 4

Post Re: bumping into 32K script limit Reply with quote

To add my two cents worth--I don't think that a script of more than a couple
of hundred code lines necesarily has a bad design.

Our site is running numerous very complex scripts of hundreds of lines
each and we run into the "32K" limit a lot. We are
forced to break the job up into several jobs that
run each other in sequence. Passing values
between the scripts is a problem and is messay and
inefficient. A far better design would be one
LARGE script that did all the processing needed for
a particular task.

To its credit, 24x7 lends itself to highly complex
automation tasks, and that is why many of us chose
the product in the first place. Please continue to support and
improve the ability of 24x7 to support these kinds
of jobs. And while you're at it, eliminating
the annoying 32K limit would be really helpful.

: Well, I think if your job script is more than couple of hundreds lines of
: code then there is something wrong with the job design.

: Try to not put everything in one script. If you have any common processing in
: your script which you use again and again, create a user-defined function
: and move that code there. If the script does a lot of different things try
: to partition it into multiple independent jobs. This way you can also
: create restarting point you can use if you want to rerun only certain
: parts of the processing.

: Regarding the error. I would like to suggest turning on the tracing option
: (Tools/Options menu; Log page, Trace enabled) and re-running the script
: with the trace enabled. You can find all script trace files in the
: Performance Data directory or your can check SCRIPT.LOG file which
: contains trace for the most recent run.
: This trace should clearly show all commands with all executed parameters and
: their values and this should help you figuring out what went wrong.

Tue Feb 10, 2004 5:56 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: bumping into 32K script limit Reply with quote

If you use external .JAL files you can avoid 32K limit on the script size. In the actual job script you can reference your files as
@SCRIPT: c:\scripts\myscript.jal

: To add my two cents worth--I don't think that a script of more than a couple
: of hundred code lines necesarily has a bad design.

: Our site is running numerous very complex scripts of hundreds of lines
: each and we run into the "32K" limit a lot. We are
: forced to break the job up into several jobs that
: run each other in sequence. Passing values
: between the scripts is a problem and is messay and
: inefficient. A far better design would be one
: LARGE script that did all the processing needed for
: a particular task.

: To its credit, 24x7 lends itself to highly complex
: automation tasks, and that is why many of us chose
: the product in the first place. Please continue to support and
: improve the ability of 24x7 to support these kinds
: of jobs. And while you're at it, eliminating
: the annoying 32K limit would be really helpful.

Thu Feb 12, 2004 10:35 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.