To read one line of record from a file

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
agathaeleanor
Participant
Posts: 76
Joined: Mon Mar 05, 2007 9:26 pm
Location: Malaysia

To read one line of record from a file

Post by agathaeleanor »

Hi all,

I have a file (email.txt) which stores user emails and the subject area.

Format:
email1@domain,email2@domain,email3@domain|subject1
email21@domain|subject2
email31@domain,email32@domain|subject3
I created a sequencer contains
execute_command(cat) --> UVA --> Parallel Job --> Notification_activity

execute_command, it cat email.txt
UVA, define user_email variable to store email address from email.txt

code:
Ereplace(Field(EC_CAT.$CommandOutput,"|",1,-1),@FM,'')

Notification_activity will inherit value from user_email variable in UVA

In the user_email will always return first row from email.txt.
May I know if there is a way to read second row of record from email.txt based on the subject area (pass in as parameter)

Thanks in advance for your help.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If the subject areas are distinct, you could use grep command to read the line from the file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
agathaeleanor
Participant
Posts: 76
Joined: Mon Mar 05, 2007 9:26 pm
Location: Malaysia

Post by agathaeleanor »

Thanks ray. It works :)
Post Reply