Tom,
Could you please post your DECLARE statement?
Regards,
Luis
Sent from my Moto G phone. Please excuse my brevity.
On Nov 13, 2017 11:04, "Tom Deskevich" <TDeskevich@xxxxxxxxxxxxxxxxxx>
wrote:
I am trying to capture the record locks for a file and relative record
number(library is not passed in, should pick up from the library list).
I know I have locks, I run the SQL independently and get results. Yet the
embedded SQL in this code never returns anything.
I never get past the first check of SQLCOD, skips to the enddo.
I put the program in debug and checked the variables, and they are correct
(File and Record#)
SELECT
JOB_NAME AS jobname
FROM QSYS2.RECORD_LOCK_INFO
WHERE SYS_TNAME= :File
AND RRN= :Record#;
EXEC sql
OPEN C1;
EXEC sql
FETCH C1 INTO :jobname;
dow sqlcod<>100 and sqlcod>=0; <<== sqlcod is 100 first pass.
Exsr loadrtn;
EXEC sql
FETCH C1 INTO :jobname;
enddo;
Exfmt schctl1; <== give user ability to cancel jobs.
If *in12=*off;
exsr killjobs;
Tom Deskevich TIA
Harriscomputer
Tom Deskevich
Programmer/Analyst
P: 814-472-6066 x134
F: 814-472-5019
E: TDeskevich@xxxxxxxxxxxxxxxxxx
[cid:HLG_logo_eccde356-f9d5-496b-9e38-e7802fb467a8.jpg]
172 Gateway Road PO Box 568
Ebensburg, Pennsylvania
15931
www.harrislocalgov.com<file:///C:/Users/jk80512-admin/
AppData/Local/Temp/3/b4357967-469d-46e6-96e1-8cc4b2032841/ww
w.harrislocalgov.com>
This message has been sent on behalf of a company that is part of the
Harris Operating Group of Constellation Software Inc. These companies are
listed at the following link:
http://subscribe.harriscomputer.com
Unsubscribe Option: If you do not wish to receive any future email, please
unsubscribe by clicking on the following link:
http://subscribe.
harriscomputer.com
This message is intended exclusively for the individual or entity to which
it is addressed. This communication may contain information that is
proprietary, privileged or confidential or otherwise legally exempt from
disclosure. If you are not the named addressee, you are not authorized to
read, print, retain, copy or disseminate this message or any part of it. If
you have received this message in error, please notify the sender
immediately by e-mail and delete all copies of the message.
--
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:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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:
http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.