Thursday, October 11, 2012

DRV Script Creation


 DRV --> Driver Script

DRV files are used to execute the Shell Scripts from Main Frame / ESP Scheduled Programs.
Instead of executing the concurrent programs in Concurrent Requests Window, we use drv scripts
to execute intended shell scripts.

#!/bin/ksh
#-------------------------------------------------------------------------------
#
# FILE: aol@2804.drv
#
# DESCRIPTION:  script to get ECOVA files from pgp server to inbound
#
#
# Revision History
#
# Date       Revision By       Description
# ---------- ----------------  ----------------------------------------------
# 2011-10-11 Chandra Sekhar K  created
#
#-------------------------------------------------------------------------------
#
# $Revision:   1.0  $
# $Workfile:   aol@advatageiq.drv $
# $Log:   //ccpvcs01/pvcsvm/bstfs/oracle_financials/ESP_scripts/aol@5015.drv  $
#
#
#-------------------------------------------------------------------------------
#
[[ $DEBUGESP != "no" ]] && set -vx
#
. ESPStep0.sh
. ESPprocs.sh


ESPecho "STEP 0 COMPLETED"

#----------------------------------------------------------------------
#
# step 10 - Receive file from pgp server
#
#----------------------------------------------------------------------

STEPexec 10 xxhbc_get_ecova_file.sh ccpgp01

#----------------------------------------------------------------------
#
# end of job
#
#----------------------------------------------------------------------

ESPupdate 999
--- End of Drv File .



Shell Script :

#!/usr/bin/ksh
#################################################################################################
##    Name        : xxhbc_get_ecova_file.sh                                                                      ##        
##    Description : This script will used to get AP008*_42.dat inbound                            ##
##                  files from pgp server                                                                                 ##
##    Parameters  : ccpgp01                                                                                            ##
##    Source Server : ccpgp01                                                                                        ##
##    Source Path : /pgp/csftp6e/adviq/                                                                           ##
##    Destination : $XXHBCDATA_TOP/inbound/ap                                                      ##
##    Created By : Chandra Sekhar Kadali                                                                      ##
##    Created On : 11-OCT-2011                                                                                   ##
##                                                                                                                                  ##
##      Change History                                                                                                     ##
##      --------------                                                                                                        ##
##    Modified BY                       Date            Version      Comments                               ##
##    --------------------              ---------       --------     ----------------------             ##
##    Chandra Sekhar Kadali             11-OCT-2011     1.0          Initial Creation               ##
#################################################################################################
MACHINE=$1

echo "Machine Name"
echo $MACHINE


LUSER=$(grep $MACHINE $OL_HOME/filepw | awk '{print $4}')

echo "User Name"
echo $LUSER

LPWD=$(grep $MACHINE $OL_HOME/filepw | awk '{print $6}')

echo "Password"
echo $LPWD

echo "Moving Files"

##  get files from pgp server
ftp -niv $MACHINE <user $LUSER $LPWD
cd ..
lcd $XXHBCDATA_TOP/inbound/ap
mget /pgp/csftp6e/adviq/financein/AP008*_42.dat 
 quit
FTP

echo "Apply Execution Permissions"

chmod 654 $XXHBCDATA_TOP/inbound/ap/AP008*_42.dat

## Moving files to Inbound Directory
##for file in $XXHBCDATA_TOP/inbound/ap/AP008*_42.dat
##do
##echo "Moving Files"

## mv $file $XXHBCDATA_TOP/inbound/ap/$file
## chmod 644 $XXHBCDATA_TOP/inbound/ap/$file
##done

No comments:

Post a Comment