How to remove extra lines in the output file?

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

Post Reply
namtrinhthanh
Participant
Posts: 3
Joined: Thu Sep 28, 2006 12:49 am

How to remove extra lines in the output file?

Post by namtrinhthanh »

I want to extract table from Oracle using DSExecute and sqlplus as below:

cmd = "sqlplus -s ":userID:"/":passWD:"@":dbName:" @":sFolder:"\eAccountBilling.sql ":extractDate:" > AccountBilling.txt"

Call DSExecute("NT",cmd,output,rc)

I use one parameter extractDate to pass to sql script file eAccountBilling.sql

In script file, I specify that parameter as &1. When this job runs, the value of the parameter I passed is: 2006-09-30

This job works fine, however, the output file contains the query result and 2 extra lines as:
old 1: select * from ACW.Package a where a.MIS_UPDATE_DATE between trunc(cast('&1' as date) -1) and trunc(cast('&1' as date) -1) + 0.99999
new 1: select * from ACW.Package a where a.MIS_UPDATE_DATE between trunc(cast('2006-09-30' as date) -1) and trunc(cast('2006-09-30' as date) -1) + 0.99999

... query result goes here

Could somebody tell me how to remove those 2 extra lines from the output file? Thank you!
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard. :D

It would appear that you have a switch enabled in your shell that reports argument substitutions. If you can find out what this switch is, disabling it ought to remove the message.
Type CMD /? to find out more about shell switches.

You might also like to try using %1 rather than &1 as the argument placeholder.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard. :D

It would appear that you have a switch enabled in your shell that reports argument substitutions. If you can find out what this switch is, disabling it ought to remove the message.
Type CMD /? to find out more about shell switches.

You might also like to try using %1 rather than &1 as the argument placeholder.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
namtrinhthanh
Participant
Posts: 3
Joined: Thu Sep 28, 2006 12:49 am

Post by namtrinhthanh »

Thank you, Ray! Could you tell me some examples about the switch in the shell? I do not know how to find those switches.
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Open a CMD shell (Start > Run > cmd)
Type in CMD /?
Read what's displayed.
Type EXIT to exit from shell.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
namtrinhthanh
Participant
Posts: 3
Joined: Thu Sep 28, 2006 12:49 am

Post by namtrinhthanh »

I have found the solution, we need to include this command in the script file: SET VERIFY OFF.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So, in other words an Oracle sqplus setting, nothing to do with the shell script at all but rather the sqlplus script.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply