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



Hi Barbara,

I never would have even thought to try that.

The manual says

"If the concatenation contains only numeric (S, P, B) fields, the resulting data type is zoned decimal (S)."

which supports what you say, but then it says

"When concatenating numeric fields, the sign of the farthest right field in the concatenation is used as the
sign of the concatenated field. The signs of the other fields are ignored; however, they are present in the
concatenated field. Therefore, if a negative value appears in a field other than the last, you must take
appropriate action to delete the embedded signs (such as converting the concatenated field to packed
decimal)."

which sounds like it would be a problem.

--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx <mailto:petercdow@xxxxxxxxx>
pdow@xxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxx>

/
On 9/24/2021 12:59 PM, Barbara Morris wrote:
On 2021-09-22 1:12 p.m., Peter Dow wrote:
I hear you.

Are all those fields character fields, zoned decimal, or packed decimal?  If packed decimal, I'd think concatenating would be a problem.

It works fine to concatenate packed decimal fields. The concatenated field seems to become a zoned decimal field. My RPG/400 can handle the concacenated field with no problem, even if I rename it on an I spec.

Here's physical file CONCATPF:
     A          R REC
     A            CC             2P 0
     A            YY             2P 0
     A            MM             2P 0
     A            DD             2P 0

Here's logical file CONCATLF:
     A          R REC                       PFILE(CONCATPF)
     A            DATE                      CONCAT(CC YY MM DD)
     A          K *NONE

Here's my RPG/400 program. (ewww)
     FCONCATLFIF  E                    DISK
     IREC
     I              DATE                            NEWDAT
     C                     READ REC                      10
     C                     DSPLY          NEWDAT
     C                     SETON                     LR

I added a record to the physical file with values 20 21 09 24.

My RPG program dispalys 20210924 for NEWDAT.



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.