rpg d specs

How to declare an array as follows in free form D specs?
D  fileNameI                               5i 0 Dim(3)      
D                                                         Overlay(fileNameIDS)
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hardrock95Author Commented:
This is what I would actually like to duplicate.
D  fileNameIDS    DS            
D  ds1Null                                     5i 0
D  ds2Null                                      5i 0
D  ds3Null                                     5i 0
D  fileNameI                               5i 0 Dim(Number of columns in table)      // In this example 3
D                                                         Overlay(fileNameIDS)
Gary PattersonVP Technology / Senior Consultant Commented:
Example 14 in this IBM Technote explains this one.  This technote and the documentation I pointed you to earlier have lots of examples of the new free-form definition slecs:


- Gary
     dcl-s dsNull_t int( 5 ) template;
     dcl-ds fileNameIDS;
       ds1Null like(dsNull_t);
       ds2Null like(dsNull_t);
       ds3Null like(dsNull_t);
       dsnnNull like(dsNull_t);

      fileNameI like(dsNull_t) dim( nn ) pos(1);

Open in new window

The fileNameI array is just a sub-field of the fileNameIDS data structure. You simply use POS(1) to place its definition over the first position of the DS.

You don't have to use a TEMPLATE to define all of the sub-fields. You can put data type and size on each individual sub-field if you'd prefer. A TEMPLATE puts the definition in a single location.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IBM System i

From novice to tech pro — start learning today.