script into job CTRLM : trouble Treatment awk

All questions about Control-M jobs definitions
Post Reply
User avatar
Ozarm
Nouveau
Nouveau
Posts: 37
Joined: 14 Jun 2007 12:00

script into job CTRLM : trouble Treatment awk

Post by Ozarm » 27 Jan 2011 12:58

Hi,

I'm beginner in CTRLM/EM (v620 syb)
I have a script unix AIX which works .ksh

but I try to schedule this script into a job
parameters job is Ok (memname, PATH,...)

I throw a requete sql
isql -Uuser -Ppwd <<EOF> /produits/TEST/TEST1/TableUpload.txt
select DATA_CENTER,SCHED_TABLE,MODIFIED from DEF_TABLES where MODIFIED="1" and SCHED_TABLE like "%.L1%" and DATA_CENTER not like "DC1" and DATA_CENTER="DC2"
go
EOF

echo "List of Tables has upload"
awk '{print $1,$2}' TableUpload.txt > $LOGFILE

....

I obtain the following error
"+ 0</tmp> /produits/TEST/TEST1/TableUpload.txt
+ echo Voici la liste des Tables a upload
Voici la liste des Tables a upload
+ awk {print $1,$2} TableUpload.txt
+ 1> /produits/TEST/TEST1/UPLOAD.110127.log
awk: 0602-533 Cannot find or open file TableUpload.txt.
The source line number is 1."


Do you have an idea? Syntaxe problem in CTRLM? Treatment of lines by ControlM?

User avatar
th_alejandro
Nouveau
Nouveau
Posts: 188
Joined: 26 Nov 2008 12:00
Location: Bogotá

try this...

Post by th_alejandro » 29 Jan 2011 3:37

echo "List of Tables has upload"

cat TableUpload.txt | awk '{print $1,$2}' > $LOGFILE

User avatar
matom
Nouveau
Nouveau
Posts: 37
Joined: 29 Nov 2006 12:00
Location: Ile de France

Post by matom » 04 Feb 2011 5:34

Hello Ozarm,

Add a "pwd" command in your script.

Try:
awk '{print $1,$2}' /produits/TEST/TEST1/TableUpload.txt > $LOGFILE


Regards
matom

User avatar
Ozarm
Nouveau
Nouveau
Posts: 37
Joined: 14 Jun 2007 12:00

Post by Ozarm » 07 Feb 2011 12:32

Hi,

thank you for your answer

I try with path /produits/TEST/TEST1/ for each line with awk & sed command

and the job works fine.


Thank's again

Post Reply