Hi, I have to get a spool file of size > 16MB into User space. Iam using the API QSPGETSP to get the spool file into the User space. But Iam getting the error message CPF3CAA. So please explain the logic to split the spool file using the Buffer and getting it into multiple User spaces. RPGLE or CLLE program will do. My machine is V5R2.
Announcement
Collapse
No announcement yet.
User space to get spool file
Collapse
X
-
Re: User space to get spool file
I have never tried this..........but if you do get it figured out please share ...All my answers were extracted from the "Big Dummy's Guide to the As400"
and I take no responsibility for any of them.
www.code400.com
-
Re: User space to get spool file
In the QSPGETSP API, formats SPFR0100 & SPFR0200, have the offset to the first buffer as well as the total no. buffers.
You can then do some calculations (because you will need more than 1 output USRSPC) and request x amount of buffers to be returned and output.
Hope this helps.Regards
Kit
http://www.ecofitonline.com
DeskfIT - ChangefIT - XrefIT
___________________________________
There are only 3 kinds of people -
Those that can count and those that can't.
Comment
-
Re: User space to get spool file
Hi kitvb1, exactly I worked similarly..... It worked correctly for getting into the User space....... but the problem is I have to duplicate it to some other Outq (It is a *AFPDS spool) ......... while putting the spool back to AS400 from the user space.... it gives error saying " The User space header information changed". Please help to rectify this error.
Comment
-
Re: User space to get spool file
i haven't done that much with the spooled file APIs but from the message you're getting i'd try to check the user space header again. sounds like it's being updated by your process and the offsets have likely changed.I'm not anti-social, I just don't like people -Tommy Holden
Comment
-
Re: User space to get spool file
I would imagine that the header field names for the input and output usrspc's are the same. You may have to define them differently.
Are you using this as a base http://www.code400.com/cpyfrmsplf.php
or are you writing the program from new?Regards
Kit
http://www.ecofitonline.com
DeskfIT - ChangefIT - XrefIT
___________________________________
There are only 3 kinds of people -
Those that can count and those that can't.
Comment
-
Re: User space to get spool file
Hi Kitvb1, The reference program mentioned by you is my existing program in the system. Now, I have to change it to handle the spool file of size more than 16MB. Currently Iam able to get the spool file into user space in the form of small buffers (instead of using -1). But while using QSPPUTSP Iam getting error message CPF33F6 ("Value in generic header of user space is not valid").
Comment
-
Re: User space to get spool file
Debug it and check which field is invalid, maybe one that that you are not populating?
Remember that this API has has changed slightly (record length) from v520 to v530 to v540.Regards
Kit
http://www.ecofitonline.com
DeskfIT - ChangefIT - XrefIT
___________________________________
There are only 3 kinds of people -
Those that can count and those that can't.
Comment
-
Re: User space to get spool file
Hi kitvb1, I have tried it another way. Iam getting one by one buffer and then putting immediately, instead of waiting for all the buffers to get retrieved. This method worked.
The basic problem iam getting is the user space is getting replaced after I retrieve each buffer using QSPGETSP? Can we really place multiple buffers on a single User space?
Comment
-
Re: User space to get spool file
This is waht I was saying in post nr 4.
Think of the usrspc as a file, 1 list = 1 buffer = 1 page = 1 record (lovely saying in german "Es ist Wurst")
Now treat it just like a file.. read in (in this case by buffer) and output (in this case by buffer to a different usrspc/spoolfile/outq... whatever is easiest)Regards
Kit
http://www.ecofitonline.com
DeskfIT - ChangefIT - XrefIT
___________________________________
There are only 3 kinds of people -
Those that can count and those that can't.
Comment
Comment