I will certainly get some use out of the nested DS declaration in my
spreadsheet generation programs. I'll be able to simplify the below
declaration by moving the intermediate templates into the regular
declaration. It will make things much more readable and easier to
maintain.
dcl-s CurCol uns(3) template;
dcl-s ColHdr_t varchar(40) template;
dcl-s ColWid_t uns(3) template;
/////////////////////////////////////
//Tab 1 layout
/////////////////////////////////////
dcl-ds Fam1CD_t qualified template;
Col like(CurCol) INZ;
Wid like(ColWid_t) inz(10);
Hdg1 like(ColHdr_t) inz('Product');
Hdg2 like(ColHdr_t) inz('Family');
end-ds;
dcl-ds Fac1CD_t qualified template;
Col like(CurCol) INZ;
Wid like(ColWid_t) inz(10);
Hdg1 like(ColHdr_t) inz('Dekko');
Hdg2 like(ColHdr_t) inz('Facility');
end-ds;
// Ultimately defines column order
dcl-ds T1 qualified;
TtlSiz;
Fam likeds(Fam1CD_t) inz(*likeds) overlay(TtlSiz);
Fac likeds(Fac1CD_t) inz(*likeds) overlay(TtlSiz:*next);
arr likeds(Fam1CD_t) dim(T1Cnt) pos(1);
end-ds;
dcl-c T1Cnt %div(%size(T1.TtlSiz):%size(Fam1CD_t));
From: Barbara Morris <bmorris@xxxxxxxxxx>
To: rpg400-l@xxxxxxxxxxxx
Date: 02/14/2017 02:22 PM
Subject: Spring 2017 enhancements for RPG
Sent by: "RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx>
RPG has some enhancement PTFs coming up soon for 7.2 and 7.3, timed with
the spring TRs.
- nested data structures in free-form declarations
- %MAX and %MIN built-in functions
- ALIGN(*FULL) for data structures
See this RPG Cafe blog entry:
http://ibm.biz/spring_2017_rpg_72_73_enhancements
As an Amazon Associate we earn from qualifying purchases.