|
Unfortunately, files are always "global" in scope. Therefore, you cannot use a variable that's local to a subprocedure in your F-spec. It should work if you define "Filename" to be global instead of local to the procedure. (i.e. define it in the D-specs above the main procedure) But, of course that'll defeat the purpose of the parameter to the subprocedure. You might think about having two vars... "global_File" and "parm_File" and then just before the OPEN of the file, set global_File = parm_File. Ugly, I know, but it's about the best you can do unless you want to use the ILE C runtime to access your file. On Fri, 10 Oct 2003, Tim Kredlo wrote: > Please help. > > I am creating (attempting to, anyway) a sub-procedure that receives a > file name as a parameter. > This file will be chained to in the sub-procedure. > The file names are not known until the calling program is being run, as > they are based on a date in records processed by the calling program. > All the file names that are passed refer to files that are 'archives' of > the same externally DDS described file (PPXC00). > > The manual says: > 1....2....3.... > 4. This keyword is not used to find an externally-described file at > compile time. > What exactly does that (#4) mean anyway? > If it means what I inferred (that it is NOT going to go look for a > definition) why does it blow up? > (The archive example I saw was just a code snippet, but it had the file > externally described.) > > Is there a way to code this and have these files be externally > described? > ************************************************************************ > *********** > This does not compile: > FPPXC00 IF E K Disk ExtFile(FileName) > > F UsrOpn > > /Free > /Copy EXPRDPGM/QRPGSRC,PROTSP (contains PR for sub-procedure) > > /End-Free (field > 'FileName' defined here also ) > > D AdjCst PI 10S 4 > D Prt# Like(PtPrt#) > D CYMD 8S 0 > D FileName 20A > > Some calcs here.... > > Compile error: > *RNF7030 FILENAME **UNDEF** 9 ("9" is > the PPXC00 F-spec) >
As an Amazon Associate we earn from qualifying purchases.
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.