Newsgroups: bit.listserv.sas-l
Date:         Wed, 29 Jul 1992 13:55:53 EST
Reply-To:     Aga Chen <GOVE004@TWNMOE10.BITNET>
From:         Aga Chen <GOVE004@TWNMOE10.BITNET>
Subject:      SAS/AF problem

Dear SAS-Lers:
  I have developed a tape management system using SAS 6.07/AF on
MVS/XA system. I imitated the way listing on SAS manu: SAS Screen
Control Language, Usage Version 6, First Edition, page 197-200.

  I describe you some information:
  My data file contains some fields: volser no.
                                     use dept.
                                     borrow date
                                     the date should be return
                                     tape type
                                        .
                                        .
                                        .


       On page 199, Display 12.5, I changed the field 'Delete row' to
   'action' in my program and I can issue commands in the 'action' field.
    For example, 'D' means 'delete record from data file',
                 'A' means 'apend a new tape record to the last record',
                 'R' means 'use department Return tapes borrowed from
                            our EDP center and from my program's
                            control to erase the tape record's fields
                            to blank except volser no. and tape type'
                 'U' means 'to Update the record and to highlight
                            the record'.

   The way I use is like the MVS/ISPF funtion 3.4 can manipulate multiple
entries.

  My problems are:
   1. When I am trying to delete records by issuing multiple
      'D' on the action fields, I cannot successfully delete those records.
    (eg. I issue 3 'D' to delete 3 records but it only delete 1 or 2 records.)

   2. Issuing 'A' on field 'action' to add a new record  but it doesn't
      work on subset data file, it just works on the whole data file and
      I cannot put the cursor on the first field of the new record.
      (Before I make actions on my tape records, I use another screen to
      find subset records I want to manage. Then, pass the where
      CLAUSE to next program.)

   3. I issue 'R' but it doesn't work.

4. I don't know how to highlight the update record and how to show message
   for us confirmation.

Following is my screens and program:

===============================================================================
                   *************************
                   *  TAPE UPDATE INQUIRY  *
                   *************************
            Volser no. -- From : &vol1_  To : &vol2_
            Use department     : &us
            Dued date          : &rdate
            Tape type          : &typ
===============================================================================
From this screen, we can get the CLAUSE and pass to the next program.
===============================================================================
                      ************************
                      *  TAPE UPDATE SCREEN  *
                      ************************
action   use dept.  volser no.  borrow-date   return-date   tape-type  . .
^^^
  &        &us       &vol__      &bordate      &retdate       &typ
===============================================================================
the program is:
===============================================================================
entry clause $;
init:
     control enter;
     m=open('admin.tape2','u');
     sysrc=where(m,clause);
     rc=sort(m,'volser');
     call set(m);
     rc=fetch(m);
     call setrow(0,0,' ','y');
     numrows=winfo('maxrow')+3;
     numcols=winfo('maxcol')+6;
     legstart=numrows-2;
     call wdef(1,1,legstart,numcols);
     call wregion(legstart,1,4,numcols,' ');
     link legend;
     call legend(' ',' ',' ','highlight');
return;

main:
     rc=sort(m,'useunit volser');
     if action='A' then
     do;
     rc=fetchobs(m,_currow_);
     rc1=apend(m,'noset');
     call execcmd('bottom');
     return;
     end;
     if action='R' then
     do;
     rc2=fetchobs(m,_currow_);
     action=' ';
     useunit=' ';
     bordate='.';
     retdate='.';
     end;
     return;

term:
     rc=close(m);
return;

getrow:
     if (fetchobs(m,_currow_)=-1) then
     call endtable( );
return;

putrow:
     rc=fetchobs(m,_currow_,'noset');
     if action='D' then
     do;
     rc=fetchobs(m,_currow_);
     rc=delobs(m);
     action=' ';
     end;
   else rc=update(m);
return;

legend:
    call putlegend  ...
                    .
                    .
                    .
===============================================================================
Does anyone know of any ways to solve my problem?
Thanks in advance for any suggestions.

Aga Chen                        Bitnet add. : GOVE004@TWNMOE10
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU