filter command question ?

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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"
Post Reply