Create Dynamic files
Moderators: chulett, rschirm, roy
Create Dynamic files
Is it possible to create files dynamically based on the some input column value. For example
suppose the the input consist of two columns country_cd and city_cd.
and the input stores the information abt 5 distinct country and their respective city as follow
Country_cd city_cd
===========================
cntry1 city1
cntry1 city2
cntry2 city2
cntry2 city3
cntry3 city4
cntry4 city5
cntry5 city5
what i require here is one seperate file should be created for each county and respective country records should go to the corresponding file.
like the file cntry1.txt should have folllowing records:
Country_cd city_cd
===========================
cntry1 city1
cntry1 city2
Pease let me know if this is possible to do in parallel jobs.
suppose the the input consist of two columns country_cd and city_cd.
and the input stores the information abt 5 distinct country and their respective city as follow
Country_cd city_cd
===========================
cntry1 city1
cntry1 city2
cntry2 city2
cntry2 city3
cntry3 city4
cntry4 city5
cntry5 city5
what i require here is one seperate file should be created for each county and respective country records should go to the corresponding file.
like the file cntry1.txt should have folllowing records:
Country_cd city_cd
===========================
cntry1 city1
cntry1 city2
Pease let me know if this is possible to do in parallel jobs.
Birendra
Yes, you can do this. DataStage hashed files have various types, and a type 19 file is stored as directory. Each "Key" in this hashed file is stored as an OS file, and each hashed file record contents is stored as a row in that file.
In your case the key (and file name) would be the "Country_cd". You would need to read the old "Country_cd" record and then append the new city to the string, and this function is not going to be particularly fast, but it will work.
In your case the key (and file name) would be the "Country_cd". You would need to read the old "Country_cd" record and then append the new city to the string, and this function is not going to be particularly fast, but it will work.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Charter Member
- Posts: 299
- Joined: Wed Nov 13, 2002 5:38 pm
- Location: USA
If it is a parallel job, please post it there, not in the server forum.
Moderator - Please move this post to the PX Forum
Moderator - Please move this post to the PX Forum
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Sorry for i have posted in the wrong forum.
Arndw wrote:
Arndw wrote:
But i am unable to file the type 19 hashed file. What i find is type 2 to type 18 and then type 25 and type 30.Yes, you can do this. DataStage hashed files have various types, and a type 19 file is stored as directory. Each "Key" in this hashed file is stored as an OS file, and each hashed
Birendra
I am not sure where you are looking, but type 1 and 19 files exist; both are directory types but type 1 has a limited filename/key length and shouldn't be used.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Please correct me if i am looking at the wrong place.
The job is simple
Sequential file -------------------> Hashed file
In the hashed file properties
In the INPUT ---> General tab
I checked "Create file" then clicked the Option button where i just find type 2 to type 18 and type 25 and type 30.
Is it the correct location or i am missing something.
I am using 7.5.2 on HP-UX.
What could be the key from the given example. Because country is repetitive in the example.
The job is simple
Sequential file -------------------> Hashed file
In the hashed file properties
In the INPUT ---> General tab
I checked "Create file" then clicked the Option button where i just find type 2 to type 18 and type 25 and type 30.
Is it the correct location or i am missing something.
I am using 7.5.2 on HP-UX.
What could be the key from the given example. Because country is repetitive in the example.
Birendra
It doesn't allow you to create these two file types in the hashed file stage. The forum contains numerous descriptions of how you can create your own files, i.e. "CREATE.FILE MYFILE 10" from the TCL command line.
In this example the key would be COUNTRY.
In this example the key would be COUNTRY.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>