Folder Stage

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
astar
Participant
Posts: 6
Joined: Wed Sep 17, 2003 3:01 pm

Folder Stage

Post by astar »

Hi, i need obtain a list of folders contained into a specific path.
I have a job, floder Stage --> T --> Sequential File.
The specific path has 35 sub folders, I run the job and the log shows 35 reads and 35 writes, but the target sequential file with the resulting list is empty.
How can i obtain the list of subfloders with this metodology?
Thaks,

Ariel
raju_chvr
Premium Member
Premium Member
Posts: 165
Joined: Sat Sep 27, 2003 9:19 am
Location: USA

Re: Folder Stage

Post by raju_chvr »

I don't know whether you can get the subfolder list from Folder stage or not. but you can get it from other ways.

if you are on windows machine you can redirect Dir to a text file and parse that file to get the list which is a hard way though ... but it works
anupam
Participant
Posts: 172
Joined: Fri Apr 04, 2003 10:51 pm
Location: India

Post by anupam »

Hi Ariel,

I have a solution for ur problem. U do not need to use Folder stage at all.
U will be creating a file with the names of the folders u want and then reading that file.

the Implementation should be as follow

1. In before Job subroutine execute DOS. The command is

dir /b #PathName# > #PathName#\#FileName#

Where PathName is the path from which u want the names of the folder
FileName is the name of the file where these names will be directed.

2. The constraint should be added in the Transformer stage other wise the #FileName# will also come in the Final File

Job will be like this

sfilestage (name of folders = #FileName# ) --> txfm(Constraint to remove #FileName#) --> sfile (Final File of folder names)


i hope this will solve ur problem
----------------
Rgds,
Anupam
----------------
The future is not something we enter. The future is something we create.
astar
Participant
Posts: 6
Joined: Wed Sep 17, 2003 3:01 pm

Post by astar »

Tanks so much Anupam, i will try a solution like yuo decribe.
Best Regards
Ariel
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
If my memory serves me it is explicitly said not to use folder stage where subfolders exists, check the docs.
so you need some OS solution, be it as said here or any other variation.

Good Luck,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
Post Reply