× 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: user open file with a variable not a constant
  • From: cmassoglia@xxxxxxxxxxx (Charles L. Massoglia)
  • Date: Tue, 31 Aug 1999 07:20:14 -0400

Try the following:

FDUMMYFILE    IF    F  4096  4096              DISK           USROPN

D REALFILE       S        10A 

IDUMMYFILE  NS     
I                                   1   4096  DATA

C                      EVAL     REALFILE = 'FILE1'
C                      CALLB    'OVRDBFC'
C                      PARM                     REALFILE
C                      OPEN     DUMMYFILE
 --- read and process FILE1
C                      CLOSE    DUMMYFILE
C                      EVAL     REALFILE = 'FILE2'
C                      CALLB    'OVRDBFC'
C                      PARM                     REALFILE
C                      OPEN     DUMMYFILE
 --- read and process FILE2 
C                      CLOSE    DUMMYFILE


CLLE Program:

             PGM       PARM(&TOFILE)
             DCL       &TOFILE *CHAR 6
             OVRDBF    DUMMYFILE &TOFILE
             RETURN
             ENDPGM
  
This permits you to read any format file.  If all of the files have the same
definition (i.e. same record format level ID), DUMMYFILE can be externally
defined since it will have the same definition as FILE1 and FILE2   

c                      
>Dan:
>
>You've lost us a little on this one.  How does this answer the original
>question about opening a file?
>
>Dave
>
>-----Original Message-----
>From: Dan Bale [mailto:dbale@genfast.com]
>Sent: Monday, August 30, 1999 10:29 AM
>To: rpg400-l@midrange.com
>Subject: Re: user open file with a variable not a constant
>
>
>
>
>Wayne,
>
>>Hello all, I'm new to this list. I have an Rpgxxx question. Does anyone
>know
>>a way to user open a file in rpg with the file name not in quotes, but
>in a
>>variable? Thanks in advance
>
>Despite a previous response:
>
>     D varnamepgm      s             10a
>     C                   Eval      varnamepgm = 'QEZBCHJB'
>     C                   Call      varnamepgm
>     C                   Eval      *inLR = *On
>
>- Dan Bale
>
>
>
>
>
>+---
>| This is the RPG/400 Mailing List!
>| To submit a new message, send your mail to RPG400-L@midrange.com.
>| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
>| To unsubscribe from this list send email to
>RPG400-L-UNSUB@midrange.com.
>| Questions should be directed to the list owner/operator:
>david@midrange.com
>+---
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
><HTML>
><HEAD>
><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
><META NAME="Generator" CONTENT="MS Exchange Server version 5.5.1960.3">
><TITLE>RE: user open file with a variable not a constant</TITLE>
></HEAD>
><BODY>
>
><P><FONT SIZE=2>Dan:</FONT>
></P>
>
><P><FONT SIZE=2>You've lost us a little on this one.&nbsp; How does this
answer the original question about opening a file?</FONT>
></P>
>
><P><FONT SIZE=2>Dave</FONT>
></P>
>
><P><FONT SIZE=2>-----Original Message-----</FONT>
><BR><FONT SIZE=2>From: Dan Bale [<A HREF="mailto:dbale@genfast.com"
TARGET="_blank">mailto:dbale@genfast.com</A>]</FONT>
><BR><FONT SIZE=2>Sent: Monday, August 30, 1999 10:29 AM</FONT>
><BR><FONT SIZE=2>To: rpg400-l@midrange.com</FONT>
><BR><FONT SIZE=2>Subject: Re: user open file with a variable not a
constant</FONT>
></P>
><BR>
><BR>
><BR>
>
><P><FONT SIZE=2>Wayne,</FONT>
></P>
>
><P><FONT SIZE=2>&gt;Hello all, I'm new to this list. I have an Rpgxxx
question. Does anyone know</FONT>
><BR><FONT SIZE=2>&gt;a way to user open a file in rpg with the file name
not in quotes, but in a</FONT>
><BR><FONT SIZE=2>&gt;variable? Thanks in advance</FONT>
></P>
>
><P><FONT SIZE=2>Despite a previous response:</FONT>
></P>
>
><P><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; D
varnamepgm&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
10a</FONT>
><BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;
C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Eval&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
varnamepgm = 'QEZBCHJB'</FONT>
><BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;
C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Call&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
varnamepgm</FONT>
><BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;
C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Eval&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *inLR =
*On</FONT>
></P>
>
><P><FONT SIZE=2>- Dan Bale</FONT>
></P>
><BR>
><BR>
><BR>
><BR>
>
><P><FONT SIZE=2>+---</FONT>
><BR><FONT SIZE=2>| This is the RPG/400 Mailing List!</FONT>
><BR><FONT SIZE=2>| To submit a new message, send your mail to
RPG400-L@midrange.com.</FONT>
><BR><FONT SIZE=2>| To subscribe to this list send email to
RPG400-L-SUB@midrange.com.</FONT>
><BR><FONT SIZE=2>| To unsubscribe from this list send email to
RPG400-L-UNSUB@midrange.com.</FONT>
><BR><FONT SIZE=2>| Questions should be directed to the list owner/operator:
david@midrange.com</FONT>
><BR><FONT SIZE=2>+---</FONT>
></P>
>
></BODY>
></HTML>


Charlie Massoglia, Massoglia Technical Consulting, Inc.
PO Box 1065, Okemos, MI 48854, USA
517-676-9700  Fax: 517-676-1006  EMAIL: cmassoglia@voyager.net


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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.