× 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 guys
First of all apologies for the subject line.
I'm not too sure if it explains what I am looking for.
Anyway - before I forget - we are on V5r4

What I need to do is add records to a particular file.
The file record is pretty simple
FieldA 1
FieldB 2 0
FieldC 1 0
FieldD 3 0

FieldA will be a constant value P
FieldB values 1 thru 99 inclusive
FieldC values 1 thru 7 inclusive
FieldD values 1 thru 7 inclusive

The new records need to be as the following
FieldA FieldB FieldC FieldD
P 1 1 1
P 1 1 2
P 1 1 3
P 1 1 4
P 1 1 5
P 1 1 6
P 1 1 7
P 1 2 1
P 1 2 2
Etc.
FieldC will eventually max out at 7, changing to 1 with the next record while FieldB will go to 2
Hopefully, this makes sense - but the question becomes - is this possible to do in SQL?
Then as if that's not hard enough, only insert the record, if the record is not already there.
I probably will have to do this in RPGILE, but I was just wondering if it could be done in SQL
I tried googling count and sequence to no avail

Anyway - as always - all answers gratefully accepted

Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640


Disclaimer: This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.