Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6776933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:05:17+00:00 2026-05-26T16:05:17+00:00

in RPG III I need to store an huge array in a file. The

  • 0

in RPG III I need to store an huge array in a file. The maximum fieldlength is 256, thus I defined the file with 16 fields of 250 chars long each. Is there a way to put the 1000 values of the array into the 16 fields without moving? Just like the REDEFINES in COBOL?

array in the program:

 E                    MPDV     1000  4   

Specicifation of the file:

 D000001                                           1   4 WRPMOD 
 D000002                                           5 254 W01PDV 
 ... etc. until     
 D000017                                        37554004 W16PDV   

In Cobol I would write:

 01 MPDV-TOP.
     03 MPDV-ARR OCCURS 1000.
        05 MPDV PIC X(4).
  01 WRPREC REDEFINES MPDV-TOP.
     03 W01PDV PIC X(250).
     .... ETC. UNTIL
     03 W16PDV PIC X(250).

Reading the file I get the array MPDV with it’s values and with values in MPDV I can write the file.

my solution looks like this:
an extra array

    E                    MPX        16250               MPDV REDEF   

and lots of moves:

C                     MOVELMMEMOD    WRPMOD    
C                     MOVEAMPDV      MPX       
C                     MOVELMPX,1     W01PDV    
C                     MOVELMPX,2     W02PDV    
.... etc until
C                     MOVELMPX,16    W16PDV  
C                     WRITEWRPASM         

and reverse for reading.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:05:18+00:00Added an answer on May 26, 2026 at 4:05 pm

    Use a Data Structure to overlay the individual fields into the main field:

    IMPDV        DS                                      
    I                                        1 250 W01PDV
    I                                      251 500 W02PDV
    I                                      501 750 W03PDV
                          . . .
    I                                     37514000 W16PDV
    

    For more information I recommend the following resources:

    IBM i information center
    ILE RPG Programmers Guide
    ILE RPG Language Reference

    Safari Books Online
    The Modern RPG IV Language

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a small RPG game engine with Lua/love2d, and I need to
In an RPG program (One of IBM's languages on the AS/400) I can chain
With the interest of creating a roguelike RPG (such as Nethack, Rogue, and ADOM),
Scenario: old legacy code in rpg have to consume data from a new web
I trying to complete a RPG game for a project, but have no idea
I am creating a light RPG game where a character is able to equipment
I'm programming a simple text-based RPG using a switch statement for a game loop.
I'm creating a 2D tile-based RPG in XNA and am in the initial design
How to validate data in RPG code like if a field is of char
I'm looking to make an RPG with Cocos2D on the iPhone. I've done a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.