|
On Nov 13, 2020, at 4:59 PM, Charles Wilt <charles.wilt@xxxxxxxxx> wrote:
Post to the RPG list...
Else David will remove you from his Christmas card list :)
Charles
On Fri, Nov 13, 2020 at 2:53 PM Jay Vaughn <jeffersonvaughn@xxxxxxxxx>--
wrote:
Here it is Charles... (not my code :))... a quick and truly dirty pgm to
write a test file out to the ifs...
...
h dftactgrp(*no) actgrp(*new)
h BndDir('QC2LE')
dcl-pi tstwrtifs2;
p_iter char(6) const;
p_path char(50) const;
end-pi;
*--------------------------------------------------------------------*
* Internal ProtoTypes For IFS Procedures.
*
*--------------------------------------------------------------------*
d OpenFile pr 10i 0 ExtProc('open')
d StreamPointer * Value
d OpenFlags 10i 0 Value
d Mode 10u 0 Value Options(*nopass)
d CodePage 10u 0 Value options(*nopass)
d ReadFile pr 10i 0 ExtProc('read')
d FileHandle 10i 0 Value
d DataReceived * Value
d NBytes 10u 0 Value
d WriteFile pr 10i 0 ExtProc('write')
d FileHandle 10i 0 Value
d DataToWrite * Value
d NBytes 10u 0 Value
d CloseFile pr 10i 0 ExtProc('close')
d FileHandle 10i 0 Value
* Values for OpenFlag Parameter, Used by open()
d OpenAppend s 10i 0 Inz(256)
d OpenCodePage s 10i 0 Inz(8388608)
d OpenCreate s 10i 0 Inz(8)
d OpenExclude s 10i 0 Inz(16)
d OpenReadOnly s 10i 0 Inz(1)
d OpenReadWrite s 10i 0 Inz(4)
d OpenTextData s 10i 0 Inz(16777216)
d OpenTruncate s 10i 0 Inz(64)
d OpenWriteOnly s 10i 0 Inz(2)
* User Authorities For OpenMode Parameter, Used by open()
d AutUsrRead s 10i 0 Inz(256)
d AutUsrWrite s 10i 0 Inz(128)
d AutUsrExec s 10i 0 Inz(64)
d AutUsrAll s 10i 0 Inz(448)
* Group Authorities
d AutGrpRead s 10i 0 Inz(32)
d AutGrpWrite s 10i 0 Inz(16)
d AutGrpExec s 10i 0 Inz(8)
d AutGrpAll s 10i 0 Inz(56)
* Other Authorities
d AutOthRead s 10i 0 Inz(4)
d AutOthWrite s 10i 0 Inz(2)
d AutOthExec s 10i 0 Inz(1)
d AutOthAll s 10i 0 Inz(7)
* Program Constants
d StreamPointer s 512a inz
d Null c x'00'
dcl-c crlf x'0D25';
* Internal Variable Definitions
d FilePointer s 10i 0
d StreamFile s 256a
d Data s 65533a Varying
d DataToWrite s 32767A
d DataLen s 10i 0 Inz(1)
d CharsRead s 10i 0
d CharsWrite s 10i 0
d Input s 256a
d OpenFlag s 10i 0
d Permissions s 10i 0
d AsciiCodePage s 10U 0 Inz(819)
d X s 9p 0
d tick c ''''
d g_command s 2048 inz
/free
//
---------------------------------------------------------------------
// Program Main Line
//
---------------------------------------------------------------------
streamfile = %trim(p_path);
createAndOpen();
openWriteCloseLoop();
*inLR = *on;
Return;
// -------------------------------------------------------------
--------
// procedure
// -------------------------------------------------------------
--------
p createAndOpen...
p b
d pi
//----------------------
// local vars
//----------------------
// Initialize field.
Clear FilePointer;
Clear CharsWrite;
Clear OpenFlag;
Clear Permissions;
// Open and create the IFS file.
StreamPointer = %trim(StreamFile) + Null;
//StreamPointer = %trim(StreamFile);
OpenFlag = OpenCreate + OpenWriteOnly + OpenTruncate + OpenCodePage;
Permissions = AutUsrAll + AutOthAll;
FilePointer =
OpenFile(%Addr(StreamPointer)
: OpenFlag
: Permissions
: AsciiCodePage);
// If an error occurs, execute subr to notify of open error.
If FilePointer < 0;
EndIf;
CloseFile(FilePointer);
return;
p createAndOpen...
p e
// -------------------------------------------------------------
--------
// procedure
// -------------------------------------------------------------
--------
p openWriteCloseLoop...
p b
d pi
//----------------------
// local vars
//----------------------
For x = 1 to %int(p_iter);
OpenFlag = OpenTextData + OpenWriteOnly;
FilePointer = OpenFile(%Addr(StreamPointer): OpenFlag);
If FilePointer < 0;
dsply ('Open Error' + %char(x));
return;
EndIf;
DataToWrite = 'xxx is here ' + %char(x) + crlf;
CharsWrite =
WriteFile(FilePointer:
%addr(DataToWrite):
100);
CloseFile(FilePointer);
EndFor;
return;
p openWriteCloseLoop...
p e
On Fri, Nov 13, 2020 at 4:48 PM Jay Vaughn <jeffersonvaughn@xxxxxxxxx>
wrote:
Sure will!then
Jay
On Nov 13, 2020, at 4:13 PM, Charles Wilt <charles.wilt@xxxxxxxxx>wrote:
:)
Post the API code on the RPG list and we can tell you how to fix that.
Charles
On Fri, Nov 13, 2020 at 1:54 PM Jay Vaughn <jeffersonvaughn@xxxxxxxxx
wrote:
Charles - that was it... a rename of the file on the remote system
parmsallowed it to get with the "visible" filename...
thanks everyone for their suggestions...
jay
On Fri, Nov 13, 2020 at 3:48 PM Charles Wilt <charles.wilt@xxxxxxxxx>
wrote:
How was test.TXT created?
I've seen issues when using API's to create IFS files, where the
jeffersonvaughn@xxxxxxxxxare
poorly passed and the file name ends up with blanks as part of it.file
so instead of "text.TXT", it's actually "test.txt "
Assuming you have ACS access to the other box, could try renaming the
using WRKLNK, or the ACS IFS component.
If all you have is FTP, try
MGET test.*
Charles
On Fri, Nov 13, 2020 at 12:37 PM Jay Vaughn <
IFS?
wrote:but
I thought for sure I was doing this right (and have done before)...
can anyone tell me why this cannot find the file on the remote i
"V7R4M0".I can assure you the file is there plain as day.
------
OS/400 is the remote operating system. The TCP/IP version is
mailing
250 Now using naming format "0".
257 "QGPL" is current library.
Enter an FTP subcommand.
ASCII
200 Representation type is ASCII nonprint.
Enter an FTP subcommand.
NAMEFMT 1
250 Now using naming format "1".
Server NAMEFMT is 1.
Client NAMEFMT is 1.
Enter an FTP subcommand.
lcd /ptenctest2
Local working directory is /ptenctest2
Enter an FTP subcommand.
cd /ptenctest2
250 "/ptenctest2" is current directory.
Enter an FTP subcommand.
GET test.TXT (REPLACE
250 Now using naming format "1".
257 "/ptenctest2" is current directory.
229 Entering Extended Passive Mode (|||7286|).
550 Unable to find file /ptenctest2/test.TXT
Enter an FTP subcommand.
quit
221 QUIT subcommand received.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailingaffiliatelistrelated
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
questions.
Help support midrange.com by shopping at amazon.com with our
link: https://amazon.midrange.com--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
affiliaterelatedlist
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
questions.
Help support midrange.com by shopping at amazon.com with our
affiliatelistlink: https://amazon.midrange.com--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
relatedTo post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
questions.
Help support midrange.com by shopping at amazon.com with our
--listlink: https://amazon.midrange.com--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxxrelated questions.
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
link: https://amazon.midrange.com
Help support midrange.com by shopping at amazon.com with our affiliate
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-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
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-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 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.