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



Hi Scott,

1). I didnt try the CPYFRMSTMF yet, but i will and let you know the results.

2) When i tried the CPY with defaults, it gave me a CCSID error message so i just changed to *CALC and it worked. I guess if it works dont fix it :)



On 6/5/2015 2:34 PM, Scott Klement wrote:
Tim,

Thanks for letting us know what ended up working for you.

For my own information, some questions if you don't mind:

1) did you try CPYFRMSTMF as I suggested and find that it did not work? I know that CPYFRMSTMF is often used to populate save files.

2) Why did you specify TOCCSID(*CALC) on your CPY command? I suspect it's ignored because DTAFMT(*BINARY) is the default on the CPY command. But to someone who doesn't know that, the TOCCSID(*CALC) would seem like a curious thing to do. Translating save file data between CCSIDs makes no sense.




On 6/5/2015 1:23 PM, tim wrote:
i ended up using cpy command instead.

CPY OBJ('/qntc/10.0.0.149/iseries/thu/ourlibrary')
TOOBJ('/qsys.lib/qgpl.lib/ftplib.file')
TOCCSID(*CALC)
REPLACE(*YES)


On 6/5/2015 11:48 AM, Scott Klement wrote:
Tim,

Are you sure that it's valid to copy data into a save file (savf)
using the 'cp' command?

I know that under the covers if I were writing a program to write to a
save file, I'd have to use record-based I/O with a particular record
length or it would give me an error. The "cp" command is the Unix
copy, which normally would have no concept whatsoever of record-based
I/O, as Unix systems don't have record-based files.

This is all speculation, of course, I haven't looked into the
internals of the 'cp' command on IBM i... I'm just guessing that they
haven't added special code to account for save files.

Have you considered trying CPYTOSTMF/CPYFRMSTMF instead of 'cp'? That
might be an easy solution if I'm right...


On 6/5/2015 8:24 AM, tim wrote:
we have a backup process that copies data to QNTC as follows:

CHGVAR VAR(&TODIR) VALUE('/qntc/10.0.0.149/iseries/thu/ourlibrary'

CLRSAVF QGPL/FTPLIB

SAVLIB LIB(ourlibrary) DEV(*SAVF) SAVF(QGPL/FTPLIB) +
SAVACT(*SYSDFN) SAVACTWAIT(30 30 30) +
SAVACTMSGQ(QSYSOPR) ACCPTH(*YES) +
OMITOBJ((CSFH) (CF)) +
OUTPUT(*PRINT)

chgvar &c ('cp /qsys.lib/qgpl.lib/ftplib.file' *bcat &TODIR)
STRQSH CMD(&c)

now when i try to copy the data back i get following msg:

STRQSH CMD('cp /qntc/10.0.0.149/iseries/thu/ourlibrary
/qsys.lib/qgpl.lib/ftplib.file')

cp: 001-2104 Error found reading from file
/qntc/10.0.0.149/iseries/thu/ourlibrary.
The value specified for the argument is not correct.
Press ENTER to end terminal session.

any ideas?



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.