Field(Execute_Command_2.$CommandOutput,@FM,1)
DSGuru2B, this is from your post earlier in this thread:
"The output is in the form of a dynamic array with other contents in it. They are seperated by a field marker (@FM).
We are only concerned with the contents of the first field. The first code in my previous post extracts everything before
the first @FM. The second code extracts the contents of the first field in the dynammic array. "
For the Field function above, is everything taken from the first element of the dynamic array before the field marker? I am assuming that it is as it is a C array which is actually one contiguous string.
Surrogate Key using sequence ?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It's not a C array. It's a DataStage dynamic array, which is nothing more than a delimited string. The delimiter character is a "field mark" character, which is accessible as the system variable @FM.
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.
It is one contigous string and the field sperator is the @FM as described by Ray.splayer wrote: For the Field function above, is everything taken from the first element of the dynamic array before the field marker? I am assuming that it is as it is a C array which is actually one contiguous string.
So
Field(Execute_Command_2.$CommandOutput,@FM,1) is equivalent to
Execute_Command_2.$CommandOutput<1> and in C words, is similar to
Execute_Command_2.$CommandOutput[0]
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Similar, but not the same. C arrays depend on knowing the address in memory of each element. Dynamic arrays are navigated based on the character position in the string with respect to the beginning of the string (which, yes, is a position in memory, but not one that's stored as a pointer anywhere) (unless you're using the Remove or RevRemove statement).
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.