Execute Command Function

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
avunoori
Participant
Posts: 8
Joined: Sat Oct 30, 2010 5:54 pm

Execute Command Function

Post by avunoori »

Hi,

I have a requirement to execute the Unix command and pass the value the next JobActivity

In the Execute command how do I pass the two unix commands
awk -F"|" 'BEGIN{IGNORECASE=1;} $1~/DATA/' #ps_EDW_StdHrs.p_Source_Dir#/*/#ps_EDW_StdHrs.p_Source_FileName# | cut -d"|" -f8,9

Here I read the file and extract only the column 8th and 9th

But Execute Command is not accepting the Parameter in between the Unix command. Could some one can help how to handle this requirement?
Thanks,
Avunoori.
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

You can print the eight and ninth field from awk

Code: Select all

awk -F"|" 'BEGIN{IGNORECASE=1;} $1~/DATA/ { print $8 FS $9 } ' #ps_EDW_StdHrs.p_Source_Dir#/*/#ps_EDW_StdHrs.p_Source_FileName# 
You are the creator of your destiny - Swami Vivekananda
avunoori
Participant
Posts: 8
Joined: Sat Oct 30, 2010 5:54 pm

Post by avunoori »

Thanks, I will have mutiple records how do I read only 1 record using the Awk Command.
Thanks,
Avunoori.
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Use exit command

Code: Select all

awk -F"|" 'BEGIN{IGNORECASE=1;} $1~/DATA/ { print $8 FS $9; exit } ' #ps_EDW_StdHrs.p_Source_Dir#/*/#ps_EDW_StdHrs.p_Source_FileName#
You are the creator of your destiny - Swami Vivekananda
Post Reply