Page 1 of 1

Cannot get output from DSExecute

Posted: Tue Mar 31, 2009 11:29 am
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.

Posted: Tue Mar 31, 2009 2:42 pm
by DSguru2B
Dont you need a space between the file name and 'dsrecords' ???

Posted: Wed Apr 01, 2009 2:55 am
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]

Posted: Wed Apr 01, 2009 8:39 am
by DSguru2B
What does the output look like in your output file, i.e, test.txt?

Posted: Thu Apr 02, 2009 6:52 am
by jusami25
test.txt has:

100 records

Posted: Thu Apr 02, 2009 10:38 am
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.

Posted: Fri Apr 03, 2009 1:55 am
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.