SourceFile name as my Domain(Key)

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
chou
Participant
Posts: 14
Joined: Wed Dec 10, 2003 12:19 pm

SourceFile name as my Domain(Key)

Post by chou »

Hi All,

I have a problem, I have to pick a flat file which resides in Unix ...Extract_dir Directory. i have to use the file name as my Domain name which is a key in my hash file. there are like 30files in a month or more. ex.. filename -- www.adhdinfo.com_sem_20031029.txt and in my hash file property_domain as Key which i have to reffer to file name.
filename2 www.elidel.com_smi_20031029.txt. so i have to pick this file name to my property_domain. like this i have more than 30 files.

please help me out.

Thanks,
chou
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
First Welcome aboard :).
unfortunatly I'm not sure I undestand your question, so can you explain it as simple as you can?
what exactly do you need your output to be or what do you want to do with it?
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
chou
Participant
Posts: 14
Joined: Wed Dec 10, 2003 12:19 pm

Post by chou »

thanks Roy,

we have flat files in Unix Dir, which are my source files. I have a Hash file in that i have a Key Property_Domain, which i have to take the source file name as Property_Domain. there are like 30+ source files with diffrent names. these files will come every month.

my question is, how to pick the particular file from unix dir and the source file mane as my Property_domain(KEY in Hash File) which refers and to get the Property_Key to target.

I am not very good explainer. i guess it is some what clear than earlier.

Eg... if i pick the file name www.adhdinfo.com_(datestamp).txt then my property_domain is www.adhdinfo.com. it checks the Hash to get the Property_Key to Target.

Eg..2 If i pick www.elidel.com_(datestamp).txt then Property_Domain is www.elidel.com.......

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

Post by chulett »

You might want to check out this post which details one or two ways to accomplish what you are looking to do.
-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 »

You can get the file names with a Folder stage, or in Job Control code.

You can extract everything to the left of the first underscore using the Field() function. For example:

Code: Select all

Field(filename, "_", 1, 1)
In job control code, you would open the directory as if it were a table (using OpenPath), generate a Select List of the entrynames in the directory, and process that list.
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