Hi
I am trying to retrieve data from file using commmand Activity stage in datastage
Actually i have created file with 1 value.
And used cat <filename>
Displayed Output: 1 and showing extraline(Eg: 1
)
I tried checking with Len(that commandactivity_output). It is giving 2.
How can we extract only the value 1 using Command Activity stage as i am passing this value to parameter.
And This file is being created in Command Activity stage later this stage.
Thanks
Prasad
Command Activity
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Extract the first element from the field-mark-delimited string returned via the Execute Command activity's output activity variable.
Use Field() function or dynamic array notation (ExecCmd.Output$<1>).
Use Field() function or dynamic array notation (ExecCmd.Output$<1>).
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: 246
- Joined: Mon Jun 30, 2008 3:22 am
- Location: New York
- Contact:
Thanks to All.
I have done this using the below code in command activity stage in sequence.
I have done this using the below code in command activity stage in sequence.
Code: Select all
value=$(cat FileName);printf "$value"