Cannot get output from DSExecute

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
jusami25
Premium Member
Premium Member
Posts: 84
Joined: Tue Oct 26, 2004 12:49 am

Cannot get output from DSExecute

Post by jusami25 »

Hi all,

we are using below server routine to get the number of records of a dataset:

Code: Select all

CALL DSExecute ( "NT", "dsrecords":PathDataset, Output, RetCode ) 

If RetCode = 0 Then 
   Ans = Output
End Else 
  Ans = "ERROR" 
End 
But we are not getting the number of records as Output...

If we run the routine with the >>test.txt the file is created with the number or records.

Code: Select all

CALL DSExecute ( "NT", "dsrecords":PathDataset:" [b]>>test.txt[/b]", Output, RetCode ) 
We have tried also get the output with a Execute Command stage in a Sequencer with the next output:

executecommand..JobControl (@ExeCommand): Executed: dsrecords.exe D:\Dummy.ds
Reply=0
Output from command ====>


Can anyone tell us what's wrong on the routine?

Thanks in advance.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Dont you need a space between the file name and 'dsrecords' ???
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
jusami25
Premium Member
Premium Member
Posts: 84
Joined: Tue Oct 26, 2004 12:49 am

Post by jusami25 »

Hi DSguru2B,

we had the blank space (sorry I wrote the topic with out it)

Code: Select all

CALL DSExecute ( "NT", "dsrecords ":PathDataset, Output, RetCode ) 
[/code]
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

What does the output look like in your output file, i.e, test.txt?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
jusami25
Premium Member
Premium Member
Posts: 84
Joined: Tue Oct 26, 2004 12:49 am

Post by jusami25 »

test.txt has:

100 records
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Thats strange. I am not at a px site and hence cannot test it out. But you should be able to get the result. Try putting in a PRINT statement like 'PRINT Output' at the end of the routine and see what shows up.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
jusami25
Premium Member
Premium Member
Posts: 84
Joined: Tue Oct 26, 2004 12:49 am

Post by jusami25 »

Hi DSguru2B,

same result (nothing) returned :cry: in Windows platform. We have tried to do it on Unix server and it works fine... As you said is Strange :?

By the way, we have done a work aroud (redirect the output to a file), read the file and return the information stored in the file.
Post Reply