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


  • Subject: Re: SQLRPG Question
  • From: MacWheel99@xxxxxxx
  • Date: Tue, 31 Oct 2000 12:41:12 EST

From Al Macintyre - Indiana

> From: Kaynor@aol.com  (Chapin Kaynor)
>  
>  I'm not very knowledgeable about SQLRPG and I'm curious--
>  my cohorts who use it say that SQLRPG programs 
> must be recompiled over the exact datafiles they  
>  will be run against.  

Not exactly ... pretty much the same qualifications you find for 
file access by RPG programs without SQL in the picture.
We just define things to a slightly different programming standard.
However I have not explored all the nuances involved.

>  Can someone explain to me why, and whether there is a way to compile an 
>  SQLRPG program so that it can safely use unqualified file names?  
>  I'd like to be able to change the library list to run these programs over 
a different 
>  (e.g. Test) data library!
>  
>  We have not used SQLRPGLE.

Me neither

>  Apologies if this is an old topic, and thanks in advance for any 
insights....
> 
>  --Chapin Kaynor, Vermont

I do all my software development using a test library that has a copy of the 
live production source code, except for the modifications I am working on.  
This is true whether CL RPG DDS SQLRPG whatever.  In both development & 
testing, we add BTESTSRC to the front of our library list while in the test 
environment.  We also have a test files environment.  

100% of this is unqualified except in very rare circumstances, such as access 
to data in libraries that is not normally in our library list & does not need 
to be added due to rarety of access to their content.

When testing is satisfactory:

Copy current production source to save some place else (either rename same 
place or into a library of last version used) just in case the testing missed 
something critical & we need to return to the old production version.

Copy test library version to live version & recompile ... I leave copy in 
test library because programs we have modified are more likely to inspire 
ideas for future modifications than programs we have not yet modified.

There are additional complications when there are several distinct 
modifications in the works in the same program & one is now working & they 
want it implemented, but others not finished yet & they not want them 
implemented.

I use this same approach whether SQL is in the picture or not & the main 
reason I do it is because if the RPG is calling a DDS file that is also 
modified, but not qualified, then I want the BTESTSRC version of RPG to call 
the BTESTSRC version of DDS.

F-specifications of RPG are never qualified by me ... I just name the file & 
it grabs source layout based on library list at time of RPG compile, then I 
use the fields in-line.

SQLRPG specifications also are not qualified by me as to which library the 
files are in, the qualification is the name of the file & the name of the 
field in the file, but only at time of input, not in the actual RPG code that 
uses the data from those fields.

The program structure I use is to define a "cursor" in which there will be a 
read of a bunch of fields from a bunch of files that are interconnected 

such as order # item # workstation # ... 
basically a "detail file" record's selected fields
and a bunch of "master files" for various control fields in the "detail file"
inputting only the fields I need from those master files

Each time there is another read, it gets the next "detail file" record with 
the accompanying fields

All of this goes into a data structure with field names charted much the same 
way as external files chart the incoming field names & I use them the same 
way in the body of the program.

We can get at a chunk of input data by doing an RPG access to one file & in 
comes all the fields of that file.  I never qualify that in the RPG program 
as to which library the file is in.

or

We can get at a chunk of input data by doing an SQL access to a bunch of 
files & in comes only the fields we are interested in.  I never qualify that 
in the SQLRPG program as to which library the files are in.

However, in the CL that calls the RPG or SQLRPG I sometimes have an OVRDBF 
substituting a different files library at run time, for either RPG files or 
SQL files.

When the program is finished it has a step to close up what the SQL opened.

Hope this helps a bit.

Alister William Macintyre 
Computer Data Janitor etc. of BPCS 405 CD Rel-02 on 400 model 170 OS4 V4R3 
(forerunner to IBM e-Server i-Series 400)  @ http://www.cen-elec.com Central 
Industries of Indiana--->Quality manufacturer of wire harnesses and 
electrical sub-assemblies

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.