Page 1 of 1

execute command for readinging sequentialfile in looping

Posted: Thu Aug 09, 2012 8:11 am
by roshanearly
What is the execute command i should write in execute command stage in sequence looping for reading a sequential file and if i find it empty it returns false.please reply as soon as possible

Posted: Thu Aug 09, 2012 9:33 am
by ArndW
How about "wc -l" to count the lines, assuming the file you are checking is one delimited by line feeds.

Posted: Thu Aug 09, 2012 9:57 am
by chulett
Or "test -s" and make sure it fails. :wink:

Note that these assume you have the MKS Toolkit installed and can thus run UNIX commands. DOS commands to check filesize are... trickier.

Posted: Thu Aug 09, 2012 10:29 am
by ArndW
But we know you have MKS Toolkit - Although the conspiracy theorists might believe thata DataStage offers a portal into your system (all your data are belong to us), wiser heads will note that MKS Toolkit is installed as part of DS on Windows systems :wink:

p.s. were those answers fast enough for you? Please, next time, don't ask for speedier help since this is a volunteer site and will generally answer as fast as they feel like and demanding quicker support usually gets exactly the opposite reaction.

Posted: Thu Aug 09, 2012 3:45 pm
by ray.wurlod
You posted at 00:11 my time. I was not paying a whole lot of attention at that time.

execute command for readinging sequentialfile in looping

Posted: Thu Sep 06, 2012 6:27 am
by bhasds
Hi Roshan,

If I have understood your question correctly, you are asking-

1.How to get record count of a file through execute command?

2.How to pass the records to the loop in sequence and the count should determine the number of time the loop should run?

3. How to prevent the loop from running if there is no data?

Please confirm if above three are exact question.