× 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.



I use both... sometimes it's just way easier to use native I/O

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Alan Campin
Sent: Thursday, July 25, 2019 3:52 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Using long names

My question. Why are people still using file I/O instead of SQL? Have been using SQL for at least 10 years, probably closer to 15.

I understand maintenance. It may make more sense to use File I/O in an existing program but beyond that?

On Thu, Jul 25, 2019 at 12:42 PM Alan Shore via RPG400-L < rpg400-l@xxxxxxxxxxxxxxxxxx> wrote:

Hi
The qualified keyword on an Fspec also qualifies the columns (fields)
Here is an example of how I use it

dcl-f Ordhdrl0 disk(*ext) usage(*input) keyed
prefix('HDR.');

dcl-ds HDR Extname('ORDHDRL0') qualified end-ds;

chain (Azdyy:
Azdmmdd:
Azdxxx:
Azdordnum) Ordhdrl0;
if not %found(Ordhdrl0);
HDR.Source = 'AMAZON??'; //<--------Column or field in the
QUALIFIED data structure
endif;

Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf
Of Rob Berendt
Sent: Thursday, July 25, 2019 2:48 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] RE: Using long names

<snip>
As noted, you can get around that with prefixes. I also like
qualified data structures (I like them a lot, but hey, I like Java too).
</snip>
I wonder why the QUALIFIED keyword on an Fspec only qualifies the
record id's and not the columns. I guess maybe they figured they
already have that with PREFIX.

Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600
Mail
to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com


-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Joe
Pluta
Sent: Thursday, July 25, 2019 2:29 PM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Re: Using long names

CAUTION: This email originated from outside of the organization. Do
not click links or open attachments unless you recognize the sender
and know the content is safe.


A lot of times, I find something like this to be the result of not
quite following a standard.

For example, a true standard is that every field with the same name
has the same data. While we can argue about whether ITEMDESC and
CUSTDESC should just be DESCRIPTION, but let's assume that fields are
supposed to be the same. Well, if that's the case then CUSTOMER can
be the customer number in every file in the database, and in face
related records should have the same value. But you have to code that
way, making sure to only deal with related records. The first time
you grab a different record, you have issues.

As noted, you can get around that with prefixes. I also like
qualified data structures (I like them a lot, but hey, I like Java too).

It's similar to the folks who use a unique, system-generated number as
the actual key for every file. This in theory is freaking awesome,
because you can change customer number and every related record will change with it.
But it takes a bit more work whenever you're trying to join files
together in queries. So often the customer number is attached to a
file somewhere and it doesn't get fixed.



On 7/25/2019 1:00 PM, Rob Berendt wrote:
Well, thank you.

I despise naming short names with a file prefix. For examples
IIMITEMNO IIMDESC IIMQTY And another file with ECLITMDESC

This makes it impossible to query the system catalog to find the
tables
containing item_description.
Hasn't anyone cracked open a RPG manual to find that if you just
have to
prefix you can use the PREFIX keyword on the file spec? Why tie up
precious real estate of short 10 character names with a prefix?
I used vendor software which didn't even prefix their fields in
their
tables. This was even pre ILE and they had to exhaustively rename in
their programs.

Rob Berendt


--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

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.