Unix redirection issue when using echo/print

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
prabu
Participant
Posts: 146
Joined: Fri Oct 22, 2004 9:12 am

Unix redirection issue when using echo/print

Post by prabu »

Hi All DS Folks,
i am creating a file by re-directing the output of UNIX echo/print command. the command goes thr' (Meaning there is no error after the command is executed) but no file is getting cerated. i would very much appreciate any help on this is.

sample code like

Code: Select all


UNIX_COMMAND='echo  "':FILE_TERMINATOR:'">':OUTPUTDIR:'filename.head'

 
      Call DSExecute('UNIX', UNIX_COMMAND, Output, SystemReturnCode)
            If  SystemReturnCode <> 0 Then 
                * Fatal Error - No Return
                Call DSLogFatal("Job Failed- MyJobName ":Output, "JobControl")
                Abort 
                return

            End


Note: Is there any way of Adding an header and a footer to a file other than using WriteSeq/WriteSeqF routines.

[/code]
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

You are probably getting fouled up with the quotes. Experiment and write a script and just execute the script instead of the echo command with redirection.

DSExecute has issues with quotes in the command, it can get messy.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
prabu
Participant
Posts: 146
Joined: Fri Oct 22, 2004 9:12 am

Post by prabu »

kcbland wrote:You are probably getting fouled up with the quotes.
Works like hell , if the quotes are removed :P . lesson learnt : Dont play with Quotes. thanks for the suggestion
Post Reply