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



http://publib.boulder.ibm.com/infocenter/iadthelp/v7r1/index.jsp?topic=/com.ibm.etools.iseries.langref.doc/c0925086401.htm

"A file is always passed by reference."

-Kurt
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of RPGLIST
Sent: Monday, February 04, 2013 2:31 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: Passing a file as a parameter to a second Program

It does Scott, however it does reaise the question though when passing the parm (file) is it actually passing it or just a pointer to the data? IE:
If I pass a large file, how much of a load is it going to put on the system?


Ok, I was able to make some mods to your program and get it to compile.
What it is doing is reading a record from the file Parm1 into a data
structure and then able to use the fields in that data structure. I
changed the names to use a file on our system.



Finvdetail if e k disk block(*no) template
F Qualified
DMyTest1 pr ExtPgm('JUNK')
D parm1 LikeFile(Invdetail)

DMyTest1 pi
D Parm1 LikeFile(Invdetail)

DMyVal1 s 1n
d MyDs ds likerec(invdetail.invdetailr)

/Free
read Parm1 MyDs;
If MyDs.INVDQTY = 0;
MyVal1 = *On;
Endif;
*Inlr = *On;
return;
/End-Free


HTH,

Scott


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of RPGLIST
Sent: Monday, February 04, 2013 12:12 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: Passing a file as a parameter to a second Program

I've done that Scott, that's sort of why I'm asking here :)

So far it won't compile when I attempt to read the value in any of the
fields, I get an RNF7030.

You can pass a file using LIKEFILE, you didn't say what error you get
on the compile. I have never used it, you might want to review the
relevant section in the RPG reference as to how it can be done.

Scott Mildenberger

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of RPGLIST
Sent: Monday, February 04, 2013 12:01 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Passing a file as a parameter to a second Program

I was under the impression that you could use a parm starting in V6R1
provided that you use the LIKEFILE keyword.

You pass an external described DS. thus you should also define an
external described DS in the called programme.

Regards,
Carel Teijgeler.

On 4-2-2013 19:32, RPGLIST wrote:
I am attempting to pass a file as a parm to a second pgm, but it
will

not compile. Any suggestions or pointers would be greatly
appreciated.


Here is what I have so far:

Program A - The Caller

0001.00 FTrctCont if e k disk block(*no)
0005.00
0005.01 DMytest1 pr extpgm('MyTest1')
0005.02 D Parm1 LikeFile(TrctCont)
0005.03 D
0006.00 /Free
0006.01 Callp MYTEST1(TrctCont);
0006.02 *Inlr = *On;
0007.00 /End-Free

Program B - The Called Program

FTrctCont if e k disk template block(*No)
F Qualified
DMyTest1 pr ExtPgm('MYTEST1')
D parm1 LikeFile(TrctCont)

DMyTest1 pi
D Parm1 LikeFile(TrctCont)

DMyVal1 s 1n


/Free
If Parm1.emlrdt = 0;
MyVal1 = *On;
Endif;
*Inlr = *On;
/End-Free



--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxx

To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take
a

moment to review the archives at
http://archive.midrange.com/rpg400-l.




--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxx

To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxx

To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.




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


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




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


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.