From: ratel@ireq.hydro.qc.ca (Gilles Ratel 8720)
Newsgroups: comp.os.vms
Subject: Re: RECALL/OUTPUT=file (answers)
Date: 9 Sep 92 12:49:17 GMT
Organization: Institut de recherche d'Hydro-Quebec, Varennes, Canada


Original question:

>  Is it possible create a command  
>       "RECALL"  with option  "/OUTPUT=filename" ?  
>    or "RECALL"  with option  "> filename" ?
>
>    {with DCL or others}
>
>Supplement:
>
>     Commands file DCL        :  $ DEFINE SYS$OUTPUT filename
>                                 $ DIRECTORY       {or SHOW TIME, etc.}
>                                 $ DEASSIGN SYS$OUTPUT
>
>                                 > O.K.
>
>     But I have problem with  :  $ DEFINE SYS$OUTPUT filename
>                                 $ RECALL/ALL
>                                 $ DEASSIGN SYS$OUTPUT
>
>                                 > size for "filename" is 0
>                                 > ????

I have received answers from :

 Brian D. Reed----------bdr@cbnewsg.cb.att.com   
 Carl J Lydick----------CARL@SOL1.GPS.CALTECH.EDU 
 Kimberly B. Churchwell-churchwell@vms.ocom.okstate.edu

 Brian Tillman----------tillman@swdev.si.com
  > I just found it in my library catalogue.  
  > It's V00225 (in the U.S.) and is called RECALL BUFFER Save/Restore.
  > There is a DECUS tool that does this.  I don't remember its name, 
  > so contact your local DECUS chapter's library.

 Roberto Divia`---------Roberto@sunsci.cern.ch
  > With the DEFINE SYS$OUTPUT works OK for me... I am running VMS 5.4-2.
  > OK means I have the history buffer in the output file.

 Ben Armstrong----------bg@dymaxion.ns.ca
  > Your problem seems to be that RECALL/ALL doesn't work within a command
  > procedure.  If you type the above commands, you will get the desired 
  > results, but if you place them in a command procedure, you will get a 
  > null file.  Isuspect that this is because RECALL is normally an 
  > interactive command (that is, without the /ALL switch it will display 
  > the current command and allow you to edit it at the DCL prompt) and 
  > therefore should not be run from a command procedure.

 Carl J Lydick          CARL@SOL1.GPS.CALTECH.EDU
  > You can't do it with a DCL procedure.  You actually have to type 
  > the DEFINE, RECALL, and DEASSIGN commands by hand.  The reason is that 
  > the RECALL command only works when issued from a terminal.

 Arne Vajhxj------------ARNE@KO.HHS.DK
  > The RECALL command are ignored unless it is executed directly from a
  > terminal. Sorry !
  > 
  > (for all other uses than RECALL/ALL it is quite reasonable)
  > 
  > The following small MACRO routine and the FORTRAN program can probably be
  > modified to suit your needs:
  > 
  >         .title  recall
  >         .link   "sys$system:sys.stb"/selective_search
  >         .link   "sys$system:dcldef.stb"/selective_search
  > PRC_C_CMDBUFSIZ=1025
  >         .psect  $LOCAL quad,pic,con,lcl,noshr,noexe,wrt
  > buf1:   .blkb   PRC_C_CMDBUFSIZ         ; first copy of recall-buffer
  > buf2:   .blkb   PRC_C_CMDBUFSIZ         ; second copy of recall-buffer
  >         .psect  $CODE quad,pic,con,lcl,shr,exe,nowrt
  >         .entry  recall,^m<iv,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11>
  >         movl    B^4(ap),r11
  >         cvtwl   (r11),r8
  >         movl    B^4(r11),r11
  >         movl    B^8(ap),r10
  >         movl    #0,r9
  >         movl    #CTL$AG_CLIDATA,r0
  >         movl    W^PPD$L_PRC(r0),r0
  >         movl    W^PRC_L_RECALLPTR(r0),r7
  >         moval   W^PRC_G_COMMANDS(r0),r0
  >         subl2   r0,r7
  >         moval   buf1,r1
  >         movc3   #PRC_C_CMDBUFSIZ,(r0),(r1)
  >         moval   buf1,r1
  >         moval   buf2,r2
  >         movc3   #PRC_C_CMDBUFSIZ,(r1),(r2)
  >         moval   buf2,r6
  >         addl2   r6,r7
  >         subl3   #PRC_C_CMDBUFSIZ,r7,r6
  > 100$:   decl    r7
  >         cmpl    r7,r6
  >         blss    200$
  >         tstb    (r7)
  >         bleq    200$
  >         cvtbl   (r7),(r10)
  >         subl2   (r10),r7
  >         movc3   (r10),(r7),(r11)
  >         decl    r7
  >         decl    r7
  >         addl2   #4,r10
  >         addl2   r8,r11
  >         incl    r9
  >         brb     100$
  > 200$:   movl    r9,@B^12(ap)
  >         ret
  >         .end
  > 
  >       PROGRAM ZZ
  >       INTEGER*4 L(100),N,I
  >       CHARACTER*80 S(100)
  >       CALL RECALL(S,L,N)
  >       DO 100 I=1,N
  >         WRITE(*,*) S(I)(1:L(I))
  > 100   CONTINUE
  >       END
  > 
  > Hope it helps !
  > 
  > PS: The MACRO can probably be improved, but it was written in a hurry and
  > I has never had time to improve it.

Sincerely, Thank you!

Gilles Ratel
-------------------------------------------------
Institut de recherche d'Hydro-Quebec
Varennes, QC   CANADA
Email: ratelg@ireq-ccfm.hydro.qc.ca