Selective record extraction/copy? - VMS

This is a discussion on Selective record extraction/copy? - VMS ; On Oct 20, 1:17*pm, yyyc186 wrote: > On Oct 18, 5:16*pm, gerr...@no.spam.mail.com wrote: > > > 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. ...

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 21 to 34 of 34

Thread: Selective record extraction/copy?

  1. Re: Selective record extraction/copy?

    On Oct 20, 1:17*pm, yyyc186 wrote:
    > On Oct 18, 5:16*pm, gerr...@no.spam.mail.com wrote:
    >
    > > 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

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


    Roland, Please help me understand how to instruct sort to use a start/
    end or start/count selection as per DUMP 'just as he wanted it'.
    The Sort Spec (in the Cobol chapter!) of the book shows the normal
    selection by field contents. I do not believe there to be a psuedo-
    field representing the record number.

    - extract, and dix are good suggestions for freeware.
    - EHG select (out friend John Santos), a good commercial product.
    - a home grown program in C or Macro or whatever should be just just a
    few dozen lines an less than an hour.. if you have an example.

    Cheers,
    Hein.

  2. Re: Selective record extraction/copy?

    On Oct 22, 1:20*pm, Hein RMS van den Heuvel
    wrote:
    > On Oct 20, 1:17*pm, yyyc186 wrote:
    >
    > > On Oct 18, 5:16*pm, gerr...@no.spam.mail.com wrote:

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

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

    >
    > Roland, Please help me understand how to instruct sort to use a start/
    > end or start/count selection as per DUMP 'just as he wanted it'.
    > The Sort Spec (in the Cobol chapter!) of the book shows the normal
    > selection by field contents. I do not believe there to be a psuedo-
    > field representing the record number.
    >
    > - extract, and dix are good suggestions for freeware.
    > - EHG select (out friend John Santos), a good commercial product.
    > - a home grown program in C or Macro or whatever should be just just a
    > few dozen lines an less than an hour.. if you have an example.
    >
    > Cheers,
    > Hein.

    The original post asked for "selective record extraction"
    and I assumed that the selection would be based on
    the content not the record number.
    EVE would have worked fine.
    Maybe we should ask for a vms enhancement like
    $ sort /record=(start,count)
    Phil

  3. Re: Selective record extraction/copy?

    On Wed, 22 Oct 2008 03:03:40 -0700 (PDT), dooleys@snowy.net.au wrote:

    > Maybe we should ask for a vms enhancement like
    > $ sort /record=(start,count)


    I'm undecided about wether would be better SORT or COPY with a /RECORDS qualifier
    or maybe, even easier, about a /BINARY qualifier for DUMP (which actually already
    has both suitable /RECORDS and /BLOCKS qualifiers) to be used with /OUTPUT...

    G.

  4. Re: Selective record extraction/copy?

    On Oct 21, 11:20*pm, Hein RMS van den Heuvel
    wrote:
    >...
    > Roland, Please help me understand how to instruct sort to use a start/
    > end or start/count selection as per DUMP 'just as he wanted it'.
    > The Sort Spec (in the Cobol chapter!) of the book shows the normal
    > selection by field contents. I do not believe there to be a psuedo-
    > field representing the record number.
    >
    > - extract, and dix are good suggestions for freeware.
    > - EHG select (out friend John Santos), a good commercial product.
    > - a home grown program in C or Macro or whatever should be just just a
    > few dozen lines an less than an hour.. if you have an example.
    >...


    DIX is a really good program and I wish I had more time to play around
    with it, combining DIX with Flex could create a really interesting
    tool. But getting back to the user's problem and using SORT; The only
    way I could see solving the problem with SORT is

    $ type get_record_by_number.com
    $!
    $ search 'p1 "" /numbers/out=sys$scratch:search_temp_'f
    $getjpi("","PID")'.tmp
    $ lrl = 'f$file(p1,"LRL")
    $!
    $ if lrl .eq. 0 then lrl = 512
    $!
    $ quote[0,8]=34
    $!
    $ open/write tmpfile sys$scratch:search_temp_'f$getjpi("","PID")'.SRT
    $
    $ write tmpfile "/field=(name=number,position:1,size:7)"
    $ write tmpfile "/field=(name=RestOfLine,position:8,size:''lrl')"
    $ if p2 .gt. 0 then write tmpfile -
    f$fao("/condition=(name=HaveMatch2,test=(number eq !AS!6UL!_!
    AS))",quote,f$integer(p2),quote)
    $ if p3 .gt. 0 then write tmpfile -
    f$fao("/condition=(name=HaveMatch3,test=(number eq !AS!6UL!_!
    AS))",quote,f$integer(p3),quote)
    $ if p4 .gt. 0 then write tmpfile -
    f$fao("/condition=(name=HaveMatch4,test=(number eq !AS!6UL!_!
    AS))",quote,f$integer(p4),quote)
    $ if p5 .gt. 0 then write tmpfile -
    f$fao("/condition=(name=HaveMatch5,test=(number eq !AS!6UL!_!
    AS))",quote,f$integer(p5),quote)
    $ if p6 .gt. 0 then write tmpfile -
    f$fao("/condition=(name=HaveMatch6,test=(number eq !AS!6UL!_!
    AS))",quote,f$integer(p6),quote)
    $ if p7 .gt. 0 then write tmpfile -
    f$fao("/condition=(name=HaveMatch7,test=(number eq !AS!6UL!_!
    AS))",quote,f$integer(p7),quote)
    $ if p8 .gt. 0 then write tmpfile -
    f$fao("/condition=(name=HaveMatch8,test=(number eq !AS!6UL!_!
    AS))",quote,f$integer(p8),quote)
    $!
    $ if p2 .gt. 0 then write tmpfile -
    "/include=(key=number,condition=HaveMatch2,data=Rest ofLine)"
    $ if p3 .gt. 0 then write tmpfile -
    "/include=(key=number,condition=HaveMatch3,data=Rest ofLine)"
    $ if p4 .gt. 0 then write tmpfile -
    "/include=(key=number,condition=HaveMatch4,data=Rest ofLine)"
    $ if p5 .gt. 0 then write tmpfile -
    "/include=(key=number,condition=HaveMatch5,data=Rest ofLine)"
    $ if p6 .gt. 0 then write tmpfile -
    "/include=(key=number,condition=HaveMatch6,data=Rest ofLine)"
    $ if p7 .gt. 0 then write tmpfile -
    "/include=(key=number,condition=HaveMatch7,data=Rest ofLine)"
    $ if p8 .gt. 0 then write tmpfile -
    "/include=(key=number,condition=HaveMatch8,data=Rest ofLine)"
    $!
    $ close tmpfile
    $!
    $ sort sys$scratch:search_temp_'f$getjpi("","PID")'.tmp -
    /specification=sys$scratch:search_temp_'f$getjpi("","PID")'.SRT
    tt:
    $!
    $ delete/nolog/noconfirm sys$scratch:search_temp_'f
    $getjpi("","PID")'.tmp;*
    $ delete/nolog/noconfirm sys$scratch:search_temp_'f
    $getjpi("","PID")'.SRT;*
    $!
    $ @get_record_by_number login.com 2 5 24 25 26 27

    Note: There are probably 1000 ways to break this code and it may not
    work 100% of the time, but it was just a quick hack to see if it would
    work.

    Peter Weaver
    www.weaverconsulting.ca www.openvmsvirtualization.com
    www.vaxvirtualization.com www.alphavirtualization.com
    Winner of the 2007 OpenVMS.org Readers' Choice Award for System
    Management/Performance


  5. Re: Selective record extraction/copy?

    Hein RMS van den Heuvel wrote:
    > On Oct 20, 1:17 pm, yyyc186 wrote:
    >
    >>On Oct 18, 5:16 pm, gerr...@no.spam.mail.com wrote:
    >>
    >>
    >>>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

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

    >
    >
    > Roland, Please help me understand how to instruct sort to use a start/
    > end or start/count selection as per DUMP 'just as he wanted it'.
    > The Sort Spec (in the Cobol chapter!) of the book shows the normal
    > selection by field contents. I do not believe there to be a psuedo-
    > field representing the record number.
    >
    > - extract, and dix are good suggestions for freeware.
    > - EHG select (out friend John Santos), a good commercial product.


    Thank you, Hein, but it's EGH, not EHG! :-)

    First rule of publicity: They can say anything they want, as long
    as they spell your name right. :-)

    > - a home grown program in C or Macro or whatever should be just just a
    > few dozen lines an less than an hour.. if you have an example.
    >
    > Cheers,
    > Hein.



    --
    John Santos
    Evans Griffiths & Hart, Inc.
    781-861-0670 ext 539

  6. Re: Selective record extraction/copy?

    > Roland, Please help me understand how to instruct sort to use a start/
    > end or start/count selection as per DUMP 'just as he wanted it'.
    > The Sort Spec (in the Cobol chapter!) of the book shows the normal
    > selection by field contents. I do not believe there to be a psuedo-
    > field representing the record number.
    >


    You can declare a field as a constant, but at the time I wrote the
    previous response I was unaware of what the real requirements were:
    Extract just some records out of the middle without a key, knowing
    where to start and stop.

    First off, nobody would create a data file like this. Anybody who had
    ever worked on a real computer system would have put a key on that
    thing, even if it was nothing more than a record number.

    The cheap hack would be to open the file with DCL and enter a WHILE
    loop counting the record number. Only write to the output file if the
    record number is inbetween your starting and ending record. Look in
    the application book at the DCL import program for how to open and
    read until end of file. It will also show you how to do output. I
    assume one can figure out how to count from that example as well.

    In the future, when creating data files which aren't indexed...let me
    guess, this came from Unix? Make the first field in the record a
    record number. Then you can use a specification file.

    Roland

  7. Re: Selective record extraction/copy?

    yyyc186 wrote:
    > [snip]
    > The cheap hack would be to open the file with DCL and enter a WHILE
    > loop counting the record number.


    AFAIK, DCL does not support any structured programming constructs, only
    labels and GOTOs.

    My DCL experience tends to end circa. V8.2, however (V7.3-2 with some
    V8.2 extensions).

    D.J.D.

  8. Re: Selective record extraction/copy?

    David J Dachtera wrote:
    >
    > yyyc186 wrote:
    > > [snip]
    > > The cheap hack would be to open the file with DCL and enter a WHILE
    > > loop counting the record number.

    >
    > AFAIK, DCL does not support any structured programming constructs, only
    > labels and GOTOs.
    >
    > My DCL experience tends to end circa. V8.2, however (V7.3-2 with some
    > V8.2 extensions).


    Just verified that on td183.testdrive.hp.com (V8.3). No mention of WHILE
    in the DCL HELP.

    D.J.D.

  9. Re: Selective record extraction/copy?

    On Oct 22, 10:20*pm, David J Dachtera
    wrote:
    > AFAIK, DCL does not support any structured programming constructs, only
    > labels and GOTOs.


    Boy, this'll take us off topic.

    Structured programming doesn't require WHILE, and doesn't forbid the
    use of GOTO. At its roots, it just says that any programming solution
    can be expressed using three constructs: sequential blocks of code,
    conditional execution, and looping.

    All three of those constructs can be implemented in DCL. Granted, it
    doesn't have many of the higher level statements that make it easier
    to see the structure, but it can all be done.

    For example, the construct

    WHILE (condition)
    ..
    ..
    ..
    NEXT

    can be expressed in DCL as

    looptop:
    IF (.not. condition) THEN GOTO loopend
    ..
    ..
    ..
    GOTO looptop

    loopend:
    ..

    The SELECT (or CASE) statement is a shortcut for multiple IFs or IF/
    ELSEIFs. And so on. You can express all of these so-called
    structured constructs using just labels and GOTOs, and IFs.

    So, go out there and start writing structured DCL. It can be done.

  10. Re: Selective record extraction/copy?

    David J Dachtera wrote:
    > yyyc186 wrote:
    >> [snip]
    >> The cheap hack would be to open the file with DCL and enter a WHILE
    >> loop counting the record number.

    >
    > AFAIK, DCL does not support any structured programming constructs, only
    > labels and GOTOs.
    >
    > My DCL experience tends to end circa. V8.2, however (V7.3-2 with some
    > V8.2 extensions).
    >
    > D.J.D.


    IF something THEN
    mumble
    ELSE
    fakeit
    ENDIF

    DEC/COMPAQ/HP never said DCL was a programming language or claimed that
    it was structured.

    It is still possible to write structured code in the absence of some of
    the language constructs that tend to enforce structure. It is also
    possible to write spaghetti code using structured constructs; you just
    have to work harder at it.

    The structure, or lack thereof, arises from the design process rather
    than from the language used!

    Do you want to try to write structured code in sh, bash, ksh, csh, tcsh,
    zsh, etc, etc? You just have to work a little harder at it.


  11. Re: Selective record extraction/copy?

    FrankS wrote:
    > On Oct 22, 10:20 pm, David J Dachtera
    > wrote:
    >> AFAIK, DCL does not support any structured programming constructs, only
    >> labels and GOTOs.

    >
    > Boy, this'll take us off topic.
    >
    > Structured programming doesn't require WHILE, and doesn't forbid the
    > use of GOTO. At its roots, it just says that any programming solution
    > can be expressed using three constructs: sequential blocks of code,
    > conditional execution, and looping.
    >
    > All three of those constructs can be implemented in DCL. Granted, it
    > doesn't have many of the higher level statements that make it easier
    > to see the structure, but it can all be done.
    >
    > For example, the construct
    >
    > WHILE (condition)
    > .
    > .
    > .
    > NEXT
    >
    > can be expressed in DCL as
    >
    > looptop:
    > IF (.not. condition) THEN GOTO loopend
    > .
    > .
    > .
    > GOTO looptop
    >
    > loopend:
    > .
    >
    > The SELECT (or CASE) statement is a shortcut for multiple IFs or IF/
    > ELSEIFs. And so on. You can express all of these so-called
    > structured constructs using just labels and GOTOs, and IFs.
    >
    > So, go out there and start writing structured DCL. It can be done.


    Well said!!

  12. Re: Selective record extraction/copy?

    FrankS wrote:
    > [snip]
    > The SELECT (or CASE) statement is a shortcut for multiple IFs or IF/
    > ELSEIFs. And so on. You can express all of these so-called
    > structured constructs using just labels and GOTOs, and IFs.
    >
    > So, go out there and start writing structured DCL. It can be done.


    I've been doing just that for years, and even taught it in he hands-on
    DCL Programming Lab I used to give at DECUS, et al.

    Now, I'm learning ksh93...

    D.J.D.

  13. Re: Selective record extraction/copy?

    David J Dachtera wrote:

    > Now, I'm learning ksh93...


    Which reminds me. Yesterday, while looking at the library setup in front
    of the supermarket checkout aisle, I noticed a cover page title which
    surprised me.

    It seems that Brad Pitt no longer wants to mary Angelina Jolie because
    she has allegedly had a love affair with someone else.

    I tried $HELP BRAD_PITT but VMS 8.3 doesn't yet have any information
    about this.

    I was under the impression that the two had married some time ago ? Or
    are they just together with all sorts of adopted kids ?

    It goes to show, when one is too focused on VMS, one looses focus on the
    truly important issues of this world :-) :-) :-) :-)

    Hopefully, next week, they will reveal that Jolie's love interest is non
    other than Jennifer Aniston. This would complete the story about that
    love triangle those serious publications at checkout counters have been
    covering for years.

    Also, since it is mostly men that do the grocery shopping, how come the
    magazines are mostly for women ? Shouldn't the check-out aisles have
    magazines such as Playboy , Sports Illustrated, Popular Science and Mad ?

  14. Re: Selective record extraction/copy?

    In article <4902a4be$0$1559$c3e8da3@news.astraweb.com>, JF Mezei writes:
    >David J Dachtera wrote:
    >
    >> Now, I'm learning ksh93...

    >
    >Which reminds me. Yesterday, while looking at the library setup in front
    >of the supermarket checkout aisle, I noticed a cover page title which
    >surprised me.
    >
    >It seems that Brad Pitt no longer wants to mary Angelina Jolie because
    >she has allegedly had a love affair with someone else.
    >
    >I tried $HELP BRAD_PITT but VMS 8.3 doesn't yet have any information
    >about this.
    >
    >I was under the impression that the two had married some time ago ? Or
    >are they just together with all sorts of adopted kids ?
    >
    >It goes to show, when one is too focused on VMS, one looses focus on the
    >truly important issues of this world :-) :-) :-) :-)


    Hollywood is truly important? NOT!



    >Hopefully, next week, they will reveal that Jolie's love interest is non
    >other than Jennifer Aniston. This would complete the story about that
    >love triangle those serious publications at checkout counters have been
    >covering for years.


    I don't follow TV or Hollywood. I recognize these names but if these
    individuals walked up to me, I wouldn't know them by face nor would I
    even care.



    >Also, since it is mostly men that do the grocery shopping, how come the
    >magazines are mostly for women ? Shouldn't the check-out aisles have
    >magazines such as Playboy , Sports Illustrated, Popular Science and Mad ?


    Where'd you find this statistic? Granted, I go to the store and I do
    do the grocery shopping but only because the Mrs. doesn't drive.

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

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2