Via: uk.ac.leicester; Thu, 20 Aug 1992 16:58:44 +0100
X-Mailer: ELM [version 2.3 PL0 (LUT)]
Newsgroups: bit.listserv.sas-l
Date:         Thu, 20 Aug 1992 16:54:31 BST
Reply-To:     Simon Dunkley <sdd@LEICESTER.AC.UK>
From:         Simon Dunkley <sdd@LEICESTER.AC.UK>
Subject:      SAS/AF (r) Documents, well, FSP in this case...
Comments: To: "SAS(r) Distribution list" <sas-l@vtvm2.cc.vt.edu>

>CONTENT:   SAS/AF beginner needs suggestions
>REL/PLTF:  mine is VAX/VMS running SAS v6.06
>E-ADDR:    DALMAS@NIEHS.BITNET
>NAME:      Dawn Dalmas
>DATE:      August 20, 1992
>
>I'd like to develop SAS/AF applications for data entry which are menu-driven
>and user-friendly, featuring data/field value restrictions, help selections,
>user-generation of reports, resulting in creation of SAS datasets.  Sounds
>like a job for SAS/AF, right?  But I'm having a little trouble getting started,
>and would appreciate suggestions/comments/advice aimed at my level (SAS
>programmer with no AF or SCL experience).  I have one Fine Manual at my
>fingertips: SAS/AF Usage & Reference, Vs. 6, 1st edition.  The Ch.10 (p.172)
>description of PROC BUILD states ability to "read from and write to SAS data
>sets" yet I'm not clear on just how to do this.  Are there other manuals/books
>you'd recommend with tutorial-type examples?  Is the SI course "SAS/AF Software
>Applications Using Screen Control Language" worth the money?

Well, firstly, the following book is the most helpful one that SAS do:

SAS Screen Control Language: Usage Version 6 First Edition.

(Thanks to Helen Woolfson at SI for drawing my attention to it: a very
useful book.)

Secondly, some time ago I sent a posting about SCL and FSP, and promised to
send a summary at some future date.  Well, by the time I'd written the summary,
we'd had a change of mainframe and mailer problems took me off SAS-L.  Now
would seemt to be a good time to post it: the programming isn't particularly
difficult, nor does it do anything fancy, but it's quite a handy start:

---message begins:

	Some time back (October) I posted a request for SCL code to get
my data entry application to scroll automatically from screen 1 to screen 2
to screen <last> and then back to screen 1 for the next variable.  Well, I
got it to work some time ago, but have only just had the time to post the
solution *I* used, based on helpful hints from Ted Bandy at Purdue (whose
message pointed out an error that had taxed me for two weeks: I had a comma
instead of a semicolon; the program compiled successfully, but not quite
the way I wanted...) and largely from Andy May at UNC-CH, who suggested the
bulk of the code I needed.  Based on these contributions, and with all due
acknowledgement and respect, I've compiled the following brief notes, which
fit neatly onto a side of A4 for anyone wanting to take a hard copy. I'm
not bothered about people accrediting my name: the important parts aren't
even my work...

	My grateful thanks to all who responded - all mails were read and
digested, and I picked up more than one helpful hint.



                                      O  /
-----------------------------cut here  X -----------------------------------
                                      O  \


	Using SAS Screen Control Language on a PC in PROC FSEDIT.


Using SCL is fairly simple, but the correct procedure needs to be followed
if mistakes are to be avoided.

1) Create your SAS permanent dataset, either via a program, the SAS display
   manager, or via PROC FSEDIT with the NEW= option;
2) If you didn't create your dataset via PROC FSEDIT, then run PROC FSEDIT
   on your dataset.  You need to have specified a screen with the SCREEN=
   option, creating an SCT catalogue file.  A simple suggestion would be
   PROC FSEDIT DATA=libref.dsetname SCREEN=libref.display;  where libref
   has been pre-defined via a LIBNAME statement;
3) Type MODIFY at the command line to access the modification menu;
4) Select option 2 and rearrange the screen to look as you would like it -
   issuing the command NUMBERS ON at the command line might make things
   easier, and you should also find that the page up and page down keys are
   fully functional, which may help.  Make sure that all variables are to
   be located on screen with the requisite number of underscores (one per
   character/number according to the length of the variable - not its name)
   and that the underscores also have a clear space on either side;
5) When the above is completed, press HOME to access the command line, and
   enter the command END.  You will now be asked to place the cusor in the
   appropriate place for each variable.  Any unwanted variables are removed
   by typing UNWANTED at the command line, and moving the cursor to the
   appropriate place and then and only then pressing the return key.
   Mistakes can be corrected with the DEFINE command, see the FSP guide for
   more details;
6) At the menu, select option 3 and enter your SCL code based on the sample
   template given below;
7) When you have completed the SCL code, access the command line and type
   END;
8) If you wish to modify the screen colours, use option 5: to set maximum
   and minimum values, etc, use option 4.  When you have completed your
   changes, type END and you will be back to your normal screen for FSEDIT.


* sample sclcode fragment;

init:
   return;
main:
   if modified(last_var_screen_1) then call execcmd('=first_var_screen_2');
*don't forget the equals sign or single quotes;
   if modified(last_var_screen_2) then call execcmd('=first_var_screen_3');
*and so on until the last one;
   if modified(last_var_last_screen) then call execcmd('add;=1');
*make sure that's a semicolon in those parentheses;
   return;
term:
   return;

----message ends.

    These notes are intended to be used partly as simple get-you-started
guidelines - I'm supposed to be running a brief seminar here sometime on
this subject.  Anyone wanting to use them can feel free, with or without
accreditation: in any case, such accreditation should probably go to
other people mentioned in the message...

    Simon

      00 0 O o o...
     0     ___         _________________ _________________ _________________
    ][_n_i_|(  ooo___  | Simon Dunkley | |    sdd@le     | |  sdd@le.ac.uk |
   (  _____| | |     | | Department of | | University of | |      +44      |
   _||_____|_|_|_____|_|__Psychiatry___|_|___Leicester___|_|__533__523259__|
     0--0--0    o o o    o-o       o-o     o-o       o-o     o-o       o-o
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU