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



What does the dte field look like right before calling mohtst?  It looks 
like it is assuming 2 decimal places, but they are being truncated in the 
RPG program since it is defined as 7 0

Steve Jones



"Willie J. Moore" <WJMoore@xxxxxxxxxxxxxxx> 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
04/25/2005 11:53 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
<rpg400-l@xxxxxxxxxxxx>
cc

Subject
Data decimal data error on call






What I thought would be an easy program has not turned out that way.
What I need to do is pass two parameters (&ordno chara 7 & &dte dec 70) to 
program MOHTST.  When I do the call (call pgm(wjmlib/mohtstcl) 'M188330' 
01050401). I get an error about a data decimal data error and it is on the 
call statement. When I display the two fields the ordno fields has the 
correct data in it.  The dte field has 000010504. It should have 1050401. 
If I change the DTE to a character, the program runs fine.
Below is a copy of the CL and RPG the key for file mohmst.
I would appreciate any/and help on this.
William Moore

CL
MOHTSTCL:   PGM        PARM(&ORDNO &DTE) 
 
            DCL        VAR(&ORDNO) TYPE(*CHAR) LEN(7) /* */ 
            DCL        VAR(&DTE) TYPE(*DEC) LEN(7 0) /* */ 
 
            OVRDBF     FILE(MOHMST) TOFILE(AMFLIBP/MOHMST) 
            OVRPRTF    FILE(MOHMSTRP) TOFILE(MASTER/REPORT) 
            CALL       PGM(WJMWORK/MOHTST) PARM(&ORDNO &DTE) 
 
END: 
            DLTOVR     FILE(*ALL) /* Remove all overrides */ 
            RCLRSC     /* Reclaim resources */ 
            ENDPGM 

RPG Program 
FMOHMST  IF  E           K        DISK 
 C* 
 C           KEY01     KLIST 
 C                     KFLD           ORDNO   7 
 C                     KFLD           DTE     70 
 C* 
 C*---------------------------------------------------------------* 
 C           *ENTRY    PLIST 
 C                     PARM           @ORDNO  7 
 C                     PARM           @DTE    70 
 C*---------------------------------------------------------------* 
 C                     MOVE @ORDNO    ORDNO 
 C                     MOVE @DTE           DTE 
 C*---------------------------------------------------------------* 
 C           KEY01     CHAINMOHMST               07 
 C  N07                   EXCPTDETAIL 
 C                            SETON                     LR 
 C*---------------------------------------------------------------*

Record Key:
                                                  Alt 
Key field     Type    Len   Dec   Seq   Col    Text 
ORDNO          A        7          A     N     Order number 
DTE                 P        4     0    A     N     Closeout date
     Key fields -   2 


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




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.