Seq 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
bdixon
Participant
Posts: 35
Joined: Thu Nov 20, 2003 5:45 pm
Location: Australia, Sydney

Seq file

Post by bdixon »

Hi,

I am writing a before subroutine to read a sequential file however under certain circumstances I need to reset the pointer to the top of the file. Is there any way to do this or do I need to close the file and re-open it?

Thanks
Brad
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Check out the SEEK command. I would think you can use that to get back to the beginning of the file.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

Seek filevariable, offset, position
Then
   * statements if Seek successful
End
Else
   * statements if Seek failed
End
The position argument is 0 for current position, 1 for beginning of file, 2 for end of file. Therefore, to position to beginning of file you need

Code: Select all

Seek filevariable,0,1 ...
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply