Thursday, March 6, 2014

Call Unix Script from SQR

A sample code to call a UNIX script from an SQR program.

!**********************************
! Procedure:    Run-Script                            *
! Description:  Calls a unix script from SQR *
!**********************************
begin-procedure Run-Script
#debug show 'Entering Run-Script'

! call script located in /ps_scripts folder 
let $cmd = $PS_HOME || '/ps_scripts/script_name'
display $cmd
call system using $cmd #call_status
if #call_status <> 0
    show 'Could not call script.  Program being stopped.'
    STOP Quiet
end-if

#debug show 'Leaving Run-Script'
end-procedure !Run-Script

No comments:

Post a Comment