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



Hi,

Thanks.
upon analyzing the program i found these fields were already present in one
of the file declared as a primary file so i think that might be the cause
of this error and when i used new variables then it got resolved and
getting correct values reflected in parameter values but now the different
problem is occurring the previous version of programs were initially
generated reports upon entering some parameters on screen like GMAB,CTCD,BR
NO and Rundate and when i tried to automate it then in report file(which is
created as a database file INBA71P) is not having any records in it.

So what corrections should i make so that my newer version of programs
could successfully write same data in a physical file inba71p(which has
just single field of 600 length and IF@TXT a single field in it and which
has it's record format name as INBA71PR)

Please find old version of CL and RPG programs in below link which used to
generate report as a spool file :-

CL--
*https://code.midrange.com/6eb355eb83.html
<https://code.midrange.com/6eb355eb83.html>*
RPG:-*https://code.midrange.com/356c2e4d39.html
<https://code.midrange.com/356c2e4d39.html>*


And below are the links for their newer versions to automate this report to
have same report in a database file :-

New RPG:-*https://code.midrange.com/90f12627c1.html
<https://code.midrange.com/90f12627c1.html>*

New CL version:- *https://code.midrange.com/b7f692ed52.html
<https://code.midrange.com/b7f692ed52.html>*

RPG program to pass 1 date less than current system date: as report should
be run one date prior to current system date-

*https://code.midrange.com/8fa7a9ba94.html
<https://code.midrange.com/8fa7a9ba94.html>*



Thanks much...




On Wed, Jan 20, 2021 at 5:40 AM James H. H. Lampert <
jamesl@xxxxxxxxxxxxxxxxx> wrote:

On 1/18/21 5:31 AM, techie21 IT wrote:
I have two fields let's say fld1,fld2(date field) and having their
data types in CL program as Character but in RPG program they are as
numeric

I suggested a DS, with zoned and character fields superimposed over each
other.

On 1/19/21 9:56 AM, techie21 IT wrote:
Sorry i did not understand it could you please explain it with a
code example in my program?

Well, I don't have all of your code to patch, but suppose the CL program
has:
DCL VAR(&FLD1) TYPE(*CHAR) LEN(6)
DCL VAR(&FLD2) TYPE(*CHAR) LEN(8)

with those fields passed to the RPG program, hopefully containing valid
character representations of numbers. Then the RPG program could have:

D FLD1 DS
D FLD1A 1 6A
D FLD1Z 1 6S 0
D FLD2 DS
D FLD2A 1 8A
D FLD2Z 1 8S 0
. . .


ENTRY PLIST
PARM FLD1
PARM FLD2

and you could then check FLD1A and FLD2A to make sure they're valid
zoned decimal numbers, and if so, you would reference FLD1Z and FLD2Z
for their numeric values.

Or, if I remember right, there are some slick (relatively) new built-in
functions that can, fed a character variable containing a valid,
parseable representation of a number, return the number (in which case
your validation would just be a go/no-go check, and you could skip the
old-fashioned DS overlays.

--
JHHL
--
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@xxxxxxxxxxxxxxxxxxxx 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.