Page 1 of 1

Processing files in a directory (was:Passing parameter)

Posted: Fri Sep 28, 2001 10:36 pm
by admin
This is a topic for an orphaned message.

Posted: Fri Sep 28, 2001 10:36 pm
by admin
Note also that BASIC can open a directory as if it were a table (use OpenPath statement), then the filenames in that directory appear to be key values for that table. Your job control code might make use of this feature. This is one of many techniques taught on "Programming with DataStage BASIC".

Posted: Thu Oct 04, 2001 10:45 pm
by admin
Check the BASIC manual that installs under your DataStage clients. OpenPath has the same syntax as Open, except that you specify a full pathname rather than a table (file) name. For example, if you want to open /tmp and process each filename in it:

OpenPath "/tmp" To filevariable
On Error
Msg = Unable to open "/tmp" directory. Code = :Status()
Call DSLogWarn(Msg, "Controller")
End
Then
Select filevariable ; * generate list of file names
Loop
While ReadNext filename
GoSub ProcessFilename ; * whatever
Repeat
End
Else
Msg = Unable to open "/tmp" directory. Code = :Status()
Call DSLogWarn(Msg, "Controller")
End

-----Original Message-----
From: Scott Brooks [mailto:sbrooks@psu.edu]
Sent: Friday, 05 October 2001 00:39
To: ray.wurlod@Informix.Com
Subject: RE: Processing files in a directory (was:Passing parameter)


Hi Ray,

Hope you dont mind me asking you this directly. Ill send it to the listserv list if you would like instead. Question on your email below: I looked for an OpenPath statement but couldnt find it. Could you possible send me an example? (Id like to get a directory list into an array to
process.)

Thanks,

Scott

Scott Brooks
Technical Analyst
Information Resources and Technology
Penn State Milton S. Hershey Medical Center
(717)531-8374
sbrooks@psu.edu


>>> ray.wurlod@Informix.Com 09/28/2001 6:36:23 PM >>>
Note also that BASIC can open a directory as if it were a table (use OpenPath statement), then the filenames in that directory appear to be key values for that table. Your job control code might make use of this feature. This is one of many techniques taught on "Programming with DataStage BASIC".

Posted: Tue Oct 09, 2001 2:56 pm
by admin
>>> ray.wurlod@Informix.Com 10/04/2001 6:45:38 PM >>>
Check the BASIC manual that installs under your DataStage clients. OpenPath has the same syntax as Open, except that you specify a full pathname rather than a table (file) name. For example, if you want to open /tmp and process each filename in it: ....