How to write Routine ?
Moderators: chulett, rschirm, roy
How to write Routine ?
Hi everyone ,
I am new to Datastage Routines ,I don't know how to write rourine .I am not getting any document that i can refer .
So please if anybody having any document related to routine pls send me .
Thanks .
Rimi.
I am new to Datastage Routines ,I don't know how to write rourine .I am not getting any document that i can refer .
So please if anybody having any document related to routine pls send me .
Thanks .
Rimi.
-
- Participant
- Posts: 34
- Joined: Fri Sep 22, 2006 10:59 pm
- Location: India
There are two types of routines:
1) Transform routines
2) Before-After job sub-routines
*Before-After routines could be used/written within Transformer or even Shell scripts are used/written.
For transform routines in the repository just right click on Routines and make new server routines. You can also use inbuilt functions which are already there.
1) Transform routines
2) Before-After job sub-routines
*Before-After routines could be used/written within Transformer or even Shell scripts are used/written.
For transform routines in the repository just right click on Routines and make new server routines. You can also use inbuilt functions which are already there.
If women didn't exist, all the money in the world would have no meaning.
-- Aristotle Onassis
-- Aristotle Onassis
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You could undertake some training
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.
-
- Participant
- Posts: 34
- Joined: Fri Sep 22, 2006 10:59 pm
- Location: India
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Its not wc -1 but its -l.
In addtion to that for clarity, Assign it to a variable Say
In addtion to that for clarity, Assign it to a variable Say
Code: Select all
CountFiles = "ls ":pHomeDirectory:"|wc -l", and use Call DSExecute("UNIX",CountFiles,UnixOutput,SystemReturnCode)
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
-
- Participant
- Posts: 22
- Joined: Mon Apr 02, 2007 4:02 am
- Location: MUMBAI
- Contact:
You can try this
Rimi wrote:thanks all..
Can anyone tell the unix command for counting the number of files in directory
if i use (ls <home directory> |wc -1) it s showing error wc illegal .
I want to write the following in routine
Call DSExecute("UNIX","(ls <home directory> |wc -1)",UnixOutput,SystemReturnCode)
thanks
Rimi.
Hey Rimi ,
To answer your 1st qs :
1) You can open ds manager and right click on routines and click on create routines . Then a new screen will come with 5/6 tabs i guess .
Here two tabs are imp . one is Code and other is argument tab .
In routine code page you just need to write a code( tht depends on your req. means what your routine is intented to do...since routine prform as functions) .
You can write the code in basic .
e.g , let suppose you want to write a routine to match some fields
begin
case 1
Ans = 'a'
case 2
Ans ='b'
like this
Then mention Ans as argument in required tab....then compile and use it...simple.....!!!
2) I think " ls -l|wc -l" will work ...just try it in the directory for which you want to take the count of files......
Cheers
Smrutiranjan Nayak