× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Kurt,

Thanks for the reply.

I don't like giving the group field a definition so if keeping the names
short is the only way it will work then it'll have to be.

These files are probably 30 years old and existing programs are all RPGIII.

I first learned about DS group fields from an article from Jon Paris and
Susan Gantner titled "D-spec Discoveries" (IBM Systems Magazine - Feb.
2003). I save their articles and refer to them all the time.

Btw, freeform is not available via ptf on 6.1. :-(

Thanks again and take care.

Yours truly,

Glenn Gundermann
Email: glenn.gundermann@xxxxxxxxx
Cell: (416) 317-3144


Subject: RE: DS Group Field Names
From: "Anderson, Kurt" <KAnderson@xxxxxxxxxxxx>
Date: Tue, March 11, 2014 5:32 pm
To: "RPG programming on the IBM i (AS/400 and iSeries)"
<rpg400-l@xxxxxxxxxxxx>


Hi Glenn,

Only way to get the long names to work (from my test) was to give those
long names a definition. I also tried freeform (I know you're on v6.1,
but I wasn't sure if you could PTF the freeform back or not), but I'm
definitely no pro in fully freeform RPG code yet. I was having issues
getting the overChargesLevel1 & 2 lines to autodefine.

Since I don't have the files the fields are based on, I just gave them an
arbitrary definition.
dcl-ds overChargesMultiMeter;
overChargesLevel1;
y1vrp1 Length(5) Overlay(overchargesLevel1);
y2vrp1 Length(5) Overlay(overchargesLevel1: *next);
overChargesLevel2;
y1vrp2 Length(5) Overlay(overchargesLevel2);
y2vrp2 Length(5) Overlay(overchargesLevel2: *next);
end-ds;

I understand it's a pain to change current file structures, but I
personally advise against creating files like this (with an array of
fields as separate fields instead of as separate records).

I think if you really want to use the long names and don't want to define
the overChargesLeveln line, you might be able to do it with added
code/effort.
First define a DS with just the file subfields.
Then define a separate DS using sub-data structures. Then copy in the
first DS into the nested DS structure. I didn't try that so I can't
promise that would work, but I'd hope. (What you get by doing that is you
no longer have a D-spec line with an ellipses that is followed by a
subfield, it will always be followed by a DS and Qualified (not sure if
Qualified is required for sub-DS structures, but if not I'd highly
recommend it).

Good luck,

Kurt Anderson
Sr. Programmer/Analyst - Application Development, Service Delivery
Platform

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Glenn Gundermann
Sent: Tuesday, March 11, 2014 4:51 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: DS Group Field Names

Hi All,

I'm on V6R1 and I am wondering what I am doing wrong or if perhaps the
system is short a PTF or something.

The short question: Can a DS group field name go beyond position 21?
If the answer is no, you can skip the rest of this note.
If the answer is yes, I need help.

The first DS compiles wonderfully. I've kept the DS group field names
within positions 7-21.

The second DS (not in the same program at the same time) does not compile.
The DS group field names go beyond position 21. The compile listing
shows RNF3467 "The first parameter for keyword OVERLAY is not valid;
keyword is ignored."

Example Code 1 - This compiles

// Overcharge values for a multi-meter machine.
D overChargesMultiMeter...
D DS
// Overcharge Level-1 for meters 1-4 and summary.
D overChargesL1
D y1vrP1 overlay(overChargesL1)
D y2vrP1 overlay(overChargesL1: *next)
D y3vrP1 overlay(overChargesL1: *next)
D y4vrP1 overlay(overChargesL1: *next)
D ySvrP1 overlay(overChargesL1: *next)
// Overcharge Level-2 for meters 1-4 and summary.
D overChargesL2
D y1vrP2 overlay(overChargesL2)
D y2vrP2 overlay(overChargesL2: *next)
D y3vrP2 overlay(overChargesL2: *next)
D y4vrP2 overlay(overChargesL2: *next)
D ySvrP2 overlay(overChargesL2: *next)
// Overcharge Level-3 for meters 1-4 and summary.
D overChargesL3
D y1vrP3 overlay(overChargesL3)
D y2vrP3 overlay(overChargesL3: *next)
D y3vrP3 overlay(overChargesL3: *next)
D y4vrP3 overlay(overChargesL3: *next)
D ySvrP3 overlay(overChargesL3: *next)
D overChargesMultiMeterA...
D overlay(overChargesMultiMeter)
D dim(15) like(y1vrP1)
D overChargesLevel1A...
D overlay(overChargesL1)
D dim(5) like(y1vrP1)
D overChargesLevel2A...
D overlay(overChargesL2)
D dim(5) like(y1vrP2)
D overChargesLevel3A...
D overlay(overChargesL3)
D dim(5) like(y1vrP3)

Example Code 2 - This does not compile. I've tried it with and without
the blank D spec after the group field name.
The compile listing says overChargesLevel1/2/3 are undefined and 18 of the
overlay statements are in error.

// Overcharge values for a multi-meter machine.
D overChargesMultiMeter...
D DS
// Overcharge Level-1 for meters 1-4 and summary.
D overChargesLevel1...
D
D y1vrP1 overlay(overChargesLevel1)
D y2vrP1 overlay(overChargesLevel1: *next)
D y3vrP1 overlay(overChargesLevel1: *next)
D y4vrP1 overlay(overChargesLevel1: *next)
D ySvrP1 overlay(overChargesLevel1: *next)
// Overcharge Level-2 for meters 1-4 and summary.
D overChargesLevel2...
D
D y1vrP2 overlay(overChargesLevel2)
D y2vrP2 overlay(overChargesLevel2: *next)
D y3vrP2 overlay(overChargesLevel2: *next)
D y4vrP2 overlay(overChargesLevel2: *next)
D ySvrP2 overlay(overChargesLevel2: *next)
// Overcharge Level-3 for meters 1-4 and summary.
D overChargesLevel3...
D
D y1vrP3 overlay(overChargesLevel3)
D y2vrP3 overlay(overChargesLevel3: *next)
D y3vrP3 overlay(overChargesLevel3: *next)
D y4vrP3 overlay(overChargesLevel3: *next)
D ySvrP3 overlay(overChargesLevel3: *next)
D overChargesMultiMeterA...
D overlay(overChargesMultiMeter)
D dim(15) like(y1vrP1)
D overChargesLevel1A...
D overlay(overChargesLevel1)
D dim(5) like(y1vrP1)
D overChargesLevel2A...
D overlay(overChargesLevel2)
D dim(5) like(y1vrP2)
D overChargesLevel3A...
D overlay(overChargesLevel3)
D dim(5) like(y1vrP3)


Yours truly,

Glenn Gundermann
Email: glenn.gundermann@xxxxxxxxx
Cell: (416) 317-3144

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.