Need to call a file in Server routine

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
rapaka89
Participant
Posts: 21
Joined: Fri Dec 10, 2010 10:21 am
Location: Hyderabad

Need to call a file in Server routine

Post by rapaka89 »

Hi all

I have a file in UNIX server which I want to call it in server routine

Steps I have implemented -

Called a script in routine which will create a file in a specifed location.

I need to call the file in routine so that I can read it and process further

Can you help me out with this
Naveen Rapaka
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

What are you trying to do? Why cant you read the file in the job and pass it on to the routine?
Arun
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

Call DSExecute("SH", "pathname_of_script", OutputOfCommand, ExitStatusOfCommand)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
greggknight
Premium Member
Premium Member
Posts: 120
Joined: Thu Oct 28, 2004 4:24 pm

Post by greggknight »

The file and path are passed in the file is read and the value returned.
Just a simple one that reads a file with one column and one row.

Code: Select all

Function(FileName)
      **FileName = Trim(FilePath):Trim(Company):"_":Trim(TableName):".SKEY.Stat"
  

      Call DSLogInfo("FileName:":FileName, "Msg")



            OPENSEQ FileName TO FILE2 Then
               ValidOpen = @TRUE
              
               READSEQ vLineRaw FROM FILE2
                  ON ERROR
                     CLOSE FILE2
                     ErrorCode = 1
                     Done = @TRUE
                  End Then
                     
                     vLine = vLineRaw
                     FileStatus = vLine
                     Call DSLogInfo(vLine, "Msg")
                  End Else
                     Done = @TRUE
                  End
               CLOSESEQ FILE2
               Call DSLogInfo("Files Closed", "Msg")
           
               Ans=FileStatus
      END
"Don't let the bull between you and the fence"

Thanks
Gregg J Knight

"Never Never Never Quit"
Winston Churchill
Post Reply