Run time array

380 pts.
Tags:
AS/400
AS/400 Arrays
RPGLE
fzscl01    if   e           k disk
d gvk             s              2    DIM(40)
d wsname1         S             10
D SDS            SDS
D  USER                 254    263
/FREE

wsname1= USER;
DSPLY wsname1;
wsname1='DEFAULT';
chain wsname1 zscl01;
GVK(1)=ZCMP01;
GVK(2)=ZCMP02;
GVK(3)=ZCMP03;
GVK(4)=ZCMP04;
GVK(5)=ZCMP05;
GVK(6)=ZCMP06;
GVK(7)=ZCMP07;
GVK(8)=ZCMP08;
GVK(9)=ZCMP09;
GVK(10)=ZCMP10;
GVK(11)=ZCMP11;
GVK(12)=ZCMP12;
GVK(13)=ZCMP13;
GVK(14)=ZCMP14;
GVK(15)=ZCMP15;
GVK(16)=ZCMP16;
GVK(17)=ZCMP17;
GVK(18)=ZCMP18;
GVK(19)=ZCMP19;
GVK(20)=ZCMP20;
GVK(21)=ZCMP21;
GVK(22)=ZCMP22;
GVK(23)=ZCMP23;
GVK(24)=ZCMP24;
GVK(25)=ZCMP25;
GVK(26)=ZCMP26;
GVK(27)=ZCMP27;
GVK(28)=ZCMP28;
GVK(29)=ZCMP29;
GVK(30)=ZCMP30;
GVK(31)=ZCMP31;
GVK(32)=ZCMP32;
GVK(33)=ZCMP33;
GVK(34)=ZCMP34;
GVK(35)=ZCMP35;
GVK(36)=ZCMP36;
GVK(37)=ZCMP37;
GVK(38)=ZCMP38;
GVK(39)=ZCMP39;
GVK(40)=ZCMP40;
Instead of this, should I want to move all 40 field values in to an array in one statement or into a loop? Please give me idea.

Software/Hardware used:
rpgle
ASKED: October 29, 2013  10:08 AM
UPDATED: October 29, 2013  10:53 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta

    Declare a DS with LIKEREC() for the zscl01 record format. Then define the GVK() array to OVERLAY the ZCMPnn subfields. As long as the array elements have the same format as the record fields, there's no need to move anything.

    If the array elements don't have a matching definition, declare a new array over the record fields in the DS and define the elements LIKE() one of the fields. Then copy the elements into GVK() with %SUBARR(), or copy in a loop, or maybe even use the old MOVEA.

    Tom

    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following