Hi ,
Can any one tell me the meaning of !, <-1> & <1> in the following :
Cmd = "db2 connect to ": PServer : " user " : USERDB : " using " : DADASS
Call DSExecute("UNIX",Cmd,Output,Status)
Call DSU.Jobharieadh(REST,Output)
!Ans<-1> = Cmd
If Status<1> = 0 Then Ans = @TRUE
PS: is '!' equivalent to OR or NOT[/b]
Sub routine
Moderators: chulett, rschirm, roy
Sub routine
Last edited by bikan on Thu Aug 14, 2008 4:06 am, edited 1 time in total.
Bikan - you really should know better than to use "urgent" in your message and expect a response. Invariably the frequent posters will ignore posts marked "urgent" for a while. Ray will certainly add his comments regarding the true cost of urgent and immediate support.
This is exacerbated by the fact that your question is answered by looking into the documentation, and you consider it faster and easier to post here instead of reading the file on your PC so I am not particularly inclined to respond.
This is exacerbated by the fact that your question is answered by looking into the documentation, and you consider it faster and easier to post here instead of reading the file on your PC so I am not particularly inclined to respond.
Well, now that I'm up from sleepy time...
This is oddly coded as I don't know why one would treat 'Ans' as a dynamic array for no good reason, which is what the angle brackets are doing: they denote the element of the array to access. So <1> means the first element and <-1> is special magic to mean "push this to the next available element".
And a bang (!) means 'not' in an expression but used there at the beginning of an assignment line? I'm guessing they think it makes the line a comment. I know '*' does but have never seen '!' used that way that I recall.![Confused :?](./images/smilies/icon_confused.gif)
![Confused :?](./images/smilies/icon_confused.gif)
And a bang (!) means 'not' in an expression but used there at the beginning of an assignment line? I'm guessing they think it makes the line a comment. I know '*' does but have never seen '!' used that way that I recall.
![Confused :?](./images/smilies/icon_confused.gif)
Last edited by chulett on Thu Aug 14, 2008 3:48 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Assumed so, thanks for the confirmation.
Output is a dynamic array here, not Ans or Status, which is why I found this syntax odd. Technically it works cuz DataStage is smarter than us but tells me the coder didn't really understand what they were doing.![Confused :?](./images/smilies/icon_confused.gif)
Output is a dynamic array here, not Ans or Status, which is why I found this syntax odd. Technically it works cuz DataStage is smarter than us but tells me the coder didn't really understand what they were doing.
![Confused :?](./images/smilies/icon_confused.gif)
-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:
"#" does NOT introduce a comment in DataStage BASIC.
Looks like the dynamic array was being passed back while testing, since this line is now commented out.
I often pass dynamic arrays - it's a more convenient mechanism than most others that are available.
The -1 syntax in dynamic array assignment means "append a new element"; in this particular case, since the -1 appears at the field position in the reference, it means to append a new field. For this to work properly, the dynamic array (Ans in this case) must already exist (have been assigned a value), even if it's Ans = "", which this code lacks.
Looks like the dynamic array was being passed back while testing, since this line is now commented out.
I often pass dynamic arrays - it's a more convenient mechanism than most others that are available.
The -1 syntax in dynamic array assignment means "append a new element"; in this particular case, since the -1 appears at the field position in the reference, it means to append a new field. For this to work properly, the dynamic array (Ans in this case) must already exist (have been assigned a value), even if it's Ans = "", which this code lacks.
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.