Configuring FTP on unix script.

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Kel
Participant
Posts: 31
Joined: Mon May 11, 2015 3:20 am
Location: Robinsons Cybergate Tower 2
Contact:

Configuring FTP on unix script.

Post by Kel »

Hi,

Cant find anywhere else to ask for help. Hope someone can enlighten.

We have a datastage sequence which we want to execute via shell script. The first job activity in that sequence is an FTP object writing to a sequential file.

On datastage, that job is working fine, however, on the script, it is being aborted with the following errors:

Host key verification failed.
Connection closed
Server Name: Error occurred during initializeFromArgs().
Creation of a step finished with status = FAILED.

Below is the script. Hope you can help guys.

Code: Select all

# Initialize enviromental parameters to use Datastage commands.
cd /opk/IBM/InformationServer/Server/DSEngine
. ./dsenv > /dev/null 2>&1

#"Project Name"
v_ambiente=DESA_HUB_NAL
	
# Define a path where will be the log of each run
v_pathLogs=/interfaces/hub/temp/archivos
VpathRuta=/interfaces/hub/temp/archivos	
	
# Name of the jobs that will be executed
v_strJob1=SEQ_HUB_CRM_AUTORIZACIONES

#The path defined process monitoring
PT_PATH='\Jobs\DMR\CALIDAD_DE_DATOS\AUTORIZACIONES\SEQ_HUB_CRM_AUTORIZACIONES'
#The file names are defined
PT_NAME_WARNINGS=LISTA_JOB_WARNING.CSV
PT_NAME_FAILED=LISTA_JOB_ABORT.CSV
PT_NAME_NO_COMPILED=LISTA_JOB_NO_COMPILADOS.CSV
	

# Creates log files that will contain the information of the execution
v_LOG=$v_pathLogs/LOG_HUB_DMR_CRM_AUTORIZACIONES.txt


#Identify the status of the 1st Datastage		
v_msgJob1status=`dsjob -jobinfo $v_ambiente $v_strJob1 | grep "Job Status" | sed "s/.*(//" | sed "s/.$//"` 

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Job1=SEQ_HUB_CRM_AUTORIZACIONES
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Check status, if the last State was failed or stopped then reset the Job1
if [ "$v_msgJob1status" != "1" ] || [ "$v_msgJob1status" != "2" ]; then
	echo " ... Resetting JOB: "$v_strJob1
	dsjob -run -mode RESET  $v_ambiente $v_strJob1
fi

# Estimated date with hours and seconds to display the start time of execution
echo "Job running: "$v_strJob1


# Executes the sequence SEQ_HUB_SFTP_ADDRESS_CRM_FN
dsjob -run -jobstatus $v_ambiente $v_strJob1 1>$v_pathLogs/DatastageError 2>$v_pathLogs/DatastageAix
OUT=$?

if [ $OUT = "1" ]; then
		Vmens="El proceso finalizo correctamente."
		Vest="OK"
		VfechaFin=`date +"%d%m%Y-%H:%M:%S"`
		OUT = 0

	elif [ $OUT = "2" ]; then			
		Vmens="El proceso finalizo correctamente, pero existen warning por revisar. "
		Vest="WARNINGS"
		VfechaFin=`date +"%d%m%Y-%H:%M:%S"`
		OUT=0
	
		# It invokes the Shell to monitor the execution of this process #
		sh $VpathRuta/SEQ_PPAL_MONITOREO.sh $PT_PATH $PT_NAME_WARNINGS $PT_NAME_FAILED $PT_NAME_NO_COMPILED

	else
		Vmens="El proceso finalizo con errores."
		Vest="FAILED"
		VfechaFin=`date +"%d%m%Y-%H:%M:%S"`
		OUT=3
		
		# It invokes the Shell to monitor the execution of this process #
		sh $VpathRuta/SEQ_PPAL_MONITOREO.sh $PT_PATH $PT_NAME_WARNINGS $PT_NAME_FAILED $PT_NAME_NO_COMPILED
		
		
fi

	### Fields to display in the log
	## "JOB NAME | DATE AND START TIME | DATE AND TIME OF END | STATUS AFTER | DESCRIPTION"
	
	echo v_strJob1"|"v_fechaIni"|"v_fechaFin"|"$Vest"|"$Vmens>> $v_LOG 
	
########################################END OF SCRIPT###############################################################################################
BOG
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

"On datastage it is working fine, on script it is failing".

Well, concidering you are working with SSH keys for that SFTP... there are two possibilities.

A) Please validate that the user id running via datastage is the same ID being used in the script. (not the ID for the sftp, the ID for executing the job).

B) Please ensure that the HOST you are running on is the same.

You might be running your jobs in a GRID, and the Compute Node #2 doesn't contain the required keys.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: Configuring FTP on unix script.

Post by ray.wurlod »

Kel wrote:Cant find anywhere else to ask for help.
How about your official support provider?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply