View Full Version : RUNRMTCMD does not transfer all records from CL ?
01-01-1995, 02:00 AM
Problem: I have an RPG program that reads several files, combines data and writes it to a download file I've created. Just before the program sets *on LR I call a CL program and pass the users id, password and IP address that runs the RUNRMTCMD that uses the the Client Access RTOPCB.exe. The file transfers and I get the spool file saying it does. Problem is when I open up the spreadsheet on the PC I sent its ALWAYS short by 2 or 3 records !! If I run a AS/400 query on my download file ALL records are there, present and accounted for. If I manually run the .TTO file from the desktop, ALL files are transferred present and accounted for. I run a front end display file and select different data, same result. If I call the CL and pass parms directly to it, all records are transferred and accounted for. So that leaves me with the RPG program as the culprit. Does anyone have any idea why my RPG program might be cutting the file transfer short by 2 or 3 records ? Could the timing of LR being seton be the problem ? Thnams for your ideas !
08-10-2000, 08:03 PM
The "missing" records are still in the program buffer. You probably have the file defined as "output" only on the F-spec. Do one of these: a. CLOSE the file manually in the RPG program before calling the CL program. b. Do a FEOD on the file before calling the CL program. c. Open the file with Block(*NO). In RPG IV, just put this on the F-Spec. d. Override the file with FRCRATIO(1) before opening the file. e. Define the file with the UNIQUE keyword. Chris
08-11-2000, 05:26 AM
Chris - Thank you !...you ceased a lot of frustration ! Stuck "in the buffer" was the problem. I put a CLOSE statement just before my CL call statement and it works nicely now. All the records are written to the file and downloaded to the PC. I ran the program in debug right up to the CL call statement and sure enough the last 2 records were not yet written to my download file. I've used CLOSE before but it never dawned on me to use it in this situation. I've been an RPG programmer for 5 years now and I'm still learning, especially from this great forum !
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.