How to count he number of records in a dataset
Moderators: chulett, rschirm, roy
How to count he number of records in a dataset
Any ideas on how to get eh count of number of records for a dataset.
i tried to look for the 'orchadmin' commands but didnt find any help.
thanks
i tried to look for the 'orchadmin' commands but didnt find any help.
thanks
"Attitude always and almost determines the altitude of your Life"
Re: How to count he number of records in a dataset
Manager/DataSet Management.....kool78 wrote:Any ideas on how to get eh count of number of records for a dataset.
i tried to look for the 'orchadmin' commands but didnt find any help.
thanks
Re: How to count he number of records in a dataset
vijayrc wrote:Manager/DataSet Management.....kool78 wrote:Any ideas on how to get eh count of number of records for a dataset.
i tried to look for the 'orchadmin' commands but didnt find any help.
thanks
is there any other way...i know we can get the count from dataset manager/managment.
i want to use it in my process..like if records exist then proceed else not.
"Attitude always and almost determines the altitude of your Life"
I am not too familiar with how "orchadmin" is ported to the Windows platform (most likely using the wrapper). It is located within PXEngine/bin subdirectory within DataStage's directory.
If it was on the UNIX box, it would be a very simple task of using a command stage within a sequencer job to call orchadmin with the relevant options (you can find out the available options running it without any options).
Give it a try, and remember -- you need to be on the DataStage SERVER not your own client.
If it was on the UNIX box, it would be a very simple task of using a command stage within a sequencer job to call orchadmin with the relevant options (you can find out the available options running it without any options).
Give it a try, and remember -- you need to be on the DataStage SERVER not your own client.
This is the sample code.
You can catch the return code which is the count of records in dataset.
Code: Select all
export DSHOME = '/appl/infoserver/Server/DSEngine'
export APT_CONFIG_FILE = '/appl/infoserver/Server/Configurations/2node.apt'
export APT_ORCHHOME = '/appl/infoserver/Server/PXEngine'
export PATH = '%PATH%' : '/appl/infoserver/Server/PXEngine/bin'
export ORCHBIN = APT_ORCHHOME : '/bin'
export LIBPATH = '/appl/infoserver/Server/PXEngine/lib'
[b]dsrecords DSdir/datasetFilename.ds[/b]
-
- Premium Member
- Posts: 301
- Joined: Thu Jul 14, 2005 10:27 am
- Location: Melbourne, Australia
- Contact:
Hi kool78,
Off the top of my head, I think the following should work ...
... where YOURFILE is your dataset descriptor file.
HTH,
John.
Off the top of my head, I think the following should work ...
Code: Select all
for /f "tokens=1" %a in ('dsrecords YOURFILE') do echo %a
HTH,
John.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use the -n option of the dsrecords command.kool78 wrote:can we omit the later part i,e' records' and allow it to display only the value like 1500.
Code: Select all
dsrecords -n /app/Ascential/DataStage/Projects/MyProject/Controls/MyDataSet.ds
Create a directory in your project in which all descriptor files for Data Sets, Lookup File Sets and File Sets are kept and make the pathname of that directory a job parameter.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod wrote:Use the -n option of the dsrecords command.kool78 wrote:can we omit the later part i,e' records' and allow it to display only the value like 1500.Code: Select all
dsrecords -n /app/A ...[/quote] thanks ray, followed the dsrecords method, dsrecords -n <datasetname>
"Attitude always and almost determines the altitude of your Life"