Create output file names based on data in a column
Moderators: chulett, rschirm, roy
Create output file names based on data in a column
Hello,
I shall want to know if it was possible to put in the name of my files of exits, the data of a column, I am understandable :
On a job, I extract from Oracle via a request SQL a table. On this table, there is a column Code_Test which possesses several values (ex: Code1, Code2, Code3). I create afterward files in the format *.csv.
My question is, it is possible to create my files for example :
Test_Code1.csv
Test_Code2.csv
Test_Code3.csv
To create so much file as there is of values different Code_Test.
Thanks a lot.
Sorry for my bad english, i'm french.
I shall want to know if it was possible to put in the name of my files of exits, the data of a column, I am understandable :
On a job, I extract from Oracle via a request SQL a table. On this table, there is a column Code_Test which possesses several values (ex: Code1, Code2, Code3). I create afterward files in the format *.csv.
My question is, it is possible to create my files for example :
Test_Code1.csv
Test_Code2.csv
Test_Code3.csv
To create so much file as there is of values different Code_Test.
Thanks a lot.
Sorry for my bad english, i'm french.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Well... they are a little tricky to use. Check the Server Job Developer's Guide manual for the official description and do an exact search here for 'folder stage' to see what has been discussed here. Seem to recall one such conversation just last month...
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
As noted in the linked post and the docs, yes it takes a single record so if you have multiples you need to get them all concatenated together with a record delimiter between each. Do that in a stage variable and then send it to an aggregator set to 'last' before the Folder stage.
Sorry but I don't understand your second question.
Sorry but I don't understand your second question.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You're getting into Routine territory now. You need to scan the existing list to determine whether the value already exists (use the Locate statement) and insert it if not.
Maintain the list as a field mark (@FM) delimited dynamic array sorted. Implement the following logic in your routine.
Maintain the list as a field mark (@FM) delimited dynamic array sorted. Implement the following logic in your routine.
Code: Select all
Locate NewValue In ValuesList By "AR" Setting Location
Else
Ins NewValue Before ValuesList<Location>
End
Ans = ValuesList
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.