Number of records

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
veera24
Premium Member
Premium Member
Posts: 150
Joined: Thu Feb 07, 2008 9:37 pm
Location: NewYork

Number of records

Post by veera24 »

Hi all,
i need to find the number of records in a file. Meanwhile i shouldn't include 1st record and as well as last record. Consider 10 number of records contribute to 1 Block in a file.
Here, i need to calculate the total number of records and should divide the resultant by 10 (as Block has 10 records). If the resultant value is 5.9 then i should write the value as 6, if it 5.5 then also 6 and even if it is 5.1 then output should 6. Similarly, if the value is 7.1 then the output should be 8.
If we use the ROUND OFF function then 5.1 or 7.1 or 5.4 or 2.3 etc etc.. will be rounded off to their preceding whole number. So could any one suggest me a way to try this?hope you would got what am trying to say.

In short,
If a number has a deci mal value then it should be converted into their successive whole number (regardless of the Mathematics logic)


Your time will be highly appreciated.

Thanks in advance,
Veera
kamalshil
Participant
Posts: 179
Joined: Mon Jun 23, 2008 1:19 am

Re: Number of records

Post by kamalshil »

do u have to calculate records from dataset? or its in other format.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Use Function Ceil.
veera24
Premium Member
Premium Member
Posts: 150
Joined: Thu Feb 07, 2008 9:37 pm
Location: NewYork

Re: Number of records

Post by veera24 »

kamalshil wrote:do u have to calculate records from dataset? or its in other format.
My input will be a mainframe file and i need to calculate the number of records based on the block size
Thanks in advance...
veera...
veera24
Premium Member
Premium Member
Posts: 150
Joined: Thu Feb 07, 2008 9:37 pm
Location: NewYork

Post by veera24 »

balajisr wrote:Use Function Ceil.
I haven't used that function. Could you pls elaborate the same and how to implement?
Thanks in advance...
veera...
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

It seems Ceil() exists only in help.

Try this.

Code: Select all

OConv(Col1+.5,"MD0")
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Ceil() is for parallel jobs only.

Do you need this count before the job runs, or as a result from the DataStage job?

In the first case get the result of wc -l pathname and subtract 2.
In the second case get the last value of @INROWNUM and subtract 2. The Aggregator stage can give a Last value.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
veera24
Premium Member
Premium Member
Posts: 150
Joined: Thu Feb 07, 2008 9:37 pm
Location: NewYork

Post by veera24 »

ray.wurlod wrote:Ceil() is for parallel jobs only.

Do you need this count before the job runs, or as a result from the DataStage job?

In the first case get the result of wc -l pathname and subtract ...
Ray,
I couldn't see your content as am not a member. So could you reply back without that?Your help will be appreciated.Hope you would do.

Thanks,
Veera
Post Reply