parametrizing the arguments of cat command

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
tostay2003
Participant
Posts: 97
Joined: Tue Feb 21, 2006 6:45 am

parametrizing the arguments of cat command

Post by tostay2003 »

I want to concatenate two files file1 and file2 and use that in sequential file stage.

cat file1 file2

Can I use cat #file1# #file2# (i.e) parametrizing them? and where can I write this cat command?
RAJEEV KATTA
Participant
Posts: 103
Joined: Wed Jul 06, 2005 12:29 am

Post by RAJEEV KATTA »

Pass the two files as a file pattern in sequential file and load it into a sequential file,it would resolve your problem.
tostay2003
Participant
Posts: 97
Joined: Tue Feb 21, 2006 6:45 am

Post by tostay2003 »

I didnt not get that. could you explain it in detail?
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

tostay2003 wrote:I didnt not get that. could you explain it in detail?
Rajeev meant that you could use the Filter command in Sequential file stage, where you pass the 2 filenames as parameters.
Don't forget to use an existing file in the Input 'FileName' box.
gateleys
tostay2003
Participant
Posts: 97
Joined: Tue Feb 21, 2006 6:45 am

Post by tostay2003 »

Don't forget to use an existing file in the Input 'FileName' box.
What should this FileName be File1 or File2?

or should i write

Code: Select all

cat #File1# #File2# > #File3#
and use the FileName as #File3#
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

tostay2003 wrote:What should this FileName be File1 or File2?

or should i write

Code: Select all

cat #File1# #File2# > #File3#
and use the FileName as #File3#
For the filename, you could use /dev/NUL
In the filter command, use
cat #File1# #File2#
Don't specify the target file in the command. Make sure that the path is specified in the value of the 2 parameters and also check if you have permissions on those file.

gateleys
mcolen
Premium Member
Premium Member
Posts: 31
Joined: Wed Aug 11, 2004 8:59 am
Location: Florida

Cat?

Post by mcolen »

Why use a before/after subroutine of cat a,b > c when you can (provided formats are the same) use a link collector to do the same work in the job.
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: Cat?

Post by gateleys »

mcolen wrote:Why use a before/after subroutine of cat a,b > c when you can (provided formats are the same) use a link collector to do the same work in the job.
Why link collector when the same can be done using cat in before/after subroutine?
Why cat in before/after subroutine if it can be achieved using Filter command in sequential file?
Why the above, if it can be done using the Command stage or the Execute Command at the sequence level?

Why? why? why?

Lots of choices, eh!!! :wink:
Post Reply