Selective record extraction/copy? - VMS

This is a discussion on Selective record extraction/copy? - VMS ; Hello everyone, how do I copy just some records from a non-indexed file to another one without having to resort to third party utilities like EXTRACT (1)? I just needed something like DUMP/BLOCKS or DUMP/RECORDS with binary output, but wasn't ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 34

Thread: Selective record extraction/copy?

  1. Selective record extraction/copy?

    Hello everyone,

    how do I copy just some records from a non-indexed file to another one without
    having to resort to third party utilities like EXTRACT (1)? I just needed
    something like DUMP/BLOCKS or DUMP/RECORDS with binary output, but wasn't able
    to find it among the standard system utilities. I also gave a quick check to
    CONVERT and SORT documentation, to no avail. I'm a hobbyist, so I'm not very
    used to RMS tools... Am I missing something obvious?

    Thanks,
    G.


    (1) http://mvb.saic.com/freeware/freewarev80/extract/

  2. Re: Selective record extraction/copy?

    gerry77@no.spam.mail.com wrote:
    > Hello everyone,
    >
    > how do I copy just some records from a non-indexed file to another one without
    > having to resort to third party utilities like EXTRACT (1)? I just needed
    > something like DUMP/BLOCKS or DUMP/RECORDS with binary output, but wasn't able
    > to find it among the standard system utilities. I also gave a quick check to
    > CONVERT and SORT documentation, to no avail. I'm a hobbyist, so I'm not very
    > used to RMS tools... Am I missing something obvious?
    >
    > Thanks,
    > G.
    >
    >
    > (1) http://mvb.saic.com/freeware/freewarev80/extract/


    If it's a line oriented text file, check
    "$SEARCH fil string /OUTPUT=xxx".

    Or simply OPEN it in a DCL command file and
    READ throught it...

  3. Re: Selective record extraction/copy?

    In article , =?ISO-8859-1?Q?Jan-Erik_S=F6derholm?= writes:
    >gerry77@no.spam.mail.com wrote:
    >> Hello everyone,
    >>
    >> how do I copy just some records from a non-indexed file to another one without
    >> having to resort to third party utilities like EXTRACT (1)? I just needed
    >> something like DUMP/BLOCKS or DUMP/RECORDS with binary output, but wasn't able
    >> to find it among the standard system utilities. I also gave a quick check to
    >> CONVERT and SORT documentation, to no avail. I'm a hobbyist, so I'm not very
    >> used to RMS tools... Am I missing something obvious?
    >>
    >> Thanks,
    >> G.


    If you know the line numbers, use EDT.

    $ EDIT/EDT INITIAL.FILE
    CTRL-Z
    Line: WRITE NEW.FILE beginning-line-number:end-line-number
    Line: QUIT
    $

    If you don't know the line numbers:

    $ EDIT/EDT INITIAL.FILE
    CTRL-Z
    Line: SET NUMBERS
    Line: TYPE 1:END

    Fine the appropriate line numbers and...

    Line: WRITE NEW.FILE beginning-line-number:end-line-number
    Line: QUIT
    $

    --
    VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM

    .... pejorative statements of opinion are entitled to constitutional protection
    no matter how extreme, vituperous, or vigorously expressed they may be. (NJSC)

    Copr. 2008 Brian Schenkenberger. Publication of _this_ usenet article outside
    of usenet _must_ include its contents in its entirety including this copyright
    notice, disclaimer and quotations.

  4. Re: Selective record extraction/copy?

    On Sat, 18 Oct 2008 23:01:48 GMT, Jan-Erik Söderholm
    wrote:

    > > how do I copy just some records from a non-indexed file to another one without
    > > having to resort to third party utilities like EXTRACT (1)? I just needed

    >
    > If it's a line oriented text file, check
    > "$SEARCH fil string /OUTPUT=xxx".
    >
    > Or simply OPEN it in a DCL command file and
    > READ throught it...


    I've forgot to write that I was playing with a binary file. BTW, using SEARCH
    implies that there is something like a "key" to distinguish records, instead I
    was trying to extract binary records just knowing which ones I needed. :-)

    Thanks,
    G.


  5. Re: Selective record extraction/copy?

    gerry77@no.spam.mail.com wrote:
    > Hello everyone,
    >
    > how do I copy just some records from a non-indexed file to another one without
    > having to resort to third party utilities like EXTRACT (1)? I just needed
    > something like DUMP/BLOCKS or DUMP/RECORDS with binary output, but wasn't able
    > to find it among the standard system utilities. I also gave a quick check to
    > CONVERT and SORT documentation, to no avail. I'm a hobbyist, so I'm not very
    > used to RMS tools... Am I missing something obvious?
    >
    > Thanks,
    > G.
    >
    >
    > (1) http://mvb.saic.com/freeware/freewarev80/extract/


    If the file is text, you could simply use an editor to delete the
    portions you don't want and save the result as a new file.

  6. Re: Selective record extraction/copy?

    On Oct 19, 8:16*am, gerr...@no.spam.mail.com wrote:
    > Hello everyone,
    >
    > how do I copy just some records from a non-indexed file to another one without
    > having to resort to third party utilities like EXTRACT (1)? I just needed
    > something like DUMP/BLOCKS or DUMP/RECORDS with binary output, but wasn'table
    > to find it among the standard system utilities. I also gave a quick checkto
    > CONVERT and SORT documentation, to no avail. I'm a hobbyist, so I'm not very
    > used to RMS tools... Am I missing something obvious?
    >
    > Thanks,
    > G.
    >
    > (1)http://mvb.saic.com/freeware/freewarev80/extract/


    sort with a specification file would be my preference
    Phil

  7. Re: Selective record extraction/copy?

    On Sun, 19 Oct 2008 03:42:51 -0700 (PDT), dooleys@snowy.net.au wrote:

    > > how do I copy just some records from a non-indexed file to another one without
    > > having to resort to third party utilities like EXTRACT (1)? I just needed

    >
    > sort with a specification file would be my preference


    May you give me some hints about the specification file syntax for this task?
    Let's suppose I've a 1000 records file without any obvious sort field, what I
    should do to extract something like records from the 450th up to the 550th?

    Thank you!
    G.


  8. Re: Selective record extraction/copy?

    On Oct 19, 8:44*am, gerr...@no.spam.mail.com wrote:
    > On Sun, 19 Oct 2008 03:42:51 -0700 (PDT), dool...@snowy.net.au wrote:
    > > > how do I copy just some records from a non-indexed file to another one without
    > > > having to resort to third party utilities like EXTRACT (1)? I just needed

    >
    > > sort with a specification file would be my preference

    >
    > May you give me some hints about the specification file syntax for this task?
    > Let's suppose I've a 1000 records file without any obvious sort field, what I
    > should do to extract something like records from the 450th up to the 550th?
    >
    > Thank you!
    > G.


    Okay -

    If you have a binary file format that contains records that no utility
    will understand, which is what you seem to be saying, then the answer
    is pretty obvious isn't it?

    Write a little C / COBOL / Pascal / Fortran / Basic program to read
    the file, select the records you want, and write the selected records
    out to a new file.

    This task should take, oh, about 15 minutes? Other folks have already
    presented very good suggestions if the file format is understandable
    by provided utilities, such as SORT.

    -Paul


  9. Re: Selective record extraction/copy?

    In article <795027af-f942-4c22-9258-70ce5b5de093@64g2000hsu.googlegroups.com>,
    PR wrote:
    >On Oct 19, 8:44*am, gerr...@no.spam.mail.com wrote:

    [...]
    >> May you give me some hints about the specification file syntax for this task?
    >> Let's suppose I've a 1000 records file without any obvious sort field, what I
    >> should do to extract something like records from the 450th up to the 550th?
    >>
    >> Thank you!
    >> G.

    >
    >Okay -
    >
    >If you have a binary file format that contains records that no utility
    >will understand, which is what you seem to be saying, then the answer
    >is pretty obvious isn't it?
    >
    >Write a little C / COBOL / Pascal / Fortran / Basic program to read
    >the file, select the records you want, and write the selected records
    >out to a new file.


    Or, if the OP is familiar, you can do the same thing in DCL.
    [...]

  10. Re: Selective record extraction/copy?

    gerry77@no.spam.mail.com wrote:
    > Hello everyone,
    >
    > how do I copy just some records from a non-indexed file to another one without
    > having to resort to third party utilities like EXTRACT (1)? I just needed
    > something like DUMP/BLOCKS or DUMP/RECORDS with binary output, but wasn't able
    > to find it among the standard system utilities. I also gave a quick check to
    > CONVERT and SORT documentation, to no avail. I'm a hobbyist, so I'm not very
    > used to RMS tools... Am I missing something obvious?


    I'll second VAXman's proposed solution (EDT), or TPU if the records are
    longer than 255 bytes.

    There's nothing intrinsically special about a "binary" file. It's just
    a bunch of records, for which any decent editor should have no trouble
    dealing with.

    For what it's worth, editing executable images is something I do quite
    frequently.

  11. Re: Selective record extraction/copy?

    On Sun, 19 Oct 2008 08:12:15 -0700 (PDT), PR wrote:

    > If you have a binary file format that contains records that no utility
    > will understand, which is what you seem to be saying, then the answer
    > is pretty obvious isn't it?
    >
    > Write a little C / COBOL / Pascal / Fortran / Basic program to read
    > the file, select the records you want, and write the selected records
    > out to a new file.


    I ended up using EXTRACT, which actually is a "little" Fortran program, and
    copied those records I needed to a new file. Since I used DUMP to see which
    records to copy, I was just wondering if there was a way to achieve what I
    needed using only provided utilities. As a matter of facts, if DUMP had a
    /BINARY qualifier to be used with /OUTPUT, I think it would have been enough,
    at least for my current needs. :-)

    > This task should take, oh, about 15 minutes? Other folks have already
    > presented very good suggestions if the file format is understandable
    > by provided utilities, such as SORT.


    I spent a lot more than 15 minutes debugging EXTRACT.EXE which had a problem
    when used with /BLOCKS (it exited with %RMS-F-UPI). But, since I'm a hobbyist,
    it was very well-spent time because I learnt something more about Fortran,
    about the VMS debugger (in screen mode), and about RMS FABs and their fields
    and values (FAB$B_FAC, FAB$B_SHR, and FAB$M_UPI). :-)

    All's well that ends well,
    G.


  12. Re: Selective record extraction/copy?

    On Oct 19, 12:15*pm, "R.A.Omond" wrote:
    > gerr...@no.spam.mail.com wrote:
    > > Hello everyone,

    >

    Gerry> > how do I copy just some records from a non-indexed file to
    another one without having to resort to third party utilities like
    EXTRACT (1)? I just needed something like DUMP/BLOCKS or DUMP/RECORDS
    with binary output,

    OpenVMS simply does not have that as a utility. Too bad.

    It's trivial to write, for example by adapting the copyfile example
    from the RMS ref manual:
    http://h71000.www7.hp.com/doc/731FIN...ofcopyingfiles
    (need to copy rac, rfm, mrs instead of hardcoding, need to control
    record numbers to be written).

    A DCL loop is really the best OpenVMS natively can do for you.


    Roy> There's nothing intrinsically special about a "binary" file.
    *It's just
    > a bunch of records, for which any decent editor should have no trouble
    > dealing with.


    Fully agree. Yet there is NO editor that can edit for example an image
    shipped with OpenVMS. :-(. Lame.

    EDT can not handle record length > 255
    TPU insists on "%TPU-E-FILECONVERTED, file format is being converted
    to a supported type". Since when are fixed length records no
    supported?!

    > For what it's worth, editing executable images is something I do quite
    > frequently.


    Super. Me too. But I just change values with tools like PATCH/ABS.

    Please explain which standard OpenVMS tools allow one to select
    records by number from a binary file? (other than dump).

    AWK & PERL (even with binmode) make a mess out of this as well.

    Hate to admit it, but this is a weak area in OpenVMS.
    Cheers,
    Hein.

  13. Re: Selective record extraction/copy?

    On Oct 20, 4:09*am, Hein RMS van den Heuvel
    wrote:
    > On Oct 19, 12:15*pm, "R.A.Omond" wrote:> gerr...@no.spam.mail.com wrote:
    > > > Hello everyone,

    >
    > Gerry> > how do I copy just some records from a non-indexed file to
    > another one without having to resort to third party utilities like
    > EXTRACT (1)? I just needed something like DUMP/BLOCKS or DUMP/RECORDS
    > with binary output,
    >
    > OpenVMS simply does not have that as a utility. Too bad.
    >
    > It's trivial to write, for example by adapting the copyfile example
    > from the RMS ref manual:http://h71000.www7.hp.com/doc/731FIN....html#75_hll_e...
    > (need to copy rac, rfm, mrs instead of hardcoding, need to control
    > record numbers to be written).
    >
    > A DCL loop is really the best OpenVMS natively can do for you.
    >
    > Roy> There's nothing intrinsically special about a "binary" file.
    > *It's just
    >
    > > a bunch of records, for which any decent editor should have no trouble
    > > dealing with.

    >
    > Fully agree. Yet there is NO editor that can edit for example an image
    > shipped with OpenVMS. :-(. Lame.
    >
    > EDT can not handle record length > 255
    > TPU insists on "%TPU-E-FILECONVERTED, file format is being converted
    > to a supported type". Since when are fixed length records no
    > supported?!
    >
    > > For what it's worth, editing executable images is something I do quite
    > > frequently.

    >
    > Super. Me too. But I just change values with tools like PATCH/ABS.
    >
    > Please explain which standard OpenVMS tools allow one to select
    > records by number from a binary file? (other than dump).
    >
    > AWK & PERL (even with binmode) make a mess out of this as well.
    >
    > Hate to admit it, but this is a weak area in OpenVMS.
    > Cheers,
    > Hein.



    See also DIX http://oooovms.dyndns.org/dix/

  14. Re: Selective record extraction/copy?

    In article , gerry77@no.spam.mail.com writes:
    > Hello everyone,
    >
    > how do I copy just some records


    Copy "some" records generally means writing a program that knows
    which "some" you want.


  15. Re: Selective record extraction/copy?

    I would also go with write a bit of code. A good excuse to learn how well
    the high level languages support RMS withut even having to use the RMS$
    library stuff.

    From memory, I would have said the Basic+ stuff was easiest to use. (Bearing
    in mind it was what all our junior programmers used on VAX).



  16. Re: Selective record extraction/copy?

    On Mon, 20 Oct 2008 06:47:36 -0700, Tim Wilkinson .twsoft.co.uk> <"
    wrote:

    > I would also go with write a bit of code. A good excuse to learn how well
    > the high level languages support RMS withut even having to use the RMS$
    > library stuff.
    >
    > From memory, I would have said the Basic+ stuff was easiest to use.
    > (Bearing
    > in mind it was what all our junior programmers used on VAX).
    >
    >


    PL/I has the richest support at the semantic level of the language.


    --
    PL/I for OpenVMS
    www.kednos.com

  17. Re: Selective record extraction/copy?

    Bob Koehler wrote:
    > In article , gerry77@no.spam.mail.com writes:
    >> Hello everyone,
    >>
    >> how do I copy just some records

    >
    > Copy "some" records generally means writing a program that knows
    > which "some" you want.
    >


    I will write such a program for an only moderately outrageous fee! Or,
    if you will send me the file, I will extract the required records for a
    similarly outrageous fee.

  18. Re: Selective record extraction/copy?

    On Oct 18, 5:16*pm, gerr...@no.spam.mail.com wrote:
    > Hello everyone,
    >
    > how do I copy just some records from a non-indexed file to another one without
    > having to resort to third party utilities like EXTRACT (1)? I just needed
    > something like DUMP/BLOCKS or DUMP/RECORDS with binary output, but wasn'table
    > to find it among the standard system utilities. I also gave a quick checkto
    > CONVERT and SORT documentation, to no avail. I'm a hobbyist, so I'm not very
    > used to RMS tools... Am I missing something obvious?
    >
    > Thanks,
    > G.
    >
    > (1)http://mvb.saic.com/freeware/freewarev80/extract/


    If you obtain a copy of "The Minimum You Need to Know to Be an OpenVMS
    Application Developer" it shows you how to use a SORT SPECIFICATION
    file to do just what you want.

  19. Re: Selective record extraction/copy?

    yyyc186 wrote:
    >
    > On Oct 18, 5:16 pm, gerr...@no.spam.mail.com wrote:
    > > Hello everyone,
    > >
    > > how do I copy just some records from a non-indexed file to another one without
    > > having to resort to third party utilities like EXTRACT (1)? I just needed
    > > something like DUMP/BLOCKS or DUMP/RECORDS with binary output, but wasn't able
    > > to find it among the standard system utilities. I also gave a quick check to
    > > CONVERT and SORT documentation, to no avail. I'm a hobbyist, so I'm not very
    > > used to RMS tools... Am I missing something obvious?
    > >
    > > Thanks,
    > > G.
    > >
    > > (1)http://mvb.saic.com/freeware/freewarev80/extract/

    >
    > If you obtain a copy of "The Minimum You Need to Know to Be an OpenVMS
    > Application Developer" it shows you how to use a SORT SPECIFICATION
    > file to do just what you want.


    I'd often thought that SORT SPECIFICATION files would hav been VMS's
    answer to many UN*X complaints about the environment, if only it had
    been more effectively documented. I messed with those for more than 15
    years before I got to one that actually did something useful, and that
    was from clues I found here in c.o.v.!

    D.J.D.

  20. Re: Selective record extraction/copy?

    David J Dachtera wrote:
    > yyyc186 wrote:
    >> On Oct 18, 5:16 pm, gerr...@no.spam.mail.com wrote:
    >>> Hello everyone,
    >>>
    >>> how do I copy just some records from a non-indexed file to another one without
    >>> having to resort to third party utilities like EXTRACT (1)? I just needed
    >>> something like DUMP/BLOCKS or DUMP/RECORDS with binary output, but wasn't able
    >>> to find it among the standard system utilities. I also gave a quick check to
    >>> CONVERT and SORT documentation, to no avail. I'm a hobbyist, so I'm not very
    >>> used to RMS tools... Am I missing something obvious?
    >>>
    >>> Thanks,
    >>> G.
    >>>
    >>> (1)http://mvb.saic.com/freeware/freewarev80/extract/

    >> If you obtain a copy of "The Minimum You Need to Know to Be an OpenVMS
    >> Application Developer" it shows you how to use a SORT SPECIFICATION
    >> file to do just what you want.

    >
    > I'd often thought that SORT SPECIFICATION files would hav been VMS's
    > answer to many UN*X complaints about the environment, if only it had
    > been more effectively documented. I messed with those for more than 15
    > years before I got to one that actually did something useful, and that
    > was from clues I found here in c.o.v.!
    >
    > D.J.D.


    ISTR doing it successfully many years ago but it is not and was not
    something I do with any frequency. I think I just found the right pages
    in the manual, did what they said and it just worked!

+ Reply to Thread
Page 1 of 2 1 2 LastLast