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



The problem is that you can deal with the mis-match win the input side by adding Const to the parameter. But that prevents the return value from being available to repopulate DueDat so the three step process (which is after all what the orih=ginal call does) is the only way unless you change the interface and make it a function.

Which reminds me that the proto for that needed Const so it should have been:

dcl-pr SWAP Packed(8);
*n Packed(8) Const;
end-pr;

On Oct 24, 2019, at 3:57 PM, Alan Shore via RPG400-L <rpg400-l@xxxxxxxxxxxxxxxxxx> wrote:

Thanks for the reply Jon

That's the way I was going to go - but I was hoping/thinking that there would be something different/easier/etc.

I DO like the idea of creating the function

Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Jon Paris
Sent: Thursday, October 24, 2019 10:44 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] Re: Making changes to an RPG program

Not a straight translate due to the requirement to return the value to DUEDAT. An exact match to functionality would appear to be:

dcl-pr SWAP ExtPgm();
*n Packed(8);
end-pr;

SWAPDT = DUEDAT;

SWAP(SWAPDT);

DUEDAT = SWAPDT;

Personally I'd be inclined to look at SWAP and consider rewriting it as a function that returns the required value. The proto etc. would be something like:

dcl-pr SWAP Packed(8);
*n Packed(8);
end-pr;

DueDat = SWAP(DueDat);

On Oct 24, 2019, at 3:16 PM, Alan Shore via RPG400-L <rpg400-l@xxxxxxxxxxxxxxxxxx> wrote:

Hi everyone
Before I forget - we are on V7r3

I have been given the task to make changes to an RPG program - that
was last changed in November 2011

Whenever I need to make a change to an RPG program, my first step is
to convert the RPG source to RPGLE source by using the command
CVTRPGSRC

Having said that, its been many moons since I last converted an RPG to
RPGLE Until now

The reason I have created this e-mail, is that I have decided to try
and take it one step further (be careful what you wish for) and see
what it would take to convert to free Its laborious We are having RDi
installed, and I am one of the lucky early ones - so its been fun
learning about RDi as well

Here is my question

Calling external programs

The code I have is
SWAP C CALL 'SWAP'
SWAP C DUEDAT PARM DUEDAT SWAPDT

Its been a while since I saw this type of code, but I believe the
translation is Call program SWAP using the parameter SWAPDT, but
populating SWAPDT from the field DUEDAT and inserting the answer back
into DUEDAT when returning from the called program SWAP

The field SWAPDT is defined as
dcl-s Swapdt packed(8:0) inz(0);
The field DUEDAT is defined
dcl-ds Duedtds;
Duedat zoned(6:0);
Oiduem zoned(2:0) Pos(1);
Oidued zoned(2:0) Pos(3);
Oiduey zoned(2:0) Pos(5);
end-ds;

How would the call translate into free?
Hope this makes sense
As always - all responses gratefully accepted Alan Shore E-mail :
ASHORE@xxxxxxxx<mailto:ASHORE@xxxxxxxx>
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill

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

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

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

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

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

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


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.