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



Tom, you mentioned QShell, so I went looking. The tail utility might do it.

tail -c +201 /qsys.lib/yourlib.lib/yourusrspc.usrspc > /qsys.lib/outflib.lib/outfile.file/outmbr.mbr

would, I think, redirect the contents of the user space, starting with character 201, to member outmbr in file outflib/outfile.

If that works, OY OY OY!

The number to start with would be the first byte after the list header - or would you need to retrieve it from that header?

I wonder if a combination of head & tail would be useful - not here, but at all?

Maybe?
Vern

At 06:44 PM 8/3/2005, you wrote:

midrange-l-request@xxxxxxxxxxxx wrote:

>   4. wrkobjlck to physical file (Dwayne Allison)
>
>Is it possible to do a work object lock and send the results to a physical file?

Dwayne:

It's not directly possible, AFAIK. However, there are a few techniques that can make it "easier".

To start, the List Object Locks (QWCLOBJL) API will provide the list in a user space. Not quite a 'file' but having some attributes that can cut a step or two out. For example, a *USRSPC object can be used as the source object for commands such as CPY, CPYFRMSTMF, CPYFRMIMPF, etc., just as if it were a streamfile object. If the copy started at the first byte of the list in the space and the physical file had a record length equal to the length of a list entry, you'd practically have your result.

Unfortunately, I don't have a way off the top of my head for truncating the first couple hundred bytes off of a streamfile through any simple means other than just opening it with Notepad and deleting those positions. Perhaps a QShell utility has the ability?

However, there is a way of getting it done in CL, and in HLLs such as RPG.

In CL, you can retrieve the offset to the list in the *usrspc and then read the list entries in a simple loop. (In ILE RPG, you'd be better off getting a pointer and then retrieving list entries.) Each list entry can be placed in the input buffer for the Sort (QLGSORT) API and that API can output the entries as records in your PF. (In ILE RPG, you'd simply use the address of the beginning of the list for the input buffer and tell Sort how big the list was. For that, it isn't even necessary to retrieve the entries; just call the Sort API with the proper address.) When the Sort API completes, your PF will have the records.

Technically, this can be done in 'not very many' CL commands. An ILE RPG program wouldn't be much different in size/complexity.

I'd post a source example, but only have time to mention the possibility. Perhaps during the next day or so...?

Tom Liotta

--
Tom Liotta
The PowerTech Group, Inc.
19426 68th Avenue South
Kent, WA 98032
Phone  253-872-7788 x313
Fax    253-872-7904
http://www.powertech.com


__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
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 ...

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.