search tips

















AddPageBreak.prl

Description

Formats the output file with page breaks for easy printing and viewing.

Command Syntax

AddPageBreak.prl <Input File> <Output File> <Line Number>

Parameters (Required)

<Input File>
The full path name to the input file.
<Output File>
The full path name to the output file.
<Line Number>
Specifies the line number where the script will add a page break. For example if <Line Number> value is 33, the script will add a page break every 33 lines.

Return Codes

0
The script was able to add the appropiate page breakes per specified number of lines.
1
Invalid Number of Arguments.
3
The input files does not exist.

Error Messages

  • ERROR: invalid number of arguments passed.
    Look at the command syntax to verify all arguments were passed correctly.
  • File <Input File> does not exist.
    The input file does not exist, so please check to make sure it exists.

Examples

  • AddPageBreak.prl C:\temp\input.txt D:\output.txt 33
    Creates the D:\output.txt file from the C:\temp\input.txt file after adding page breaks every 33 lines.
  • AddPageBreak.prl /tmp/input /tmp/output 33
    Creates the /tmp/output file from the /tmp/input file after adding page breaks every 33 lines.

Download this Script

BulkStoredProc.prl

Description

Submits a file with Stored Procedures stored on it to the StoredProc.prl script.

Command Syntax

BulkSordProc.prl <Sybase Server> <Sybase User> <Sybase Password> <Sybase DB> <Stored Proc> <Parameter file>

Parameters (Required)

<Sybase Server>
The Sybase Server that the user desires to read parameters from.
<Sybase User>
The Sybase User that will connect to the Sybase Database to run a procedure.
<Sybase Password> The password required to connect to the
Sybase database with the Sybase user.
<Sybase DB> The Sybase database that the user wishes to connect to.
<Stored Proc> The stored procedure to add parameters to.
<Parameter file>
The parameter file that is read and to added to StoredProc.prl.

Return Codes

0
The procedure completed successfully.
1
Invalid number of arguments passed. Check syntax of script.
3 Parameter file referenced does not exist. Check location of file.
5
Error was encountered during process of updating StoredProc.syprl

Error Messages

  • Error: Invalid number of arguments passed
    Usage:
    BulkStoredProc.prl Server User Password Database Stored_Proc Parameter_filename
    There was something wrong with syntax of the command. Make sure the correct number of arguments was passed.
  • Error: <file> File does not exist
    The specified parameter file does not exit. Check the location of the file to be sure it actually exists in the specified location
  • Error while running <program>
    An error occurred during the process of updating StoredProc.syprl. Check the Sybase User and password to be sure they were correct.

Examples

  • BulkStoredProc.prl Prod Autosys Preekdsk Syb3 proced param.txt
    Adds parameters from flat file named param.txt, to stored procedure named proced, using user name Autosys, with password Preekdsk, within database Syb3, on Sybase server Prod.

Download this Script

JobAlarms.syprl

Description

Prints status of jobs and job names.

Command Syntax

JobAlarms.syprl <Server> <User> <Password> <Database> <Alarm State>

Parameters (Required)

<Server>
The name of the server you desire to report alarms on.
<User>
The user name with the valid access rights.
<Password> The password associated with the user name.
<Database> The name of the database which you wish to report alarms on.
<Alarm State>
Specify the alarm status you wish to show.

Return Codes

0
The report has completed successfully.
2
Invalid number of arguments.
4
Invalid alarm status specified.

Error Messages

  • Process Complete
    The reporting process is now complete.
  • Error: Invalid number of arguments passed
    Please check to make sure that the number of arguments is correct.
  • Alarm State is an invalid state type
    Please check to make sure that the specified alarm state is valid.

Examples

  • JobAlarms.syprl Test Admin Administrator Resource Duplicate_event
    Logs into the Test server with the user name "Admin" and the password "Administrator." Reports on all the events within the Resource database that has a "Duplicate_event" alarm status.

Download this Script

JobCalc.syprl

Description

This syprl script gives the total number of jobs in the database (does not include boxes as jobs). Can also be broken down to the number of jobs that are in any given state (i.e. running, inactive, activated, failure, success, etc.). This is very useful in report format to balance the workload in a production environment.

Command Syntax

JobCalc.syprl <Server> <User> <Password> <Database> <Output file> [<optional parameters>]

Parameters (Required)

<Server>
The name of the server where you desire to report the number of jobs.
<User>
The user name with the valid access rights.
<Password> The password associated with the user name.
<Database> The name of the database where you desire to report the number of jobs.
<Output File>
Name and location of report.

Parameters (Optional)

<Group Designation>
The group you wish to calculate.

Return Codes

0
Process Complete.
1
Invalid number of arguments.
3
Error occurred during renaming process.

Error Messages

  • Process Complete
    The calculation process is completed successfully.
  • Error: invalid number of arguments passed
    Please check to make sure that the number of arguments is correct.
  • Error: during renaming
    An error occurred during the renaming process.

Examples

  • Jobcalc.syprl Test Admin Administrator Resources c:\output Failure
    Logs into the Test server with the user name "Admin" and the password "Administrator." Reports on all the jobs within the Resource database that have the status of "Failure". The report is named "output" and is located in the c:\directory.
  • Jobcalc.syprl Test Admin Administrator Resources /tmp/output Failure
    Logs into the Test server with the user name "Admin" and the password "Administrator." Reports on all the jobs within the Resource database that have the status of "Failure". The report is named "output" and is located in the /tmp directory.

Download this Script

MachDepends.syprl

Description

Generates the list of jobs that run on that specified machine.

Command Syntax

MachDepends.syprl <Machine> [<optional parameters>]

Parameters (Required)

<Machine>
The machine where you desire to list all the jobs.

Parameters (Optional)

-I <INSTANCE> Specifies the AutoSys Instance name to query.
-F <filepath>
Specifies the path and filename for the output report

Return Codes

0
The query generated the list of jobs which rely on a specific machine.
1
The script was killed while generating the Job list.
7 The query could not access the AutoSys INSTANCE, or the INSTANCE was not specified.
9
The File could not be written - either the destination does not exist, or the target file already exists

Error Messages

  • Job Terminated Prematurely
    Something killed the NT/UNIX process that was gathering the list of information.
  • Could not ACCESS AutoSys INSTANCE
    The AutoSys INSTANCE could not be reached to submit queries. Either there is something wrong with the Database, or the INSTANCE currently has configuration problems.
  • Target File could not be written too
    Either the directory specified does not exist, or the File already exists.

Examples

  • MachineDepends.syprl MACHINE -I PSY -F /tmp/report.txt
    Creates a text report that lists all the jobs that run on MACHINE. This report will be generated from the PSY AutoSys instance and will be placed in the /tmp directory called "report.txt."

Download this Script

RunSQL.syprl

Description

Submits a file or command that generates a report from the database of the scheduler.

Command Syntax

RunSQL.syprl <Machine> <User> <Password> <DataBase> <SQL file/command> [<optional parameters>]

Parameters (Required)

<Machine>
The machine that you want the SQL commands to execute on.
<User>
The User name to access the SQL database.
<Password> The Password used to access the SQL database.
<DataBase>
The DataBase the SQL commands will query.
<SQL cmd or file>
The actual SQL command or SQL file to be executed.

Parameters (Optional)

<filepath>
Specifies the specific file that the output is sent. If not selected, output will be directed to STDOUT.

Return Codes

0
The SQL command executed successfully, and the output was either sent to <filepath> if a path was specified, or the output is in STDOUT.
1
Invalid Number of Arguments.
2
The SQL command was not specified.
> 3
SQL command error.

Error Messages

  • ERROR: invalid number of arguments passed.
    Look at the command syntax to verify all arguments were passed correctly.
  • File <SQL File> does not exist.
    The SQL file does not exist.
  • File <SQL File> can not be opened.
    The SQL file does not have the appropriate permissions.
  • Error: while processing <SQL command>.
    SQL could not perform the appropriate SQL command. More information pertaining to SQL will follow this message.

Examples

  • RunSQL.syprl DEV peoplesoft testing123 PSY /tmp/report.sql
    Runs the list of SQL commands in /tmp/report.sql, on DEV using peoplesoft as the user and testing123 as the password, on the database PSY. The result is output to STDOUT.
  • RunSQL.syprl PSY /tmp/report.sql
    /tmp/report.out
    Runs the list of SQL commands in /tmp/report.sql, on DEV using peoplesoft as the user and testing123 as the password on the database PSY. The output is saved with the filename, report.out, in the /tmp directory.

Download this Script

StoredProc.syprl

Description

Technical Disclaimer (Our consultants made us say this!)
Keep in mind, tailoring these scripts to your environment requires a strong working knowledge of Perl and shell scripting. If you would like a Stirling consultant to help you, contact us for a price quote.

Now that we've said all that, these scripts are free! The functionality of each script is listed below. If you would like to receive a script, email toolkit@stirlingsystems.com.

Legal Disclaimer (Our attorneys made us say this!)
Stirling Systems Group, LLC makes no warranties or representations, express or implied, without limitation, and in no event will Stirling Systems Group, LLC be liable to you or any party for ANY loss including time, money, goodwill and consequential damages which may arise from your use of these scripts. By requesting these scripts, you agree to the above terms.

Runs each Stored Procedure in the Sybase Database.

Command Syntax

StoredProc.syprl <Machine> <User> <Password> <DataBase> <Stored Procedures>

Parameters (Required)

<Machine> The machine to execute the Sybase Stored Procedures on.
<User> The User name used to access the Sybase database.
<Password>
The Password used to access the Sybase database.
<DataBase>
The DataBase the Sybase stored Procedures will query.
<Stored Procedures file>
The actual SQL commands stored in the file to be executed on the Sybase Database.

Return Codes

0
The SQL command executed successfully, and the output was sent to STDOUT.
1
Invalid Number of Arguments.
3 or higher
SQL command error.

Error Messages

  • ERROR: invalid number of arguments passed.
    Look at the command syntax to verify all arguments were passed correctly.
  • Error: while processing <SQL command>.
    SQL could not perform the appropriate SQL command. More information pertaining to SQL will follow this.

Examples

  • StoredProc.syprl TEST develop PASSWORD PSY
    /tmp/stored_proc
    Runs the list of stored procedures located in /tmp/stored_proc, on the machine TEST using develop as the user and PASSWORD as the password, on the Sybase DB PSY. The result is output to STDOUT.

Download this Script

Tbls_DB.syprl

Description

Outputs all the contents for all tables in the AutoSys Database.

Command Syntax

Tbls_DB.syprl <Machine> <User> <Password> <DataBase>

Parameters (Required)

<Machine>
The Machine to execute the SQL commands.
<User>
The User name used to access the SQL database.
<Password> The Password used to access the SQL database.
<DataBase> The DataBase the SQL commands will query.

Return Codes

0
The SQL command executed successfully. The output includes the names of all the tables in the AutoSys DB, saved in the tables.txt file, and the contents of all the tables, saved in the db_cont.txt file.
1
Error with SQL select statements.

Error Messages

  • File does not exist.
    The specified file does not exist.
  • File can not be opened.
    The specified file does not have the appropriate permissions.
  • Error: while processing <SQL command>.
    SQL could not perform the appropriate SQL command. More information pertaining to SQL will follow this message.

Examples

  • Tbis_DB.syprl MACHINE AutoSys PASSWORD PSY
    Lists the table contents for all the tables in the AutoSys Database located on MACHINE with AutoSys as the user and PASSWORD as the AutoSys password on the AutoSys dB PSY. The results are output to the tables.txt and db_cont.txt files located in the same directory as the Tbls_DB.syprl script.

Download this Script

Tbls_Some.syprl

Description

Outputs the contents of a user-specified table from the AutoSys database to the screen or file.

Command Syntax

Tbls_Some.syprl <Machine> <User> <Password> <DataBase>

Parameters (Required)

<Machine>
The Machine to execute the SQL commands on.
<User>
The User name used to access the SQL database.
<Password>
The Password the used to access the SQL database.
<DataBase>
The DataBase the SQL commands will query.

Return Codes

0
The SQL command executed successfully. The output includes the desired table from the AutoSys database and is printed to the screen
1
Error with SQL select statements.

Error Messages

  • File does not exist.
    The specified file does not exist.
  • File can not be opened.
    The specified file does not have the appropriate permissions.
  • Error: while processing <SQL command>.
    SQL could not perform the appropriate SQL command. More information pertaining to SQL will follow this message.

Examples

  • Tbis_Some.syprl MACHINE AutoSys PASSWORD PSY
    Lists the contents of a user-specified AutoSys table from the AutoSys Database, located on MACHINE with AutoSys as the user and PASSWORD as the AutoSys password, on the AutoSys DB PSYS. The results are displayed on the screen or printed to a file. The user will be prompted on-screen for the name(s) of the AutoSys tables(s).

Download this Script

Comments, suggestions or problems with our web site?
Please send email to: webmaster@stirlingsystems.com

© 2002 Stirling Systems Group, LLC
All Rights Reserved.