-1

I have the following data structure in an old program

D P1PARM DS 256
D P1ADFR 1 15
D P1ADTO 16 30
D P1MSNR 31 37 0
D P1NSNR 38 44 0
D P1YEAR 45 48 0
D P1COMP 59 62
D P1FAC 63 67
D P1PPSR 68 74 0
D P1PTNS 75 79

I want to use this in a new program but want to convert this into free format , can someone help me with the syntax. I have searched the net but could find an example for this kind of position based data structure which is overlaying over the main size of 256.

Thanks in advance.

Kunal Roy
  • 729
  • 3
  • 11
  • In case you need a link to the [RPGLE Reference manual](https://www.ibm.com/docs/en/i/7.4?topic=rpg-ile-reference) – Charles Jun 08 '23 at 13:48

1 Answers1

4
   Dcl-DS P1PARM Len(256);
     P1ADFR         Char(15)   Pos(1);
     P1ADTO         Char(15)   Pos(16);
     P1MSNR         Zoned(7:0) Pos(31);
     P1NSNR         Zoned(7:0) Pos(38);
     P1YEAR         Zoned(4:0) Pos(45);
     P1COMP         Char(4)    Pos(59);
     P1FAC          Char(5)    Pos(63);
     P1PPSR         Zoned(7:0) Pos(68);
     P1PTNS         Char(5)    Pos(75);
    End-DS;
  • 2
    If you use VSCode for development, then there is an "RPGLE Free" plugin that automatically converts the selected code section from FIXED to Free. It does not always work adequately, but it is quite acceptable for simple code sections. In this case, I used it because it was faster (copy + paste) than typing by hand :-) – Victor Pomortseff May 31 '23 at 14:03