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



How is the program compiled?
Do you LR=ON between each run?

What is the SQL code after you run the Open?
When are you closing the cursor?

Based on what you've included,
it's possible that you are on the second run of the program but still using the cursor from the first run.
The open fails, but the fetch runs over the last open cursor which is already at the End.


Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Tom Deskevich
Sent: Monday, November 13, 2017 7:41 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Do you see anything wrong with this code for RECORD_LOCK_INFO

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/www.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:https://urldefense.proofpoint.com/v2/url?u=http-3A__subscribe.harriscomputer.com&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=GYVfe7k5MogwSsRr94zbPeTDRJYpFK3WOG9BKFEwK1s&m=d7va1zPuFuTGuE1TrdLP_AqwWkhORXAESqJ4cbyePx8&s=VHD_r7Zj4RJuqiaFDsBNSLdbtjNZvcagD-gv8meN6iE&e=

Unsubscribe Option: If you do not wish to receive any future email, please unsubscribe by clicking on the following link:https://urldefense.proofpoint.com/v2/url?u=http-3A__subscribe.harriscomputer.com&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=GYVfe7k5MogwSsRr94zbPeTDRJYpFK3WOG9BKFEwK1s&m=d7va1zPuFuTGuE1TrdLP_AqwWkhORXAESqJ4cbyePx8&s=VHD_r7Zj4RJuqiaFDsBNSLdbtjNZvcagD-gv8meN6iE&e=



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://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=GYVfe7k5MogwSsRr94zbPeTDRJYpFK3WOG9BKFEwK1s&m=d7va1zPuFuTGuE1TrdLP_AqwWkhORXAESqJ4cbyePx8&s=5zxzHQSoJc6KiYP6pSkoYHdcJm_BvcpmcbGVgS7G298&e=
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=GYVfe7k5MogwSsRr94zbPeTDRJYpFK3WOG9BKFEwK1s&m=d7va1zPuFuTGuE1TrdLP_AqwWkhORXAESqJ4cbyePx8&s=13IWYJzz41ENtJz2JTXXNbfOVcAqeDagyll9J-cQUcY&e=.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://urldefense.proofpoint.com/v2/url?u=http-3A__amzn.to_2dEadiD&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=GYVfe7k5MogwSsRr94zbPeTDRJYpFK3WOG9BKFEwK1s&m=d7va1zPuFuTGuE1TrdLP_AqwWkhORXAESqJ4cbyePx8&s=6KWp7OaFlOFtUjFYiyVbc59USmXYKV02gS6RKXWR05A&e=


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.