Page 2 of 2

Posted: Thu Nov 03, 2005 2:48 am
by ArndW
The script called in the filter stage does "things" and calls Cosort, which will consume the input and generate an output file upon input stream completion, not sending any data rows to the sequential file, this is probably triggering the sequential file error.

Posted: Thu Nov 03, 2005 2:58 am
by ray.wurlod
If that's the case, then cat $filename near the end of the script would push the contents of that file onto stdout, ne c'est pas?

Posted: Thu Nov 03, 2005 9:39 am
by kaps
Thanks Ray and Arnd...

I think what Arnd says is happening in this situatuion...It looks like it's not able to write to the seqential file after the sorting. I have mentioned stdout as my output file...but it does not work.

Anyway this is my shell script which is called from filter command...
fyi...cosort_env file is just a user defined file which has some values defined for reusability...

[code]#!/usr/bin/ksh

. /home/A136650/cosort/cosort_env

INP_FILE=$1
DDF_FILE=$2
KEY_FILE=$3

OUT_FILE=`basename $INP_FILE .csv`

export PROJ_DIR
export SCR_DIR
export INP_FILE
export DDF_FILE
export KEY_FILE

sortcl /spec=$SCR_DIR/tmplsort1.scl

return=$?
if test $return -eq 0
then
# echo JOB COMPLETED SUCCESSFULLY
exit $RETURN
else
# echo JOB HAS FAILED
exit $RETURN
fi

My cosort script looks like this...



[/code]/monitor=1
#INPUT SECTION
/infile=$INP_FILE
/alias=inputf
/spec=$PROJ_DIR/$DDF_FILE

#ACTION SECTION
/SORT
/spec=$PROJ_DIR/$KEY_FILE

#OUTPUT SECTION
/outfile=stdout

Let me know if you guys find any bug in this...

Thanks again for your continous cooperation...

Kaps

Posted: Thu Nov 03, 2005 10:01 am
by ArndW
No direct problem, except the scripts wants a complete file but is only getting one row per call.

Create a pipe somewhere on your system with

Code: Select all

mkfifo mypipe.fifo
Execute a shell command at the beginning of the job in the before-job call doing a

Code: Select all

nohup {yourscript} mypipe.fifo param2 param3 &
and declare your job's output sequential file to be the pipe "mypipe.fifo"