× 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.



As usual, Bob is correct.  I was thinking about initialization.  Unless 
you specify the INZ keyword on numeric subfields they are initialized with 
character data by the compiler.  I made a simple test that I stepped 
through in debug to see what was happening.  Thanks for helping me clear 
this up in my mind and sorry if I caused any confusion.

     D DS1...
     D                 DS                  qualified
     D  numeric...
     D                                3P 0
     D  character...
     D                                5A

     D DS2...
     D                 DS                  qualified
     D  numeric...
     D                                3P 0 inz(0)
     D  character...
     D                                5A   inz('A')

      /free
       clear DS1;
       clear DS2;
       reset DS1;
       reset DS2;

       *inlr = *ON;
       return;

      /end-free

Adam



rpg400-l-bounces@xxxxxxxxxxxx wrote on 07/06/2006 01:19:08 PM:

The CLEAR opcode sets the subfields of a data structure to there 
logical default
value. All numeric subfields are set to zero, all character 
subfields are set to
blanks, all date/time fields are set to the lowest values.
The presence of the INZ keyword is irrelevant to the CLEAR opcode.
You can use the CLEAR opcode anywhere in RPG IV. It can also be used in 
the
*INZSR subroutine. In this case, it works similar to the INZ keywordon 
the DS
declaration itself. However, the INZ keyword is applicable when the 
storage is
initialized, whereas a CLEAR opcode to a DS within the *INZSR overwrites 
any
initial values in the DS.

-Bob Cozzi
www.iSeriesTV.com
iPod your industry news instead of reading it.
Coming July 18, 2006
Ask your friends to tune into iSeriesTV.com


-----Original Message-----
From: In my understanding, when clearing an entire DS, the whole thing 
is 
treated like one big character field.  I'm not sure if INZ will help 
this 
or not.  I think that numeric subfields in a DS are initialized like 
character fields as well, unless the INZ keyword is used to initialize 
to 
zero instead of blank.

I'm not sure if this is your problem though ... I usually get a decimal 

data error when trying to compare a DS subfield that has been 
improperly 
initialized, not pointer errors.

Hope this helps,
Adam

#####################################################################################
Attention:
The above message and/or attachment(s) is private and confidential and is 
intended 
only for the people for which it is addressed. If you are not named in the 
address 
fields, ignore the contents and delete all the material. Thank you. Have a nice 
day.

For more information on email virus scanning, security and content
management, please contact administrator@xxxxxxxxxxxx
#####################################################################################

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.