How to compare two files in windows through datastage

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
sprasad55
Participant
Posts: 11
Joined: Thu Dec 28, 2006 4:16 pm

How to compare two files in windows through datastage

Post by sprasad55 »

I want to compare two txt files through datastage server edition on windows, Can I know how can I do that?

I tried to use following code -

cmd = "FC E:\DataStageQa\ndw\work\stagingx\25\DEPLETF E:\DataStageQa\ndw\work\stagingx\25\DEPLETF"

CALL DSExecute("NT", cmd, ScreenOutput, SystemReturnCode)

looks like it's not working.

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

Post by ray.wurlod »

What precisely do you mean by "not working"?

Does it work in a DOS (CMD) shell?

Try putting double quotes around both pathnames, and enclosing the entire command in single quotes.

Code: Select all

cmd = 'FC "E:\DataStageQa\ndw\work\stagingx\25\DEPLETF" "E:\DataStageQa\ndw\work\stagingx\25\DEPLETF" '
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Post by sachin1 »

TEST #1
*******

Arg1 = d:\datastage\data\india1\sachin\out\new7.txt
Arg2 = d:\datastage\data\india1\sachin\out\new71.txt

Test completed.

DSLogWarn called from : ExecDOS
Message to be logged is...
> Error when executing command: FC d:\datastage\data\india1\sachin\out\new7.txt d:\datastage\data\india1\sachin\out\new71.txt
> *** Output from command was: ***
> Comparaison des fichiers D:\DATASTAGE\DATA\INDIA1\SACHIN\OUT\new7.txt et D:\DATASTAGE\DATA\INDIA1\SACHIN\OUT\NEW71.TXT
> ***** D:\DATASTAGE\DATA\INDIA1\SACHIN\OUT\new7.txt
> 2,3,"new2"
> 2,3,"new312"
> ***** D:\DATASTAGE\DATA\INDIA1\SACHIN\OUT\NEW71.TXT
> 2,3,"new2"
> 2,3,"new3"
> *****
>
>

Result = 1

sorry in previous post both file were same, extremely sorry.
vinbhate
Participant
Posts: 36
Joined: Tue Jul 17, 2007 12:51 am
Location: India-Mumbai

Post by vinbhate »

Hi...
addition to the previous one is if we want to create a log and trap the difference in file then D:>FC emp.txt emp1.txt > test1.txt
it works ...try
Regards and Thanks,
Vinita Bhate
Post Reply