One thing I would do is to add 2>&1 to the end of every line that contains a
>$LOG or >>$LOG.  This will redirect any error messages from stderr to the
log file as well.  Then you can check the log file to see if any type of
error is occurring.  It may be that your script isn't even starting udt.

Also curious why you're using the <<EOD syntax instead of simply doing:

$UDTBIN/udt PHANTOM RUN GD-BPGM EXTRACT_FPO -N

Which would create a como file in _PH_, in which you could also look for
errors.

What happens if you run the script from a Linux command prompt?

BTW, there's nothing in your script that requires ksh.  You could replace
the #!/usr/bin/ksh with either : or #!/usr/bin/bash, and it should run fine.

Larry Hiscock
Western Computer Services


-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of
charles_shaf...@ntn-bower.com
Sent: Friday, August 05, 2011 8:27 AM
To: U2 Users List
Subject: [U2] Job won't run

I have run into something I have never seen before.   We exchange a lot of 
data with an AS400 in Chicago.  For many years we have taken the approach 
that the AS400 would submit a job to our UNIX box that would run a script. 
 Many of the scripts run a Unibasic program and send the resulting file 
back to the AS400.  This happens several times a day and we have been 
doing this for many years. 

One job has started doing something odd.  It runs the script and transfers 
the file, but never runs the Unibasic program, so it has been resending an 
old version of the file.  This seems to have started happening 3 days ago. 
 I can log in manually using the same credentials as the remote job, and 
run the script by typing it in at the command line.  It runs perfectly. 
Unibasic program runs, new file is sent to the AS400.  There is joy.

I have checked permissions.  Nothing has changed at the AS400 end. Nothing 
has changed here.  (That we know of).  I have rechecked the code of he 
script and the Unibasic program.  Looks good.  I am stumped.  Here is the 
script code.

#!/usr/bin/ksh
#Sends FILES_AS400/BOWER_FPO to AS400 as BOWER_FPO

LOG="/NTN/DATA/CORPORATE/FILES_LOG/BOWER_FPO.LOG"
rm $LOG
touch $LOG
cd /NTN/DATA/CORPORATE

echo `date` "Extracting Firm Planned Orders to BOWER_FPO" >$LOG
$UDTBIN/udt<<EOD>>$LOG
RUN GD-BPGM EXTRACT_FPO -N
bye
EOD

echo "Sending Firm Planned Orders to AS400 730" >> $LOG
/usr/local/rputj.scr CORP BOWER_FPO FILES_AS400/BOWER_FPO BOWER_FPO
echo `date` "Finished sending Firm Planned Orders" >>$LOG

This runs perfectly when run from CL, but not when submitted from the 
AS400.  And ideas?

Charles Shaffer
Senior Analyst
NTN-Bower Corporation
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to