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



I am a little late to the conversation but once you are creating a function,
why not convert the date into a date variable. There are lots of advantages
to the date field and you can have another sub procedure/function to convert
back to a numeric field when needed.

Darryl Freinkel
A4G.
Tel: 770.321.8562 Ext 111 | Cell: 678.355.8562

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Alan Shore
via RPG400-L
Sent: Thursday, October 24, 2019 10:57 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Cc: Alan Shore <ashore@xxxxxxxx>
Subject: RE: [EXTERNAL] Re: Making changes to an RPG program

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.