You can use
CPYF filea TOFILE(*PRINT)
and this will create a spool file

>>> "Peter Dow" <pcdow@yahoo.com> 12/18/01 02:45PM >>>
Hi Tom,

Yes, I'm looking for the equivalent of

    CPYF filea QSYSPRT

copying a physical file to a printer file to create a spool file.

Not being a Unix person I tend to forget about QShell, but I think that will
do for now. Can I direct the output to a particular queue using pr?

Regarding user spaces, I don't know of any OS400 command that would print a
user space, so I'd end up having to write something there as well. If I do
write something, it might as well just read the IFS directly and write to a
printer file.

Thanks for the tips.

Peter Dow
Dow Software Services, Inc.
909 425-0194 voice
909 425-0196 fax


----- Original Message -----
From: <thomas@inorbit.com>
Sent: Monday, December 17, 2001 7:43 PM
Subject: Re: Printing from the IFS


Peter:

On Sun, 16 December 2001, "Peter Dow" wrote:

> I'm looking for a way to copy an IFS stream file to an AS400 spool file,

I'd guess this is the basic problem; that is, what you want to do isn't what
your command is written to do.

> something like:
>
>  CPY        OBJ('/home/test/textfile.txt') +
>               TOOBJ('/QSYS.LIB/QGPL.LIB/PRINTER.FILE')

Though you want to copy to a "spool file", the command tries to copy to a
printer file -- not the same thing at all, eh? (I'm assuming PRINTER.FILE is
a PRTF kind of file.)

Naturally, the PRTF exists; and hence, the CPY fails as it always will when
TOOBJ() exists:

> This fails with CPFA0A0 "Object already exists".

I'm not sure if any 'standard' command will be useful for this; I'd like to
know if any work. I'd start with QShell utilities for quick stuff, likely
with pr. Then I'd create my own procedure in order not to require QShell.

Note that a streamfile can be CPY'd directly to a new *usrspc object, i.e.,
with extension .USRSPC, if the *usrspc doesn't exist. Unfortunately, due to
the way audit bits are handled, you'll probably need *AUDIT special
authority. (The reverse doesn't seem to be true.) This might be useful for
an intermediate solution if you don't have immediate time for a true
solution.



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 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.