× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



High CPU in it self is not a problem; it merely shows you that the machine has resources the program needs. High CPU and bad performance or sluggish performance fir other jobs - well, that's a problem.

/Joakim

Sent from my phone

On 23 maj 2011, at 16:45, "Boris" <bbresc512@xxxxxxxxxx> wrote:

I have a program that copies a DB2 file into an IFS stream file.
It may process millions of records.
The problem is that the program consumes high CPU (more than 90%). I removed
all the processing and only left the read from the DB2 file and write to the
IFS file functions. The program stack shows the write function almost
constantly so I assume the write function is the one to blame.
What is the best way to implement a solution like that?

Thanks
Boris.

-----Original Message-----
From: c400-l-bounces+bbresc512=rogers.com@xxxxxxxxxxxx
[mailto:c400-l-bounces+bbresc512=rogers.com@xxxxxxxxxxxx] On Behalf Of
c400-l-request@xxxxxxxxxxxx
Sent: 11/05/2011 13:00
To: c400-l@xxxxxxxxxxxx
Subject: C400-L Digest, Vol 9, Issue 20

Send C400-L mailing list submissions to
c400-l@xxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.midrange.com/mailman/listinfo/c400-l
or, via email, send a message with subject or body 'help' to
c400-l-request@xxxxxxxxxxxx

You can reach the person managing the list at
c400-l-owner@xxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of C400-L digest..."


Today's Topics:

1. Re: digitsof in a declaration (Erik Olsson)
2. Re: digitsof in a declaration (Aaron Albertson)
3. Re: digitsof in a declaration (Erik Olsson)


----------------------------------------------------------------------

message: 1
date: Tue, 10 May 2011 21:05:24 +0200
from: Erik Olsson <erik.eo.olsson@xxxxxxxxx>
subject: Re: [C400-L] digitsof in a declaration

Thanks (again) Aaron. Should I bother reporting it?

Mark. Sorry if I came across as under researched but I think the code said
both C (in C++ you use bcd.h) and decimal.h.

Thanks,
Erik


On 10 maj 2011, at 17:50, Aaron Albertson <albertaa@xxxxxxxxxx> wrote:

Hi all,

Mark - Erik's code _does_ include decimal.h.

Erik - This appears to be a bug in the C compiler.

These declarations work:

char periodString[digitsof(var)];
char periodString[10 + 1];

but this does not:

char periodString[digitsof(var) + 1];

It appears to be a problem with using the digitsof macro in an expression
on the array declaration.

As a workaround you could just allocate the storage:

char *periodString = (char *)malloc(digitsof(myrec.DECFIELD) + 1);

Thanks,

Aaron Albertson

c400-l-bounces+albertaa=us.ibm.com@xxxxxxxxxxxx wrote on 05/10/2011
10:06:25 AM:

From: "Mark S. Waterbury" <mark.s.waterbury@xxxxxxxxxxxxx>
To: C programming iSeries / AS400 <c400-l@xxxxxxxxxxxx>
Date: 05/10/2011 10:10 AM
Subject: Re: [C400-L] digitsof in a declaration
Sent by: c400-l-bounces+albertaa=us.ibm.com@xxxxxxxxxxxx

Hi, again, Erik:

Further searching of the InfoCenterI found this:

To use the decimal digitsof, and precisionof macros in your code,
you must specify

#include <decimal.h>

in your ILE C source.

(Did you even _try_ to search for an answer, e.g. in the InfoCenter,
before asking on the C/400 list?)

HTH,

Mark S. Waterbury

On 5/10/2011 10:46 AM, Erik Olsson wrote:
Anyone understand why I can't use the digitsof keyword in a
declaration? It's based on a decimal field in a struct that is known
at compile time so I don't see the problem.

#include<decimal.h>
#include</source/yada/tabledefs/myfile.h>

/* ... */

FLXDXYZ_MYFILE_MYFILE_both_t myrec;

char periodstring[digitsof(myrec.DECFIELD) + 1];

I get this: "Integral constant expression with a value greater than
zero is required"


Best wishes,
Erik
--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.

--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.



------------------------------

message: 2
date: Tue, 10 May 2011 14:43:49 -0500
from: Aaron Albertson <albertaa@xxxxxxxxxx>
subject: Re: [C400-L] digitsof in a declaration


Hi Erik,

If this problem is holding you up in any way that the workaround is
insufficient to address then I would suggest opening an issue with IBM. I
have already informed the compiler team of the issue, so if you don't have
an immediate or urgent need then you don't need to worry about reporting
it.

Aaron Albertson


c400-l-bounces+albertaa=us.ibm.com@xxxxxxxxxxxx wrote on 05/10/2011
02:05:24 PM:

From: Erik Olsson <erik.eo.olsson@xxxxxxxxx>
To: C programming iSeries / AS400 <c400-l@xxxxxxxxxxxx>
Date: 05/10/2011 02:08 PM
Subject: Re: [C400-L] digitsof in a declaration
Sent by: c400-l-bounces+albertaa=us.ibm.com@xxxxxxxxxxxx

Thanks (again) Aaron. Should I bother reporting it?

Mark. Sorry if I came across as under researched but I think the
code said both C (in C++ you use bcd.h) and decimal.h.

Thanks,
Erik


On 10 maj 2011, at 17:50, Aaron Albertson <albertaa@xxxxxxxxxx> wrote:

Hi all,

Mark - Erik's code _does_ include decimal.h.

Erik - This appears to be a bug in the C compiler.

These declarations work:

char periodString[digitsof(var)];
char periodString[10 + 1];

but this does not:

char periodString[digitsof(var) + 1];

It appears to be a problem with using the digitsof macro in an
expression
on the array declaration.

As a workaround you could just allocate the storage:

char *periodString = (char *)malloc(digitsof(myrec.DECFIELD) + 1);

Thanks,

Aaron Albertson

c400-l-bounces+albertaa=us.ibm.com@xxxxxxxxxxxx wrote on 05/10/2011
10:06:25 AM:

From: "Mark S. Waterbury" <mark.s.waterbury@xxxxxxxxxxxxx>
To: C programming iSeries / AS400 <c400-l@xxxxxxxxxxxx>
Date: 05/10/2011 10:10 AM
Subject: Re: [C400-L] digitsof in a declaration
Sent by: c400-l-bounces+albertaa=us.ibm.com@xxxxxxxxxxxx

Hi, again, Erik:

Further searching of the InfoCenterI found this:

To use the decimal digitsof, and precisionof macros in your code,
you must specify

#include <decimal.h>

in your ILE C source.

(Did you even _try_ to search for an answer, e.g. in the InfoCenter,
before asking on the C/400 list?)

HTH,

Mark S. Waterbury

On 5/10/2011 10:46 AM, Erik Olsson wrote:
Anyone understand why I can't use the digitsof keyword in a
declaration? It's based on a decimal field in a struct that is known
at compile time so I don't see the problem.

#include<decimal.h>
#include</source/yada/tabledefs/myfile.h>

/* ... */

FLXDXYZ_MYFILE_MYFILE_both_t myrec;

char periodstring[digitsof(myrec.DECFIELD) + 1];

I get this: "Integral constant expression with a value greater than
zero is required"


Best wishes,
Erik
--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.

--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.

--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.


------------------------------

message: 3
date: Tue, 10 May 2011 22:06:43 +0200
from: Erik Olsson <erik.eo.olsson@xxxxxxxxx>
subject: Re: [C400-L] digitsof in a declaration

Great Aaron, I can live with the workaround, no problem.

Thanks for your help,
Erik

2011/5/10 Aaron Albertson <albertaa@xxxxxxxxxx>:

Hi Erik,

If this problem is holding you up in any way that the workaround is
insufficient to address then I would suggest opening an issue with IBM. ?I
have already informed the compiler team of the issue, so if you don't have
an immediate or urgent need then you don't need to worry about reporting
it.

Aaron Albertson


c400-l-bounces+albertaa=us.ibm.com@xxxxxxxxxxxx wrote on 05/10/2011
02:05:24 PM:

From: Erik Olsson <erik.eo.olsson@xxxxxxxxx>
To: C programming iSeries / AS400 <c400-l@xxxxxxxxxxxx>
Date: 05/10/2011 02:08 PM
Subject: Re: [C400-L] digitsof in a declaration
Sent by: c400-l-bounces+albertaa=us.ibm.com@xxxxxxxxxxxx

Thanks (again) Aaron. Should I bother reporting it?

Mark. Sorry if I came across as under researched but I think the
code said both C (in C++ you use bcd.h) and decimal.h.

Thanks,
Erik


On 10 maj 2011, at 17:50, Aaron Albertson <albertaa@xxxxxxxxxx> wrote:

Hi all,

Mark - Erik's code _does_ include decimal.h.

Erik - This appears to be a bug in the C compiler.

These declarations work:

char periodString[digitsof(var)];
char periodString[10 + 1];

but this does not:

char periodString[digitsof(var) + 1];

It appears to be a problem with using the digitsof macro in an
expression
on the array declaration.

As a workaround you could just allocate the storage:

char *periodString = (char *)malloc(digitsof(myrec.DECFIELD) + 1);

? ? ? ? ? ? ? ?Thanks,

Aaron Albertson

c400-l-bounces+albertaa=us.ibm.com@xxxxxxxxxxxx wrote on 05/10/2011
10:06:25 AM:

From: "Mark S. Waterbury" <mark.s.waterbury@xxxxxxxxxxxxx>
To: C programming iSeries / AS400 <c400-l@xxxxxxxxxxxx>
Date: 05/10/2011 10:10 AM
Subject: Re: [C400-L] digitsof in a declaration
Sent by: c400-l-bounces+albertaa=us.ibm.com@xxxxxxxxxxxx

Hi, again, Erik:

Further searching of the InfoCenterI found this:

? ? To use the decimal digitsof, and precisionof macros in your code,
you must specify

? ? ? ? #include <decimal.h>

? ? in your ILE C source.

(Did you even _try_ to search for an answer, e.g. in the InfoCenter,
before asking on the C/400 list?)

HTH,

Mark S. Waterbury

On 5/10/2011 10:46 AM, Erik Olsson wrote:
Anyone understand why I can't use the digitsof keyword in a
declaration? It's based on a decimal field in a struct that is known
at compile time so I don't see the problem.

#include<decimal.h>
#include</source/yada/tabledefs/myfile.h>

/* ... ?*/

FLXDXYZ_MYFILE_MYFILE_both_t ? ? ?myrec;

char ?periodstring[digitsof(myrec.DECFIELD) + 1];

I get this: "Integral constant expression with a value greater than
zero is required"


Best wishes,
Erik
--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.

--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.

--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.

--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.




------------------------------

--
This is the C programming iSeries / AS400 (C400-L) digest list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.



End of C400-L Digest, Vol 9, Issue 20
*************************************


--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.


Capgemini is a trading name used by the Capgemini Group of companies which includes Capgemini Sverige AB, a company registered in Sweden (number 556092-3053) whose registered office is at Gustavslundsvägen 131 Box 825 – S-161 24 Bromma.






This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message
in error, please notify the sender immediately and delete all copies of this message.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.