Functions

JCL functions are organized into Categories and Subcategories. Browsing the taxanomy of available functions will provide a good overview of the functionality provided by the module.

System Functions

System functions provide a broad range of capabilities. Generally these functions are used to configure the behavior of JCL and are used to query the module for the current system configuration and status. Simple jobs may only use one or two initialization functions and the exit function, but many more functions are available which allow jobs of almost any level of complexity to be built.

Job Initialization
Job Shutdown
File and User
  • sys_get_script_file

  • sys_set_script_file

  • sys_set_conf_file

  • sys_get_user

Timer
  • sys_timer

  • sys_wait

  • sys_ctime2str

Job Information
  • sys_disp_active_jobs

  • sys_disp_doc

  • sys_disp_pod_section

  • sys_require_pod_section

Command Line
  • sys_get_commandline

  • sys_get_commandline_opt

  • sys_get_commandline_val

  • sys_get_commandline_yesno

  • sys_get_commandline_bool

Plugins
  • sys_init_plugin

  • sys_get_path_plugin_dir

  • sys_set_path_plugin_dir

Notification Output
  • sys_info

  • sys_warn

  • sys_die

  • sys_error

Email
  • sys_get_mail_server

  • sys_get_mail_from

  • sys_get_mail_emailto

  • sys_get_mail_email_levels

Console Settings
  • sys_get_console_levels

  • sys_set_console_levels

  • sys_set_verbose

  • sys_clear_verbose

Log Settings
  • sys_get_log_file

  • sys_get_log_filefull

  • sys_get_log_logging_levels

  • sys_get_log_console_levels

  • sys_get_log_gdg

  • sys_get_logging_levels

  • sys_set_logging_levels

Job Execution
  • sys_run_job

  • sys_run_job_background

  • sys_run_job_wait

  • sys_run_job_maxrc

  • sys_run_job_reset

Database Information
  • sys_get_dbdescr

  • sys_get_dbinst

  • sys_get_dataenvr

Logging Functions

These functions handle log file content. Use these functions to put information into the job’s log file. Content is identified in the log file using the severity level indicated in the function name.

  • log_fatal

  • log_error

  • log_warn

  • log_info

  • log_debug

  • log_write_log

  • log_write_screen

Database Functions

These functions provide connectivity and database interface. The data query functions provide a large number of general purpose database management capabilities. Support for common DDL tasks is provided thru a standardized interface. Actual implementation of the tasks is performed by database stored procedures. These have been wrtten and are available for use with an Oracle database (contact the author for more information). Functions are also provided here for Oracle output, bulk load, and general stored procedure execution.

Initialization
  • db_init

  • db_init_getval

  • db_init_setval

  • db_get_defenvr

Connection
  • db_connect

  • db_nil

  • db_finish

  • db_disconnect

Query Execution
  • db_prepare

  • db_execute

  • db_commit

  • db_get_sth

  • db_fetchrow

  • db_fetchrset

  • db_bindcols

  • db_error

  • db_rollback

Convenience Query Functions
Special Purpose Query Functions
Database Schema Management (Database Interface Functions)
  • db_jcl_create_table

  • db_jcl_table_exists

  • db_jcl_analyze_table_compute

  • db_jcl_analyze_table_estimate

  • db_jcl_rename_table

  • db_jcl_truncate_table

  • db_jcl_drop_table

  • db_jcl_create_index

  • db_jcl_index_exists

  • db_jcl_create_unique_index

  • db_jcl_create_bitmap_index

  • db_jcl_add_constraint

  • db_jcl_enable_constraint

  • db_jcl_disable_constraint

  • db_jcl_drop_constraint

  • db_jcl_rename_index

  • db_jcl_drop_index

  • db_jcl_comment_on_table

  • db_jcl_get_table_comment

  • db_jcl_comment_on_view

  • db_jcl_get_view_comment

  • db_jcl_comment_on_column

  • db_jcl_get_column_comment

  • db_jcl_create_view

  • db_jcl_view_exists

  • db_jcl_drop_view

  • db_jcl_create_function

  • db_jcl_function_exists

  • db_jcl_drop_function

  • db_jcl_create_procedure

  • db_jcl_procedure_exists

  • db_jcl_drop_procedure

  • db_jcl_grant_permission

  • db_jcl_exchange_partition

Stored Functions and Procedures (Oracle Interface Functions)
  • db_func

  • db_func_in

  • db_proc

  • db_proc_in

  • db_proc_out

  • db_proc_inout

Database Output (Oracle Interface Functions)
  • db_dbms_output_enable

  • db_dbms_output_disable

  • db_dbms_output_get

Bulk Load (Oracle Interface Functions)
  • db_sqlloader

  • db_sqlloaderx

  • db_sqlloaderx_parse_logfile

  • db_sqlloaderx_read

  • db_sqlloaderx_skipped

  • db_sqlloaderx_rejected

  • db_sqlloaderx_discarded

  • db_sqlloaderx_elapsed_time

  • db_sqlloaderx_cpu_time

Utility Functions

These functions provided file access and string manipulation functions. If you are working with dates, you will find the Date Handling functions to be very useful. JCL allows you to store passwords either encrypted or unencrypted in the system data conf file. It is strongly recommended that you store all passwords in encrypted form. The Password functions below, along with the password management tools provided in the distribution will provide you with support for those tasks.

File Access
  • util_get_filename_load

  • util_get_filename_extr

  • util_get_filename_log

  • util_read_header

  • util_read_footer

  • util_read_file

  • util_write_header

  • util_write_footer

  • util_print_table

  • util_move

  • util_file_exists

  • util_get_footer_recordcount

  • util_get_file_recordcount

  • util_get_file_sizediff

String Manipulation
  • util_trim

  • util_zsdf

  • util_yn2bool

  • util_bool2yn

  • util_normalize_path

  • util_sort_distinct

Date Handling
  • util_parse_datespec

  • util_is_date

Password
  • util_encrypt_password

  • util_decrypt_password

FTP Functions

If you need to extract data out of your system and send it to another database system that only accepts file input, you can use the file transfer function to handle file transmit operations.

  • ftp_put