if i created a dataset and loaded records.
how can i find out how many records are there in a dataset
how can we findout how many records in a dataset
Moderators: chulett, rschirm, roy
how can we findout how many records in a dataset
thanks & regards
kk
kk
if it is on unix you can create a routine to find the count in the dataset.
create the server routine and you can use the routine in the sequence by using routine activity you can find the count in the dataset.
the code is given below.
! Call dsrecords for the required data set
CALL DSExecute ( "UNIX", "dsrecords ":PathDataset, Output, RetCode )
! Log the output
CALL DSLogInfo ( "dsrecords ":PathDataset:": " : Output, "GetDsRowCount" )
If RetCode = 0 Then
! Retreive the first output line
Output = Field ( Output, @FM, 1 )
! Strip out the row count numeric part e.g. XX records, XX is count up to space
CountDSRecs = Field ( Output, " ", 1 )
If CountDSRecs = "" Or Num ( CountDSRecs ) = 0 Then
! Record count not found or is not numeric so return 0
CALL DSLogFatal ( "Record count not found", "CountDSRecs" )
Ans = 0
End Else
! Return the number of rows
Ans = CountDSRecs
End
End Else
! Call to dsrecords failed so return 0
CALL DSLogFatal ( "dsrecords call failed, RetCode = ":RetCode, "CountDSRecs" )
Ans = 0
End
create the server routine and you can use the routine in the sequence by using routine activity you can find the count in the dataset.
the code is given below.
! Call dsrecords for the required data set
CALL DSExecute ( "UNIX", "dsrecords ":PathDataset, Output, RetCode )
! Log the output
CALL DSLogInfo ( "dsrecords ":PathDataset:": " : Output, "GetDsRowCount" )
If RetCode = 0 Then
! Retreive the first output line
Output = Field ( Output, @FM, 1 )
! Strip out the row count numeric part e.g. XX records, XX is count up to space
CountDSRecs = Field ( Output, " ", 1 )
If CountDSRecs = "" Or Num ( CountDSRecs ) = 0 Then
! Record count not found or is not numeric so return 0
CALL DSLogFatal ( "Record count not found", "CountDSRecs" )
Ans = 0
End Else
! Return the number of rows
Ans = CountDSRecs
End
End Else
! Call to dsrecords failed so return 0
CALL DSLogFatal ( "dsrecords call failed, RetCode = ":RetCode, "CountDSRecs" )
Ans = 0
End
Thanks and Regards,
Sivasankar.z
+44-07807478984
Sivasankar.z
+44-07807478984
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: how can we findout how many records in a dataset
Following are thevarious options to count the nmber of records:-
1) As Ray said use the Dataset management tool
2) Use the Orchadmin commands i.e. just go into your PXEngine/bin directory type the following commands:-
orchadmin dump < dataset name with path > | wc -l
or use
orchadmin dsrecords < dataset name with Path >
If you can add the complete PXEngine/bin path in your PATH environment variable the you can run these commands from any location on the server.
----
dsusr
1) As Ray said use the Dataset management tool
2) Use the Orchadmin commands i.e. just go into your PXEngine/bin directory type the following commands:-
orchadmin dump < dataset name with path > | wc -l
or use
orchadmin dsrecords < dataset name with Path >
If you can add the complete PXEngine/bin path in your PATH environment variable the you can run these commands from any location on the server.
----
dsusr
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: