Date: Tue, 9 May 2006 12:01:00 -0700
Reply-To: David L Cassell <davidlcassell@MSN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: David L Cassell <davidlcassell@MSN.COM>
Subject: Re: GOTO or LEAVE Command
Content-Type: text/plain; format=flowed
>I read a small handfull of L messages concerning GOTO or LEAVE commands and
>wonder if anyone has additional thoughts. Back in the old days of DOS batch
>file programming, I would set up a user menu with various GOTO commands to
>submenus with conditional If statements. This allowed the user to navigate
>from one menu option to another. Commands would execute in the background.
>Is there a way to effectively utilize the same menu process in SAS? I am
>asking because we have some SAS users who want to get a SAS report but
>don't want to learn SAS (gasp, I know, but it's true.) I am a little
>familiar with Display Manager, but little better than a novice myself. I am
>stumped on how to add verification code to bump a user to a standard error
>message, or route back to the top of the SAS program to re-display the
>menu. Also looking for any good books I can buy, or links to learn about
>I've found some excellent help from many accomplished SAS programmers here,
>so I am reaching out again for whatever advice you may offer.
>The basic DOS functionality was as follows:
>CALL certain commands
>IF OPTION1 GOTO DATAENTRY
>IF OPTION2 GOTO QUERY
>IF OPTION3 GOTO REPORTS
>IF %USER-RESPONSE NOT 1 OR 2 OR 3 THEN GOTO ERROR
>ECHO 'ERROR MSG.'
>CALL commands to end
Let me suggest that you NOT choose a really horrible coding practice,
just because it was what everyone was forced to do in DOS batch files.
If DOS batch files required the use of inline assembler code for math,
would we still want to do that now? I hope not.
I recommend that you take the apporach suggested by others in
this thread. I personally would do it in Perl. There's no reason not
to write proper subroutines or objects to handle these tasks, and
call them in a normal way.
You can even do that in a SAS data step if you want to (sort of),
by using the LINK and RETURN statements.
David L. Cassell
3115 NW Norwood Pl.
Corvallis OR 97330
Express yourself instantly with MSN Messenger! Download today - it's FREE!