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



Patrick,

        Data structure is always *CHAR type. If you declare a data area as
numeric and you move it into DS, it is impossible. Definitely it gives error
as you are getting. In addition to my previous mail, you can use as below
also if your data area is *CHAR type. Here "procyr1" is *CHAR type and
converted to decimal by "subfld". This "subfld" is moved again back to *char
by "C" spec into charfld for display on workstation device. Generally a data
structure is used on a *CHAR field. But if you have any numeric field in
program, you can move it first into a char field and can move into a DS to
split it into diff. number , usually a data field. 

D dtads          uds                  dtaara(procyr1)          
Dsubfld                          6  0                          
 * create a character representation of the data area          
c                   movel     subfld        charfld           6
C     charfld       dsply                                      
C                   eval      *inlr = *on                      
C                   return                                     

Regards,
Ramana

-----Original Message-----
From: Shrader, Patrick [mailto:pshrader@xxxxxxxx]
Sent: Thursday, May 29, 2003 4:53 AM
To: RPG Mailing List
Subject: data area question


Folks, I need some guidance. I very rarely use data areas to transfer
information, but in this case I must capture some data that is stored there.
Whenever I run this program I get an error message telling me that my data
area type or length does not match my program data area.

Any tips would be appreciated.

Thanks in advance,
Patrick

Code (V4R5):
D period         uds                  dtaara(PROCYR)
D  cmonth                        6s 0
D month           s              6
 * create a character representation of the data area
C                   move      cmonth        month
 *
C                   eval      *inlr = *on
C                   return

Data area definition:
                               Display Data Area                       
                                                             System:   
 Data area . . . . . . . :   PROCYR                                    
   Library . . . . . . . :     FILLIB                                  
 Type  . . . . . . . . . :   *DEC                                      
 Length  . . . . . . . . :   6 0                                       
 Text  . . . . . . . . . :   Processing Year and Month                 
 Value . . . . . . . . . :   200312                                    
                                                                       

Error message:
                        Additional Message Information

 

Message ID . . . . . . :   RNX0411       Severity . . . . . . . :   50

Message type . . . . . :   Escape

Date sent  . . . . . . :   05/28/03      Time sent  . . . . . . :   19:13:49

 

Message . . . . :   Data area PROCYR type or length does not match program

  data area.

Cause . . . . . :   Data area PROCYR was defined in the RPG procedure to be
of 
  type *CHAR and length 6. The actual data area XYZLIB/PROCYR is of type
*DEC  
  and length (6 0). If a *LGL data area is expected, a data area of type
*CHAR 
  and length 1 is also allowed.

Recovery  . . . :   Correct the type or length of the data area, or change
the 
  library list so the correct data area will be found.

 

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


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.