This might have been mentioned, but using our free "Dataset Pipes"
tool, this is pretty easy if your file is text, since "tail" would
work:
// EXEC DTLSPAWN
//LOG DD DISP=OLD,DSN=...
//STDIN DD *
fromdsn //DD:LOG \
| tail -2000 \
| todsn //DD:LOG
//
If the dataset has fixed length, binary records (say length=100), then
you can do this:
// EXEC DTLSPAWN
//LOG DD DISP=OLD,DSN=...
//STDIN DD *
fromdsn -b //DD:LOG \
| tail -c -200000 \
| todsn -b //DD:LOG
//
But, if the data is variable AND binary, then you can't use newlines
to terminate the stream (the default for fromdsn and todsn).
You could write a program like "tail" that uses ibm rdws as record prefixes.
The program would read all of the records from stdin into a
wrap-around table of the limiting size and then write the table
out to stdout. Then you could have this:
// EXEC DTLSPAWN
//LOG DD DISP=OLD,DSN=...
//STDIN DD *
fromdsn -l ibmrdw //DD:LOG \
| rdw-tail -2000 \
| todsn -l ibmrdw //DD:LOG
//
(Of course, if you are going to write a program like this, you could
have it just update the dataset rather than piping).
On Jan 29, 2008 10:13 AM, Van Dalsen, Herbie
<[EMAIL PROTECTED]> wrote:
> Thanks.
>
>
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
> Behalf Of Mark Zelden
>
> Sent: 29 Januarie 2008 03:56 nm
> To: [email protected]
> Subject: Re: Keep only the tail of the dataset
>
> On Tue, 29 Jan 2008 15:49:54 -0000, Van Dalsen, Herbie
> <[EMAIL PROTECTED]> wrote:
>
> >Sorry, I am still on z/OS 1.6...
>
> If you have the PTF for OA11699 (UA23196) then you can direct STDOUT to
> SYSOUT or a MVS data set. It's "old" at this point... it has been
> available
> since December 2005.
>
> Mark
> --
> Mark Zelden
> Sr. Software and Systems Architect - z/OS Team Lead
> Zurich North America / Farmers Insurance Group - ZFUS G-ITO
> mailto:[EMAIL PROTECTED]
> z/OS Systems Programming expert at
> http://expertanswercenter.techtarget.com/
> Mark's MVS Utilities: http://home.flash.net/~mzelden/mvsutil.html
>
>
>
>
> >
> >
> >-----Original Message-----
> >From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
> >Behalf Of Mark Zelden
> >Sent: 29 Januarie 2008 02:48 nm
> >To: [email protected]
> >Subject: Re: Keep only the tail of the dataset
> >
> >On Mon, 28 Jan 2008 17:04:26 -0600, Luis Miguel Martinez
> ><[EMAIL PROTECTED]> wrote:
> >
> >>Have you tried with the USS command:
> >>
> >> tail -n "//'my.dataset.to.read'"
> >>
> >> where n would be the number of lines
> >>
> >> Please let me know if you could do it.
> >>
> >
> >That should work. But why -n without a value? It would be
> >tail -n nnn "//'my.dataset.to.read'" where nnn is the number of
> >lines wouldn't it? With BPXBATCH and z/OS 1.8 (or 1.5-1.7 with
> >the proper maintenance) STDOUT can point to a MVS data set.
> >
> >Mark
> >--
> >Mark Zelden
> >Sr. Software and Systems Architect - z/OS Team Lead
> >Zurich North America / Farmers Insurance Group - ZFUS G-ITO
> >mailto:[EMAIL PROTECTED]
> >z/OS Systems Programming expert at
> >http://expertanswercenter.techtarget.com/
> >Mark's MVS Utilities: http://home.flash.net/~mzelden/mvsutil.html
> >
> >----------------------------------------------------------------------
> >For IBM-MAIN subscribe / signoff / archive access instructions,
> >send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
> >Search the archives at http://bama.ua.edu/archives/ibm-main.html
> >Elavon Financial Services Limited
> >Registered in Ireland: Number 418442
> >Registered Office: Block E, 1st Floor, Cherrywood Business Park,
> Loughlinstown, Co. Dublin, Ireland
> >Directors: Robert Abele (USA), John Collins, Terrance Dolan (USA),
> Pamela
> Joseph (USA), Declan Lynch, John McNally, Malcolm Towlson
> >Elavon Financial Services Limited, trading as Elavon, is regulated by
> the
> Financial Regulator
> >
> >----------------------------------------------------------------------
> >For IBM-MAIN subscribe / signoff / archive access instructions,
> >send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
> >Search the archives at http://bama.ua.edu/archives/ibm-main.html
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
> Search the archives at http://bama.ua.edu/archives/ibm-main.html
> Elavon Financial Services Limited
> Registered in Ireland: Number 418442
> Registered Office: Block E, 1st Floor, Cherrywood Business Park,
> Loughlinstown, Co. Dublin, Ireland
> Directors: Robert Abele (USA), John Collins, Terrance Dolan (USA), Pamela
> Joseph (USA), Declan Lynch, John McNally, Malcolm Towlson
> Elavon Financial Services Limited, trading as Elavon, is regulated by the
> Financial Regulator
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
> Search the archives at http://bama.ua.edu/archives/ibm-main.html
>
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html