Edditing DS Macros
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There's no need to edit the macro definitions. You can simply override them with newer macro definitions of your own. The newer $DEFINE will replace the older.
In your case, leave out the $IFNDEF that tests whether it is already defined (and its corresponding $ENDIF of course).
In your case, leave out the $IFNDEF that tests whether it is already defined (and its corresponding $ENDIF of course).
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.
I hate seeing two experts talk to each other about my post....Its always way over my head
What exactly are you saying Ray? That the way that chulett helped me is not the best way to do this?
Also there was one thing that disrupted my sleep last night:
My working code is as follows
$INCLUDE DSINCLUDE JOBCONTROL.H
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
FileName = Ereplace(Ereplace(DSJobStartTimestamp,":","_")," ","_")
CmdString = "\\scrbbususcnc04\ETL_Processes\456msg\Batch_files\456Move.bat ":FileName
Call DSExecute("NT",CmdString,ScreenOutput,CmdReturnCode)
*If CmdReturnCode <> 0 Then
*Ans = "ERROR" : CmdReturnCode
*else Ans = 0
*End
The thing that gets me is that this is only good for one Batch file....Is there a way to make this dynamic?
Jim
What exactly are you saying Ray? That the way that chulett helped me is not the best way to do this?
Also there was one thing that disrupted my sleep last night:
My working code is as follows
$INCLUDE DSINCLUDE JOBCONTROL.H
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
FileName = Ereplace(Ereplace(DSJobStartTimestamp,":","_")," ","_")
CmdString = "\\scrbbususcnc04\ETL_Processes\456msg\Batch_files\456Move.bat ":FileName
Call DSExecute("NT",CmdString,ScreenOutput,CmdReturnCode)
*If CmdReturnCode <> 0 Then
*Ans = "ERROR" : CmdReturnCode
*else Ans = 0
*End
The thing that gets me is that this is only good for one Batch file....Is there a way to make this dynamic?
Jim
Sure I need help....But who dosent?
Sorta. Best is to only include the JOBCONTROL header if it needs to be included. $IFNDEF basically means "If Not Defined", so Ray is checking and only "defining" it if it needs to be defined - ie, isn't already defined. It will be fine in this case without it, he's showing you a way you could always throw it in when doing 'Job Control Stuff' and not having to worry about whether it is being doubled-up or not. That help?JDionne wrote:What exactly are you saying Ray? That the way that chulett helped me is not the best way to do this?
And yes, you can make it more dynamic. For example, you could pass in one more argument, which could be the path/batch to execute and the other (your current one) could be the 'parameters'.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Riddle me this Batman:chulett wrote:Sorta. Best is to only include the JOBCONTROL header if it needs to be included. $IFNDEF basically means "If Not Defined", so Ray is checking and only "defining" it if it needs to be defined - ie, isn't already defined. It will be fine in this case without it, he's showing you a way you could always throw it in when doing 'Job Control Stuff' and not having to worry about whether it is being doubled-up or not. That help?JDionne wrote:What exactly are you saying Ray? That the way that chulett helped me is not the best way to do this?
And yes, you can make it more dynamic. For example, you could pass in one more argument, which could be the path/batch to execute and the other (your current one) could be the 'parameters'.
my code:
$INCLUDE DSINCLUDE JOBCONTROL.H
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
FileName = Ereplace(Ereplace(DSJobStartTimestamp,":","_")," ","_")
Path = "\\scrbbususcnc04\ETL_Processes\456msg\Batch_files\456Move.bat "
CmdString = Path:FileName
Call DSExecute("NT",CmdString,ScreenOutput,CmdReturnCode)
*If CmdReturnCode <> 0 Then
*Ans = "ERROR" : CmdReturnCode
*else Ans = 0
*End
the dynaic path name is sorat right....its almost dynamic. This routne is set up as a before/after subroutine. I cant see where to add another paramiter so that when i am using a Routne Activity stage in a sequencer I can add the correct path as a variable........now how do i get around that?
Jim
Sure I need help....But who dosent?
When you originally define a Routine, it defaults to having one input parameter called 'Arg1'. In the 'Arguments' tab, you can add and rename the parameters listed there, much like you can do the same thing in a Transform or any other grid like that.
It is helpful to name them something meaningful as it's easier to know what to put into the 'StartDate' parameter, for instance, than when you are prompted for something called 'Arg3'.
It is helpful to name them something meaningful as it's easier to know what to put into the 'StartDate' parameter, for instance, than when you are prompted for something called 'Arg3'.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
True True, but when you change the type of routen to Before/After u suddenly dont have the option to add any more to the bottom of the listchulett wrote:When you originally define a Routine, it defaults to having one input parameter called 'Arg1'. In the 'Arguments' tab, you can add and rename the parameters listed there, much like you can do the same thing in a Transform or any other grid like that.
It is helpful to name them something meaningful as it's easier to know what to put into the 'StartDate' parameter, for instance, than when you are prompted for something called 'Arg3'.
Give it a go and see.
Jim
Sure I need help....But who dosent?
Sorry, forgot about that little 'feature' for Before/Afters. What we do is pass in delimited strings as the 'InputArg' and then use FIELD to hack it up into individual parameters inside the routine. Could be whitespace or pipe delimited, or whatever works with the nature of the data being passed in.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Ugg there is a nasty work aroundchulett wrote:Sorry, forgot about that little 'feature' for Before/Afters. What we do is pass in delimited strings as the 'InputArg' and then use FIELD to hack it up into individual parameters inside the routine. Could be whitespace or pipe delimited, or whatever works with the nature of the data being passed in.
ohh well
thanx for the input
Jim
Sure I need help....But who dosent?
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If you want to use a job parameter in a before/after subroutine, you can do it the same way as in a job control routine. That is, interrogate its value from the job usingJDionne wrote:I realized that I wasnt actualy using the parramiter that I had available to me so I did, but I would still like to know how to add a paramiter to a before/after routne
Jim
Code: Select all
ParamValue = DSGetParamInfo(DSJ.ME, parameter_name, DSJ.PARAMVALUE)
Code: Select all
If ParamValue Matches "'-'1N0N"
Then
* code to handle unable to retrieve parameter value
End
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.