|
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Wilt, Charles
Sent: Friday, March 28, 2008 11:29 AM
To: RPG programming on the AS400 / iSeries
Subject: Garbage being written, not sure why?
I'm trying to track down an problem we've having on a TEST box, the
production box is running the same
programs with apparently no issues.
It seems that on the test box, the program is writing garbage. Here's the
scoop:
Command:
CMD PROMPT('Build FTF Options File')
PARM KWD(SQM) TYPE(*CHAR) LEN(48) MIN(1) +
PROMPT('Source queue manager')
PARM KWD(SPATH) TYPE(*CHAR) LEN(64) MIN(1) +
PROMPT('Source file')
PARM KWD(DQM) TYPE(*CHAR) LEN(48) MIN(1) +
PROMPT('Destination queue manager')
PARM KWD(DPATH) TYPE(*CHAR) LEN(64) MIN(1) +
PROMPT('Destination file')
Command processing program:
PGM PARM(&SQM &SFILE &DQM &DFILE)
DCL VAR(&RTNCD) TYPE(*CHAR) LEN(7)
DCL VAR(&SQM) TYPE(*CHAR) LEN(48)
DCL VAR(&DQM) TYPE(*CHAR) LEN(48)
DCL VAR(&SFILE) TYPE(*CHAR) LEN(64)
DCL VAR(&DFILE) TYPE(*CHAR) LEN(64)
CALL PGM(PRC008R) PARM(&RTNCD &SQM &SFILE &DQM &DFILE)
RPG IV Program:
FFTFOPTION O A F 1024 DISK
D*
D SrcLin DS
D SrcRsv 1 12S 0
D SrcDta 13 1024A
D*
D cRtnCd S 7A
D cSqm S 48A
D cSfile S 64A
D cDqm S 48A
D cDFile S 64A
C *Entry PList
C Parm cRtnCd
C Parm cSqm
C Parm cSfile
C Parm cDqm
C parm cDFile
C Eval cRtnCd = *Blank
C Eval SrcRsv = 0
C Eval SrcDta = '-sqm ' + cSqm
C Write FTFOption SrcLin 99
C Eval SrcDta = '-dqm ' + cDqm
C Write FTFOption SrcLin 99
C Eval SrcDta = '-spath ' + cSfile
C Write FTFOption SrcLin 99
C Eval SrcDta = '-dpath ' + cDfile
C Write FTFOption SrcLin 99
There's actually a number of other parameters, but the SQM and QDM ones,
which end up as the first two
lines of the source file are the ones getting garbage.
The only thing I see, is that the FTFOPTION file, which is actually a
source file with a record length
of 268 is defined in the RPG program as an internally defined file with a
record length of 1024. Not
sure why this was done this way; but it does throw a "CPF4011 - Buffer
length longer than record for
member FTFOPTION." (Severity 10) which I would expect.
A clue as to what is going on, is that the garbage that ends up in the
source file, is from the
corresponding xPATH variables. So for instance, with this invocation:
PRC008C SQM(TEST) SPATH('\dummy\fld\infld\what') DQM(C092DV21)
DPATH('\dummy\out\outfld\so')
I end up with this in the SRCDTA field of the source file:
-sqm TEST \dummy\fld\infld\what
-dqm C092DV21 \dummy\out\outfld\so
Looking at the RPGIV program in debug, cSQM has the value of "TEST
\dummy\fld\infld\what".
But I don't understand why.
What am I missing here?
Thanks!
Charles Wilt
Software Engineer
CINTAS Corporation - IT 92B
513.701.1307
wiltc@xxxxxxxxxx <mailto:wiltc@xxxxxxxxxx>
This e-mail transmission contains information that is intended to be
confidential and privileged. If you receive this e-mail and you are not a
named addressee you are hereby notified that you are not authorized to
read, print, retain, copy or disseminate this communication without the
consent of the sender and that doing so is prohibited and may be unlawful.
Please reply to the message immediately by informing the sender that the
message was misdirected. After replying, please delete and otherwise
erase it and any attachments from your computer system. Your assistance
in correcting this error is appreciated.
--
This is the RPG programming on the AS400 / 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 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.