Processing files in a directory (was:Passing parameter)

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Processing files in a directory (was:Passing parameter)

Post by admin »

This is a topic for an orphaned message.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post 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".
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post 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".
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post 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: ....
Locked