control program that greatly enhances the productivity of ... busby.pdf · control program that...

23
SAVING TIME WITH THE SAS DISPLAY MANAGER Phil Busby, SAS Institute Inc. The SAS® display manager is a full-screen control program that greatly enhances the productivity of the SAS programmer. It is now part of the SAS System for minicomputers, ,'unning in full-screen mode. This paper describes the display manager and shows how you can use it to create and run SAS programs quickly and effectively. First, discussion of the basic functions of the display manager and "instructions for controlling the program, log, output, and help windows when running a simple SAS program are presented. Then the powerful editing commands are described, followed by a description of each screen command that you can enter on the command line. The final part of this paper illustrates how the program function keys can be used for the fast entry of commands. Begin the SAS session by entering the following command: SAS/FSD=TEK410S Here, separate the command keyword SAS from the options you want set at initialization time with a slash, and in this case, the only option needed is the full-screen device option. This specification says two things to the SAS System: first, you want full-screen mode, and second, your full-screen device is a Tektronix 4105 terminal. By specifying what kind of terminal you are using, the SAS System can choose the correct device driver to use, and it knows how many rows and columns are available for display. As you go into full-screen mode, the SOURCE option is turned on so that your SAS source lines are written to the log window. SAS is the registered trademark of SAS Institute Inc., Cary, Ne, USA. 469 Here is the initial screen you see when the display manager takes control. It is really two logically distinct displays: the program editor window, below, is where SAS source statements are entered, and the log window, above, is where the SAS log lines are displayed, showing the results of your executed SAS source statements. To see exactly how each window works, enter a trivial example. Key in the following: DATA A; X=l; and enter' the SUBMIT command. The source statements appear on the log window, followed by the note, which tells vou that your data set was created successfully. Notice that the program editor lines are blank, ready for new source input. Co,,"an<\ => Now you can enter PROC PRINT; RUN; Prog1"n EdIt'" and submit it to the SAS compiler, which causes the PRINT to print data set A. PROC PRINT produces a page of printed output and invokes the display manager, which displays the page. The display manager also sounds the alarm, which indicates that the procedure is complete, and the last page is displayed. Now, simply press ENTER to return to the Jog/program screen.

Upload: lykhue

Post on 12-Feb-2019

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

SAVING TIME WITH THE SAS DISPLAY MANAGER

Phil Busby, SAS Institute Inc.

The SAS® display manager is a full-screen control program that greatly enhances the productivity of the SAS programmer. It is now part of the SAS System for minicomputers, ,'unning in full-screen mode. This paper describes the display manager and shows how you can use it to create and run SAS programs quickly and effectively.

First, ~ discussion of the basic functions of the display manager and "instructions for controlling the program, log, output, and help windows when running a simple SAS program are presented. Then the powerful editing commands are described, followed by a description of each screen command that you can enter on the command line. The final part of this paper illustrates how the program function keys can be used for the fast entry of commands.

Begin the SAS session by entering the following command:

SAS/FSD=TEK410S

Here, separate the command keyword SAS from the options you want set at initialization time with a slash, and in this case, the only option needed is the full-screen device option. This specification says two things to the SAS System: first, you want full-screen mode, and second, your full-screen device is a Tektronix 4105 terminal. By specifying what kind of terminal you are using, the SAS System can choose the correct device driver to use, and it knows how many rows and columns are available for display. As you go into full-screen mode, the SOURCE option is turned on so that your SAS source lines are written to the log window.

SAS is the registered trademark of SAS Institute Inc., Cary, Ne, USA.

469

Here is the initial screen you see when the display manager takes control. It is really two logically distinct displays: the program editor window, below, is where SAS source statements are entered, and the log window, above, is where the SAS log lines are displayed, showing the results of your executed SAS source statements.

To see exactly how each window works, enter a trivial example. Key in the following:

DATA A; X=l; RU~;

and enter' the SUBMIT command. The source statements appear on the log window, followed by the note, which tells vou that your data set was created successfully.

Notice that the program editor lines are blank, ready for new source input.

Co,,"an<\ =>

Now you can enter

PROC PRINT; RUN;

Prog1"n EdIt'"

and submit it to the SAS compiler, which causes the PRINT procp~ure to print data set A. PROC PRINT produces a page of printed output and invokes the display manager, which displays the page. The display manager also sounds the alarm, which indicates that the procedure is complete, and the last page is displayed. Now, simply press ENTER to return to the Jog/program screen.

Page 2: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

Co"""and =>

• Pl'-OC PUNT, , R1JN;

SAS Log 10:46

?"ogra", Edltor

Tu (;omplete this example, you need to examine two more features of the SAS System. First, to run a graphics procedure, key in

PROC GCHART; PIE X; RUN;

and enter the SUBMIT command, which causes the screen to be cleared and allows the GCHA.RT procedure to take over', displaying a pie chart of the variable X.

After examining the chart and returning to the log and program windows, go up to the program editor command line and enter the HELP command.

'I PROC PRINT; 5 ~:"'. 5 PRo.: 0Qtt,II1: 7 PI~ X: e R\IN.

Pro .. "", tdltor

The HELP command causes the log window to be replaced by the SAS help window so you can browse the requested information while typing SAS statements into the program window. The help window remains displayed until you enter the SUBMIT or' LOG command, which recalls the log window.

470

Cc=>nd =>

Inform.Hcn .~.ll.:cle:

ANCOVA. CAL.WDAR g; fASTCLUS f1\cQ fSdlNT Gf:;-\'.' ",,;::OUG. I."~"".AT ~;'7~ACE ,,"' .... :;oR pp:~c~

R::~

SAS Help

Proq,.." Editor

Now that you have seen how to move from screen to screen, go over the different commands available on each window. First, split the screen to make more room for program lines by moving the cursor where you want the dashed line to be and pressing the SPLIT key (program function key 9). Then, remove the line numbers from the program editor window with the NUMBER OFF command, allowing fast entry of SAS statements. Type the following:

DATA E; DO J=l to 5; OUTPUT; E~D; RUl\';

Befure edilin9 lhese lioes, put the line numbers back on the program editor window with the NUMBER ON command.

lof~,~.t'o. Kv.11""'8,

A:rNA APPEND N.J"'" ASSI(;N A~-roJ\[C III-Oi' BPC'·S~ cx.~"""" """cOO!! cmo!SC OWIT ClTlaN:~ CL"",," CL'J,YD. 0'5 CCMl'UT.AIl C:lh"TElITS COtNDlT COPY CO?YIHTE COI'Jl

-------------------------------------~ --------------------------------------Co=and => nwooer en

SAS Holp

Infonatlon ov.llal:l.:

MeVA APPEND AIlI~ ASS!CH Al.I"lUfC II/ollP BROIlS! ~E.'lOAR CANCOlUI. CANDISC OWIT C!nMSE CILAR CLLT3TER as CCf-WU1"U com~t<TS COl,VDlT ropy cct'"VR.... o;QIIP.

Progrn Editor

Page 3: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

Inf ....... Uon .... HiIbl.'

00001 DATA 8: O~002 00 ""1 "j'g $: 00003~UT; ooc04 END' 0000$ RIJ)/; 00~06 oo~o,

00006 OOXi COOlO ooon g~m "'-00014 ~CO'5 0001~ 00011 00018 O~019

SA3 H.lp

The following seven line commands operate on a single line:

>n shift right

<n shift left

In insert

Rn repeat

Dn delete

M move

C copy.

Except for M and C, all of these commands r:an be followed by an integer operand to specify how many times to do the operation. For example, suppose you decide to shift the RUN statement that you entered above to the right to create an indentation. Simply enter >4 in the line number fjeld and press ENTER. The display manager moves the data on that line four columns to the right. It knows to indent 4 spaces, not 4005, because it scans the line number field bar:kwards to extract the integer operand, and it ignores digits that match the previously displayed line number digits. In this example, if you had wanted to indent 40 columns, it would have been necessary to blank out the zero after the >40.

Infor~.tlon avallabl.,

A.'iOV}' M'POD Al'tlMo\ ASSlCN AUTOREG lII!DP BROWSE Gl.!.INDAll CA.'<CatR c:ANDlSC OWT CaUI.sE CLEA!I. CLUSTn otS CQo!?~TAB co.'TENl'S CONVE!il COP'! COP'tI\:n CCI£R c:;;;;::;:;,-::::----------------------------------------------------p;~;:;;;-;~I;:;

OC~~l DATA 8; CeC02 DO Jsl 10 ~, On~03 OU'l?UT; cooe4 E"'" >t005 RUN; CJ006 0000, c;ooe C~~09 OOOlO

~~gg OO~13 a0014 O>~l~ 00;;16 00011 00018 00019

471

Co:oooand =00' SolS Help

Information ava1hbl.,

ANOV}' }'pPEND MIlIA AliSlijN A!J!'OIIEC!IMDI' BRQIoISE CM.ENDAIl CA/ICCIIU. CANDISC ooon Cllll1ASE CL~ CLUSrEP. . --~-----~--~~--~~~--~:--~::-------~~~~:---~-------

Cc=and --> ProlJTut Editor

ocon DATA " oeo» 00 J~l 'rO 5. 0(0)3 0U'P'Ut; 00004 DIll; OGOO~ RUN; C;~'l6 OCCQ7 o:~oe IX"~09 OOOlO OC~ll Ca012 OC~l3 DeOlt 00015 C:~l6 00017 ceu,s O:Ol~

If you decide that the RUN statement should be indented only three columns, simply shift the text back to the left one column by keying < anywhere in the line number field and pressing ENTER. When a line command is not followed by the optional integer operand, a value of 1 is assumed.

SAS Help

Intonation uallob1 .. ,

~~~ ~r-~ ~~SC ~;:'f ~W~~ ~ ~S's'~ --~~--------::'!~~---~~:~~---~~:----::'~::------~~~:~---:~----.--C~~Jl o.t.tA B, C::;)2 00 J~l ro 5, C::Jl CL;tp\ll'; ,-:'01 "''''' ::<0$ IIJN; ~:::6 " __ ~7

:~::S ~::~9 ::::10 C:~l1 ;;c:" :~~13 :;::l~

:::'S ::;l6 :~~" ~C~lS ~;CH

lnt~rnt10n uallabl.a,

SAS Help

A'lrNA M'PEND AlIIIII, ASSICN At.rrai;EQ lIMO!' !!ROWSE CALENDAR CAl'CORR ("ANDISC 0UlI1 CITIIW:E Cl.~ CL!JSTEP.

--~--------~~~---~~---~:----~:------:~~:::---~------DOon OATA a: OC"~2 00 J~I ro 5, CO~J3 OllTl'UT; OOO~1 ENO, OCuJ5 RUlI; OC~~6 ~~O;17

gg~~~ 0:;010 C~Oll OC012 00013 CC014 COOLS 00016 00017 0:Ol8 ,:C:9

If you try to shift the text too far, you receive the invalid line command message; the alarm sounds; the cursor is placed on the line command field; and the line command field attribute is changed to reverse video. The same thing happens with any invalid line command, for instanr:e QQQ, and the erroneous command must be erased or fixed before continuing.

Page 4: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

.AS Help

Ioronl'UO" a".ilable,

... !JOII. APPEND AAIM.\. .S~IGN ~'TmIIEG BKlP DOWSE CA:.ElIDAA CANC(lI\R CANDISC: OWl'!' Cl'!'lll.O.SE CLEAR CLI.l'Sl'Dl OIS <:1Jt1I'U'l'AB CON'l'<lI'rS CONVIltT copy CCPYRlfl CORIl

Co_nd =>

:;CGOl w.~" D; "C~OI DO "/"'1 TO ~: ~r.,,"' OU'lPll'I', CCC~. ~; CC~05 !i.\JN'

d~~~~ g~~5: ~~~lO :~Oll ~COll S~Oll C;;?Lt C~Ol5 CC~:5 ~CCl' ~~Ol~ CCOlj

C<>a»nd =>

Inro.-aUon anUabla:

Program Editor

S,\,S Holp

A!)OVA APPESD A!'.lHo\ ASSICN ~lII'C!!E(l IIMDP Bii,OIISJ; CllDIDIJI c:J.1<C/1RII cmDHC: OUJI.'!' CI'!'IBAS£ CLUJ!. cr.lJSrnt Q\S CCMi'"'!'AB caN'!'D;rs CONVEII'!' ropy CCP'I'IHl'E CC1UI. -------------------------------------------------------------------

Ir.!or"oUon avallol:>l .. ,

A.~~VA APP!Ml Ai,;MA ASSIGN" AUTORECl BMIlP BROWSE o.:.E."D.IlI. CA'IICORIi. CA.':OISC OlA.n Cl'I'l!!ASE CLtAR CLVSl'!R C'!<; COMPlJTAB CIl~-r.NTS crn.r",,-'I' COPY COI'YR''I'I'' caRR

C~:~l DA:::A B:

SS~g; ~~~,TO 5; OCC~I END; OOCO; RUN:

o~cel oc;ca OCCOI C~ClO oeoa CeOll

~~gt~ CC?lS OOOl, oeOl7 OOD~a ~n~,"

lororm.tIOl'. anUablG,

S/o.S Help

IIWNA APP!Ml AAIMA ASSIGN ~=EC BMDP \!ROWSE cA:.ENruIl CANrnIZ1I: o..'II!)ISC ~.,. ClTlllASE CLu.R CLUSTER 01> ~AB OltITI:N'I'S COINER'!' copy OOPYRI1'l! <:'CIM.

Now you can insert a new line. Simply type an I Oil the line before the place the new line should go and press the ENTER key. The screen comes back with the cursor placed in the first column of the new line's data area.

472

InrOl'",atlon '''ol.labl.,

JoJ.JOV~ API'""", AlUKA .lSSIal AU'roREC IMCP PClWSI CALEi'IOAII. c,wCOlUl. CANCISC 0/AlI.'!' ttTllIASli: c:LEAII. t:WS'IU OG COMPlnAB t:ONt'EN'I'S CONVD'!' copy COPntI'I'l c:cu.

Ce=and =>

ueOOl DAT~ a: 1:002 00 J~l 1'0 5, o,~~, m!WU'I'; 0(C04 UQ;

;~~gi Rim,

Jc~J7 cc~~a O:~O~ ~,~10

L~Oll.

~~m , ~-814

0~Cl5 0(016 00017 C~C:9 ~~~l~

Information o"dlabl.,

Program Edlt.or

SAS Help

NIO'I" APPEND ARt.... ASSIal ... =ec: 8HOP I!It.OWSt CALENDAR OOlCORR o.r.tlrsc OlAlI.T CUlBASE CLEM tLUSTill.

--~--------~I:'!~-~~~--~!----~~:------~~:.~---~------

oeOOl DA'!'A B, gggg~ 00 J~l 1'0 5:

CC~04 (lIJ!l'IJ'I'; 0:005 ENO, OOC06 ~UN; ce~07

~t3S~ CQQtO CaDl' OCOH O~~lJ C'014 ~CV15 ODC16 Otol1 0:0,9 ~:Jl9

Prow ... Edlt.or

Notice that the new line was initialized to blanks. For another initial value for inserts, use the MASK command. For example, if you have multiple comment lines to put in, you can type the MASK command on a line with comment delimiters and press the ENTER key. The display manager extracts the mask and throws the line away, but the next time you insert lines, they will be initialized to the mask value.

Co"""and. =~ SAS H~lp

Infor .. ~Hon ."all0J0l.,

ANOVA APPfMl AAIKA .osSIGN Ao.r!O!!£C IMlP BIIOWSE CAl.ENDAlI """~""R CAmISC mART cl1!lLI..S~ CLUJ twS'!'ElI. OiS CCfoIPU!AB CONI'ENi'S CONVUI.'!' con COP'IlI.I'I'E: cauo.

0(001 OATA 8; tJCuUl 00 J~l 1'<1 s, 0000] C0004 OUTP\l'I'; 00005 DID: 00006 111m; _~7r ,/ 0(008 O(GO~

OCOlO atoll OCOl2 O(OIl OC014 OWlS 0(016 0(017 OCol8 OCOl9

Page 5: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

Infocutlon avaU~l.,

A.'!!OJA J,PPENJ;I AI,-!ioIA ASSIOI AU1at~O BNOP I!IIOWSE CAL~ c:..\NCaiR c.vDISC OlAIIT CITla.\5~ CLEAII CLUSTER OIS cctlPlJTlJI Corm:Nl'S cctIVDI.T COPY COPYIUTE CaIJI.

cco~, noTA '" C0002 00 :"1 10 5, C0003 C0004 O\;TPlIT, COCOS END; C~nD6 RUN; CC007

~ggg~ COOIO COOll ,COil CCOIl CcOl4 C'-015 COOI~ Oon'7 OOOIS OOOI~

lnror ... t1on avallal)le,

A.~W~ IIPPElID ARlHA ASSIGN A!itIlR[O BMDP BIIOWSE CA:-~~ CANCORR C,I,NI.lISC OlAIIT ClrlaASE CLEM a.USTIll 0<0 CC*I!'\ITAB =DlTS CONVtllT copy COPYRITE COR!l

LleOI lJ.O.T~ 8: O~COI ro J_I ro oS, ~O.jOl

aeonf CI.'TI'U1',

g~~g% EI<I\hm, CJCOl "'''~i' ~C~O~ OCOIO cnOll COOll

gggi: JDO:>

::~t; OC~l& OOO:~

lrfo"..t1on avallobl.,

Al>OV,\ APPEND ARlioIA CM.£NDAA LANceR-. ClND!OC D'S COMl'lITAB CON"rENI'S

OOCCl O~T}" B' uuocz t" gSg~~ ~ J"I TO 5; ceOC5 CC~C6 0IRl'1fT! ne:er, DO: co~ca RIIN' CO~C9 OO~lO

00011

g~gg 00014

ggBi~ 00011 oeOIS 00019

Co .... nd =~

OnOOl D.O.TA 8, OOOOl I' OOOal '" O~OO. 00 ~~l ro S· 0000, CCOD& 00'II'1fT; 0000? ENO; 00008 RUN, 00J09 ~~S.,O

00011 00011 00011 OOOH OCQ]~

00016 CCO!7 OOOU 00019

ho .... UI Editor

SAl; Help

ASS1CN AlJroJI.fO ~ ell.OWSt =r ClTll'J,SE CLEAIl nU~TIil <;ONVEllT <:opy c:onRITE CCiU\

AlJI'QREG cl!!BASE ,~,

"' "

MOWSE Cl.uStEfl ~,

Progra .. [(I. tor

" "

To change the mask, just enter another MASK command. For example, set the mask back to blanks by typing MASK on a blank line.

473

Inside the DO loop type the statement K=J;, and for that line enter the line command R2 to repeat the line twice, Now you can alter the statement to read L=J on one linc and M=J on the other line by changing just one character on the repeated lines,

N1CV}.. IIPPEND AllliolA ,o.sS:CN AUItlIUG BM!lP III!OWSE CALENDIIIl o.NCORII c:.\NOl~C OWlT crTIBASt n!AII CLUSTIil O!S CCfoII'UTMI CONTENTS CCtIVtIlT copy COFa.lTI con -- ---------------------------------------------------------------------------

0';0(1 OArA a, rJC,l " 'JC~CJ /, Oo~o. 00 J;l TO ~;

gg~~~ ~~#l.1T' C'~C' I ""'~; ~;~:8 RIIN, ~CJC'l OCOIO ~:Jll OCO:2 CCJlJ

g5~;~ C~JI6 C:J17 c~~,~

aOOl9

Co=.nd =~

Prow-all Edaor

" "

SA!] n.,p

IJ;CVA APPEND AlllHA ASS:CN Anoarc: 8MD? !;ROWSE w.:.r~';;;AII o.NCOIQI c;ANVlS~ Q'.AIlT <.:UI8ASE CL!:AR a.uS!Ol OIS O»II'UTAB CONTENTS CONVERT copy co<'l'lI.ln CORIl ------------------------------------------------------- ------------------

OCCOl DATA B: aeon /' OC~~3 '" O~C04 00 J-1 TO S, C:~;5 K..J' OC~:~ K-.J; COCO? K=J, coaoa 01"TI'lIT;

g~g~~ END~<JN C"~ll C~OJ.I OO~lJ

g~~~~ C::l~

g;~;~ CO~19

00W1 O~TA &: oeC02 /' OCtO) /" OC~04 00 J~: TO 5; coocs """" Q~OO~ L"<1, O~CO, M-J; OOCCS 0l.m'1.r.'; COOJ9 END:

~gg~ RTJI'I, 00('12 CQ013 OC014 CQCl5 G;JC16 ~n:n

ggg~

ARI".... ASSIGN C1.NIllSC OIART OON'UNTS o:mvER1

PrOIT~1I Editor

" .,

PrQIIr"'" EdItor

" "

You can put a line command on more than one line at a time before pressing the ENTER key, and all the commands will be processed by the program editor. Add a new line after the DATA statement with an I on that line and delete the line that has M=J by keying a D line command there. Both operations are done when you press ENTER,

Page 6: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

c""",~nd => S,\,S Help

rrformation a .. 11oble,

MOVA APPEND .\RIM.'. ,\,SSICN NJ1'QREC BMDP BRQW~' t,:ALUIOAR CANCORR CANlJISC OWT CITIMSE CLEAR CLUsrm 0'5 CQIoIPI.I'rAB OON"rEN'rS CONVDIT copy COPl1UTf COR!!.

C=.nd~>

10001 OAT ... o. DC~Ol J' 00003 /' ceOO. DO ~_, TO 5, COJ05 K-J, OO~06 """: ~COC7 M"-'. DeCCa O\!TI"\Il", 00009 END, l:UJ'O RU'l; COOll DC~ll OCJ13 OC~H OCJ15 OC~16 00)17 OOl18 OO)l~

c~""",nd =>

Iotorm"!on avdllbl.,

A.'IOV~ .-I.PPENO ARIMII ASSIGN CALENIlAR CA.~CORR CANIJ:SC OWT OiS CO"1r'\Il"I\II c.....,.TEN"T~ CQIIVDI.l

~GCOI DAT .... B: C:C02 "G~O' t' ~,~O"' /' o,C~5 :::0 J.I TO 5, "'~';O ~"-,, ~:"C., L"-', C:~:;$ Jl"TI'lJ!, J:~:9 ES;), C;~lO lWN, C::,l X?:2

~~~~~ ~:OL5

;;g;~ C:C1B C;:i3

,/ '/

'/ ,/

SAS Ho.lp

There are two more line commands that operate on single data lines: M and C. The M line command moves the specified source line to the destination you indicate with a B (Before) or an A (After). For example, you can reverse the order of two lines by moving the first after the second.

SA.!: .... if>

A.'CNA APrEND ARlHA ASSIGN AUTQRW S"IlP mlO\./S£ ::.oz.~ CA.~"""" CAMlUC OWll CITll!A.SE cLUJ\ aUSTell; ::toIS CCfl?tJTAB OONrENTS COllVIJtT COPY COI"aITI CQUi;

O~}Ol DATA 5, "~~02 OC;~; /' C~:04 r ;;~~O~ "" J~l Ttl ~, :::"~:)6 ~-"J ~ ~C~J1 L-J~ C:;:$ QUTI'\Il"; J~:;~9 E.'lD; O~)lO !lIN, CCo"l O:)ll o,,,n ~~;l4

~~;i~ ~n)17

n;~

I"!Q~Uon .unable,

,/ '/

s.o.s Help

A.~OV"" APPEND ARlMA ASSICN AIJTOREO ~P !!IIOWSE o.r.EIlDAIl CANCORP. CAND:SC OIART CITIBASE CL£AA CLU5TDl ~ t:"'"'l'1l'T>.!I crM:'UI:TS r:<llNEllT COl>Y CCPY!l.ITf CORR

eo:::<an4 ..... ~ Prog<am [dltor

0(001 DATA B, ocn~2 OC:03 I"

gm~ r:.; J-l to 5, 0000$ L;,J; OC~O., K-J, CC:C$ C~"TI'I..1:, C~~C9 ,Nll, J,~:O RI..}I,

g1g~~ g~g:! C(~:~ OC~:6 C:O:7 oco:a OC;):9

'/ ,/

474

The C line command works the same way except that the source I:ne is copied to the destination. You can copy the OUTPUT statement with a C and put it before the RUN statement with a B line command.

In!orma01on avaHabl.,

cc~~: OATA B, ;COOl ~:;:Ol J' o:~04 /' C:~J~ 00 J~I TO 5; ;~;J6 L;,J, :;;07 K_J: o~~~" CU-;1'\IT;

~~~rj tSDi:rn; ~:~ll

;;;t~ ;~;:~

~'~~ti C:;G"

;~~:~

I~~o~m.tlon .valilble,

~ COPYR1TE

'/ ,/

SA.5 Holp

BROWSt CtU<TEll ~

SA.5 Ho.lp

I<.~'JV" III'PEM> Mi'lll ASSIGII ;,\ffi.ll{[t;; BI'IDP IIRClISE CAl.EIIDJJI CllNCOIIJI. CAl.'DISC OWIl ClllBAS£ CLF.AIl CLUSTER __ ~~ ________ ':?!~'!~ ___ ~::~ ___ ~! ____ ~~ _____ ~_Y!:!~ ___ ~ ______ _

QCeD\ DA1A B, CC~OI ~:~~! j' :;C:Ci /, :~::\ 00 .lsi ro 5, 000:. L;,J, c:;~, K-.J, ~::~a Oll1'PlJT, 0;00' E>lO, ~~:!~ OlJi?lJT, ~::;ll RUN; ~O",1

O:~,l

~~;i~ ~oo" ::J11 ::::~ :::,9

PT09"""'" Edl~r

'/ 'J

Whereas the single line commands are entered on one data line, the double line commands operate on a group of lines. The double line commands are

"n shift right

«n shift left

DD celete

RRn repeat

CC copy

MM move.

The double line commands work on!y in pairs. You can delete a block of lines by keying DO on the first line and DO on the last line in the block, or you can repeat an entire block by typing RR on the first line and RR on the last line in the block and pressing ENTER.

Page 7: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

$AS IIoolp

ItIIOVA APPIK) Alit"'"' ASSIGN A\II"Of,EG EMlI' BP;:lWSE CALo.1Wt c.YICOM CNII)ISC OIART CITlRASE CLUlt CWSTflI OIS COMPUTA,a CONTEtI'B CCItIVDn' CO!'Y COI"tlUTE CCfU\ . __ ._--_. __ .--------_. __ ._------_._._-_. __ . __ . __ ._--_.--------.

00001 DA" ... ~, Od<tCl ".003 ;"

gggg; b; J*l TO S: OOOO~ t:J: COOC7 ~..J: oooee W11'UT: oou09 mo, COOle (;IJIi'UT: 00011 RUN: OOou OOOIl COOI~ COOlS 00016 C0017 oeel! CO<J19

00001 :lATA Il: m002 {' :C:03 Xl J=l TO 5: ~~:C4 "...:I, ac:~s K~, ~CC~6 OOTPUT,

g3~g~ .~\1T: ~~;J9 RVIi: ~~o:o CG111 c'~JH

C~:13 ~~~14 C~Oi~

COCI6 OCOl7 ~;"e ~:::9

Co=and ~>

OOrrl DATA Il: 00002 /' OOOOl DO J_l TO 5: 0~C04 "'OJ, r,'c.'s ~-.J, CC006 :M!I?IJT: CCCO, ENIl, o~:GB :t;T?lJT· Cc:rr RVIi: C~;lJ

o"~n O:O:Z C:l:l C;'l'l CCCl5 Cc;lb

~~~i~ 0~~l9

00001 DATA B, "Can /' OC~OJ 00 J_l TO 5, o:"o~ L'OJ, ccoo~ K-.J. O~~C6 ~E.7PU'T, C~Cl EJ.~; cc,oa 01.fIPtJ"T, O:l~~9 RtlN; 00010 DAT'" II; eOOll /, OCOl-Z DO J~l TO 5: 00013 L'OJ, OSJ14 K;!' oa~15 :l1ITPtJT; 00016 END, QOIl17=1JT, uo::a ~UN, ~~:a9

?rogr ... Edaor

" "

"

"

SA:! Ho:lp

$AS Help

AlITOI\!C IIKDP BMWSE ClTleASE CLEAP. CL1JSTDl COPY COP'fIIlTE CCIRII

"

"

475

The shift right, shift left, and repeat double commands are the only block line commands allowing an optional integer operand to follow the command. For example, you can indent the rest of the statements in this DATA step by typing »3 on the first line in the block to be shifted and by typing ::>::> on the last line in the block. When you press ENTER, all the lines are shifted right three columns.

In!ormoUon aVailable.

00C01 DATA II, », l /' OO':Jl 00 J=1 TO S: OO~04 L'OJ, OCOC5 K-.J, OC:~6 O\ITPUT' c:;::n £1lO, »,oa OIm'UT: OC,C9 RUN; O":l~ DATA II: 00:1l /' 0':C12 :Xl J_l TO S, eaCH L-oJ: CCC:4 K'OJ, OOCIS D1.Tl'Pt!!; OCCl6 END, OCC17 D\Tl'P\1T, DOCIe RUN: OC:i9

OC:J~l DArA B, OO:lOl /. Co~~3 00 ""I 1'0 ~: ~Jc~4 L-J, ~:;C~5 ~-"J: 0:006 0lJ'TP\1T:

~~~~~ &:~, "~"o9 "UN. c~u~~ DAr ... a: oco~1 I' ~~:;,~ 00 J_I ro 5, C~:l13 L-.J: ~:Ol~ ~;!, C:"l~ 01::»\11", ~::J16 t:.'D, C:l11 CLTI'IJT: oc0l8 IWN, OC~19

SAS Il<lp

"

'.'

SAS Holp

"

,/

Consider another example. If you type CC on the first line command field and press ENTER, the CC stays there and nothing happens. Type CC on another line to designate the block and press ENTER. Again, nothing happens, and the block copy is still pending because you did not specify where to put the copied lines. If you type an A on the line command field of the RUN statement and press ENTER, the copied lines appear after the RUN statement.

Information .... Ulabl.'

Co"",,,,," =>

~~OOI DATA B:

~~~g~ ~ J~l TO 5: 00004 LooJ, OCC~5 ~-J, 00006 CUT;>\!!, oceD7 END: cc~oa OVTI'U!, OC~09 RIJN, OCOIO CArA B: "COn /' "C~l< 00 J=l TO 5; ~C8'3 L;J, "O~14 ~-.J, O~Ol-5 OIJTI'\JT, ~COJ6 WD: "On1,) 0lm>UT, ~00l& RIJN, JOn9

ASSIGN ~,

~,

"

SAS 1131p

"

Page 8: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

Inf" ..... t1on .vaIlable,

c:; D.O.TA EI: C:;C~1 (' c::)", 00 J_1 TO S, ~:)J~4 Lo:J: C:J:)= ""-,, c:~:6 O<Jn'lIT, C:;~"' E1>1), C;00a oun'lIT, C".,C' RLN, C;oIC DA!A &, ::Jll I' ~;JII 00 J~l TO 5, C;OlJ lAl": C:)::i K-J, ~;Ol' O\JTI'ur, C:;;;;E END; O~Cl1 OIJTI'\'T'

~~~i~ R'-N,

COllllOand =>

!n!onuoU<>n .v.llabl.,

-~'" c;oPYI\ITi:

'/

,/

SAS f!elp

SAS Help

~~ ~~ =~, ~~ ~~~~ ~"" ~~~ O\S c:a-!?lftAlI ca.rrons CONVDlT COP'! Cl:lPl'RlTE CCRll -----------------------------------------------------------------------------

CC nATA B,

~~ggi 6,; J~l TO 5, O"~C4 L=J: ",005 K-.J, C;C06 otrn'lIT, C;C~; UII), C;~~U Oo.'!PlIT, CC~09 RW, ~DlO DATA B: CO~ll j' GC~ll 00 J;:1 TO 5; C;~ll !.-.J, C~~14 K-.J: OCOI50U'lP\!!: Q~:;16 END, C~QI7 OU'lP\!!, 00019 RW, OCO.9

Coozo.r.d =>

!~fo-",.tlon av.llable,

'/

'/

~~DN< ~~ ~.£m-sc ~~ m'jR~~ ~&.. ~3';'¥~ DIS CQo'P\!!AB CC>.lTENt'S CONVEll.T copy COI''I'R!T£ 0lRR -----------------------------------------------------------------------------

CC DATA S; oo~n I" CC 00 J~l 1'0 5;

g~~;~ ~:3; ~;~~6 Our?UT, :~~~? EN", ~;:ca OUT?\!T, C;:G9 R<.'N, ~;~lO )A7A e, ~'Q:t " C;~11 )0 J~). 1'05, ::OlJ [;;oJ, ::C14 K=-J, 0):15 a~-rFur, ::~: 6 ,~;:l,

~~cn OU'lP'JT, :J~IS RliN; :;C19

C=.nd=~

!n!~r"'.tlon ... lIable,

.,

"

SAS llelp

lc~n~A "PPnm Ul>\A '~~T'" At!'Ml>EC _ ,,"-""'SE c:.oJ.ENDAR CA:ICORP: =lS: ~T ClTIBAS~ CLEAR CLUSTI1I. Qo!.S COMPlITAB CIlNl'PIl'S CONVDlT COPY COP'iRln: c::RR

Co=.n~ ~~ Program £:Ittor

CC nATA e, OOOOl I' CC 00 );:1 TO 5, OO~~~ t=-J, OO~~5 K"-', OO~06 otTI'l11', OOCO~ Ef,'D, c~~"" OLTO'''," aaco~ RL'N, C~O::" DATA B: COOll ;' D001, 00 J'l TO 5: 000:) Lz.J;

OM., ~"""" OC:;:5Q\JTP<.1:, OC~:6 DID; OO~lC OlITI'\."r, cc::e RL'N, CC019

,/

'/

476

IMcr ... tlon .vallable,

lc'CVA APPEND ARIKA ASSIGN A\1roI!.EC IMlP !!ROWS!

~END.\lI; ~~AB ~ ~T ~IW! ~~ITE ~TD. -------------------------------------------------------------------

o~n01 DAt" e, OC~02 /' OGO". 00 J'l TO S; coo04 L-.), oooes K=-J; 00006 Otr.i'1JT; CO~C; END; C:~CS 0U'lP1)T, CCOC1 RUN; ~:~lJ DA,A e; OCJl! I' C~Ol> 00 J'l TO S, CGC:l DA,A e; CC?14 I' OCD1S 00 ),,1 "10 S" ::01& L=-J: coon K-.J; nMl~ OL..",UT, "~o:~ £ND;

Prog ..... !dHo~

'/

,/

,/

Now you can delete these extra lines and leave the DATA step ready to execute.

~AS Ihlp

Infor ... Uon .vUhbl.,

~:~"{" APPEIO ARI~ ASSIGN A\ITOREQ BMOP BROWSE CAl.~!O\lI. CIc>;CORII. CANl)!SC: O!ART C::Tle.t.SE Cl.EAR c:LUSTIR 0-:. OC1-1P1JTAB comc<TS c:or<VDT COP'! COPYI\In: CORR ------------------------------------------------------------------------------

Cco::.~e"d =>

[;A.tA e, optlo~ tloE132; 00 .1_, TO S, L=-J, K-.J, ""","."T, £N'D, ="JT, P~'N,

DA,A e, r CO J'1 ro s"

DA:A a, /' X1:~I:-OS; L.oJ: :{=.}, 0<"~~'T;

"""".l,

Pro!p"U Editor

,/

'/

SAS fltlp

~;CVA ""PEN:} ARI~A ASSICN A1JroREO ~ B!\OWSE CA:.EK:MIl CANCORII. =!SC O!ART CITIBASE CLEAR c:LUSTElI. = ~\Jl"J.1I CONTENTS OOHYrnT Cl>PY ccr~ITE c""",,

O~~'l DATA ~, ::):)2 OPTlCtI TL5~132: '"o~'J no ."1 ro s, ::3~4 L=-J, "::;)05 K~J, C:C:6 OU'lPy'T: ::1:107 EN:l; ::3,S RUN; C~:109 0::)~O C~:1~1 C~~"l c~""~l C::)~4

3S~:~ ~~:)~ 7

~~g:~

Now send the SAS source statement lines to the SAS compiler with the SUBMIT command.

~o~r:'~i S~~.;~~lo~ASs.J~R~t~~~: tOl' .~~as ~Nsii7~~'tia~ ~y (OOOODOOO) •

1 OU" ~: 2 X~l, 3 RUN:

ceo 0 PH x; OCO I RUN, ac] • DAtA e, CJ l OPTIt»! TLS~l32, v_~ -I r:o .1'1 TO ~, Dca 5 L=-J, C:O 6 "=-J, oC' 7 otnP<1T: ec~ 8 END, ~CJ 9 RUN, OCd " O"~A '" CGO 1 X"l; ::~ 1 RUN; C~~ l eGa 4

F.f.g ~ oc~ 7 C~U 9

Page 9: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

When the screen returns, your results appear in the log window, and the program window is blanked out and ready for more SAS statements.

Ja IUN: NOT!, na: DATA SET to:lFJ{'A HAS 1 Ol!5OtVATlOllS MD 1 VAAIABLH.

00001 CO~Ol CO~03 onoo. COOOS ~CG06 OOOO~

~~C~8 JOC09 ::010 g~gg CZOlJ CCOl4 OC01~

OC016 nCOl7 C~CI8 OC01.9

SAS Loq 18:05

Now move to the log window and browse the log. You cannot change the data in the log window, but you can alter the way they are displayed with several screen commands that you enter on the log command line. The commands recognized on the log window are the color setting commands, scroll commands, FIND, BYE, RULE, PRINT, X, ASSIGN, SAVE, and GO. These commands are recognized on every display manager window; that is, every command you can use on the log command line is also allowed on the the program, output, and help command lines.

The color setting commands allow you to change the color and attribute of four kinds of displayed data: the banner, the source lines on the log, the protected fields, and the unprotected fields. Banner fields include the dashed line, the word command, the window name, and, if present, the line numbers. To change the log banner lines to the color cyan with the underline attribute, enter CBANNER CU.

16 1I\Jli: NOn;: '!'HE t:lAlA 3ET WOIU<'P w.s 5 O&SERVATtWS N<D 3 VAR!ABLeS.

P,-oqram [dltor

The log source lines will change to white when you enter CSOURCE W_

477

:6 IIlm: :<OTE. no: DATA SET ..::RK.8 lIAS 5 oaSEliVATlONS »ID 3 VAAl:A.BL,S.

The other protected lines on the log change to white with the blinking attribute by entering the CPROT W B command.

co=an<l =~ <:prot v l>

16 InFN. NOT!: 'l'I![ DATA S[,!, \o01\J(.e HAS 5 OBSnVAT1ONS AND 3 VAAIA.B:ES.

Then you can change the lines back to yellow with normal attributes by entering CPROT Y.

Co= •• d => <:prot y

:6 Rlm: "07[, nG: OA1A SOT >iaU<.1I HI,s s OBS!J\"'AT1ONs NIt> 3 V""';M~'S.

c;;;;;;j-;:,;;;------------------------------------------------ --P;~;;;;-E~!;~;

If you want the unprotected command line itself to be purple with reverse video, enter CUNPROT P R.

Page 10: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

Co ...... nd =~ eunprot p ,.

16 II'""', NOTE, 'mE DATA SU WOIIK.8 !!AS S OBS~VAT!0N5 AllD 3 VMtII.II<.ES.

If your terminal does not have color, you can still change the attribute. For example, to highlight the command fi.:!ld, enter CUPROT W H.

C=.od =~ eunprot v 1\ SAS Log 14,!9

!5 !!IJI{: NOrE, na: DATA SE1 WO!!lell )w; S OIlSilI.VAtION; A.'I\l 3 VAllt.lllLES.

"""",.nd =~

The scroll commands are FORWARD, BACKWARD, TOP, BOTTOM, LEFT, and RIGHT. If you enter the FORWARD command on the log command line, the displayed lines do not change and the alarm sounds to tell you that you cannot scroll forward since the bottom line of the log is already displayed.

CO<=ord => forward SAS L<>g 14:10

16 RUN; );C1'E, nit DAn. SEt WOB.K.B HAS S OasEltVUIOIIS NO 3 VARIABLES.

478

Coc:oond => SAS L<>g U,20

16 RIJI{, N01'E: OlE OATA SET ..auc:.8 !lI.S 5 O!SntVAT!ONS AllD 3 VR.IAB['ES.

Proll'"lI' Ed1~or

BACKWARD causes the previous three log lines to scroll into view. You get a vertical scroll amount of 3 because the default scroll amount is set to HALF, and there are six log lines displayed.

16 RUN; ,,=, rHE OATA SET 1IO!!l(.8 lIAS 5 O!lSE!!VATIOllS /oJo1D 3 VARIAB['ES.

SA!; t.o~ 14,20

13 K..:I, 14 o,"":?"Jr: 15 E>ID, 16 R:JN:·

N07E, iI'lE ~TA .ET I/ORK.B I'.AS 5 OBSE!!VATIONS AN!) 3 VARIABLES.

You c~n ch~nge the vertical scroll amount by entering VSCROLL PAGE or some other value, SLJch as VSCROLL 2. The VSCROLL command changes the vertical scroll amount, but it does not actually scroll.

Page 11: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

r;., ... nS _~ YKI"Oll 2

13 11-.1, It am>I/l', 15 DID, a _I

NOtt, 1HE tlATA JEr wau:.1 HAS S OISEllVArIOOS A:ID 1 VAiIABLES.

Co.an4 -~

COOO1 OOOOl OCQQ~ 00004 C~CO~ 00006 OC~01 ~C~C8 00009 eCOlO ~~OI1

oeOll OC:;ll~ oeo." OCOl~ C~Ol6 00017 OCOl8 OJ:;Il9

U I/-J, 14 O\;l'PI1r, 15 ElItI, 16 1I1J1<,

NOTI: na: !lAtA SET WCIU(.B H.\S S OBSEllVArlctlS IN!> l VAiIAllLES.

u.s Lo; 14:10

i'r.gr ... Eclltor

c~;~;~;----------------------------------------------------;~;;;;-[~i~;;

00001 00001 00001 00001 ooco; CCOO&

g~~gi o~co~ C~OIO 00011 canl ceon COOH COOH OeOI. oe017 ouon n~Q:9

Now if you enter BACKWARD, you ser::>11 baek two lines.

C=~nd --=~ b.c'''.r~

U 1(:,): 14 ootPur; H ""0-a MiN;

NO:;;: '!HE DATA SET Io'ORX.B HAS S OBS!l!.VATlONS lIND I VAiIAllLES.

c=ooa"d =>

n OOJ_l'rOS; II r.-..1: 13 K"'J, 14 0UTI'1.7; IS END, 16 RUN,

Co"",aocl ~>

aoon aoon cooo~ 00004 00005 OC:lC6 ~~007 ,.-oM OCC09 C:~lO co,n 0:J12

g~~~~ 0~J15 OC~16 C~CI7 OCGlS OC~19

SA.! Log 14:10

progru Ed~tcr

SA!; L09 H,20

You may temporarily override the serol amount by typing BACKWARD n, where n is some integer value. You can back up one line by entering BACK 1.

479

SAS Log 14,10

1L DO Jool ro s: 11 L-J, 11 ~,

1. 0\JTP\1T, IS ENO~ U "UN,

Prow ... Editor

SAS Leg U,IO

10 OPT''''' 'TH:.112, II DO J~I ro 5, 11 L...:r, 13 K","" I~ OUTI'LIT, 15 END;

------------------------~----------------------------------- --------------Co",,~nd =>

Or you can back up to the beginning of the log by entering the BACKWARD MAX command.

1~ ::'IPT1ON Tts~UlJ II Xl J-l TQ ~, II t..=J; 1, K~J:

11 :>U'TP\T!, t~ END:

Com:o.a.nd =. Pro9Tu Eclitor

'"""and =~ Progr".m Ed'tor

Page 12: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

The BOiTOM command causes the last log line to be the bottom line displayed in the window. It is equivalent to entering FORWARD MAX.

SAl Log 15,48

~~~r;I~~ J~~$t~~3c}'tJn:;~;~~: ~~gi'a~alli ~Ns~ir5iil1~ ~,-y (00000000) •

1 DArA A; l~l; I RllN; -------------------------------

U L_.1J lJ "~J 14 otnI'UT; IS ENQ, 16 RtJ/I;

t>OTE, nlE DA!A SET wcruc.B HAS 5 OBSERVATIONS AIIO l VAAIABLES.

Pr>gr"-" E<lHor

Pr-ogr.", Ic!ltor

You can also make any particular line the top line displayed in the window by typing number on the command line and ENTE'L For example, to go to line one, integer 1 on the command line and press

Co=ono=> 1

l~ 1=:1, II X~; 1\ OUTI'UT, H ,NO, 1< 11-UN,

NO:-E, nlE OATA SET '(ORILB w.s 5 OBSERVATION, ANI: 3 VARIABLES.

the line pressing type the eN I ER.

SAl; Log 18,:>1

Pr.gr~ .. [<la>e

480

5AS Log 15:48

~l~ J~~.t:~lo~s.Jn:;~;~;: ~~gi·.~lli ~tiS~iritil~~~ ~y (00000000).

1 DA'IA A; 2 X='l'

------~-~~::------------------.------------------------------._-

Horizontal scrolling is similar to vertical scrolling. The HSCROLL command sets the horizontal scroll amount; the default is HALF the width of your screen. If you enter the RIGHT command, the log lines shift over only one line because you alre2dy had columns one through seventy-nine of the log on the screen, and the log data lines are eighty characters long_

COllllO.n<l =~ SAS Log 15,48 ColWlll"l 002-0BO

~~~rl~~ J~~si:3<)~ASs.Jn:;~~;: !~g;'.~·as ~Ns~i4Wt~~ ~t.Y (COOOIJOUU).

1 DArA A, 2 X=l: J RUN,

Froqr ... [<ll~or

The LEFT M command moves the window position the maximum amount to the left, that is, back to column one.

Page 13: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

eo ..... d =~ lett II $1IS Log 15,411 Colwon OOl_Oao

m'~ S~~,i~~'ori.Jn=;t;:: t~l' .~srs ~ilsii~l~~ kr

00001 0'l002 OlOO) OJO~4 OD005 OOO~6 ooco7 OJOOa 00009 OlO:O OOOll 00012 OJ013

g5gi~ Ol016 m017 Ol018 0)0)9

(CJOOOOOO) • ; Dl\rA A, ! X;:): 111l1li:

Co""".m =~ Progrn Edltor

Now suppose you want to ioeate a given enaracter string somewhere in the log, say the letter J. Type FIND J on the command line and press ENTER, and the system scans the Log lines, looking for J. It finds the DO J:::1 to 5 statement and does an automatic vertical scroll to display that 09 line sinee it was not already displayed. The cursor is positioned under tile first character of the search string.

Co"",,,nd =~ Und J so..s Loll 15,48

Cm:m:,nd =~ f'rOgr.,. fdl~oc

481

eo...,nd =~ 11 [lCJ~l:roS;'" 12 Lo-J; 13 K-~,

14 O!.."I'PIJI: 15 on: 16 RI.H,

Comm.nd ~~

~gggi 00003 OOOOi 00005 00006 0000' 00008 00009 00010 00011 DeOll OOOll C001'1 000" ~001~ 0001' C0019 00019

Prow.", HHoc

You can enter the REPEAT FI ND command (or enter FIND *), and the system puts the cursor under the next occul-rence of J that it finds, starting its search one character to the right of where it is when you enter the REPEAT FI ND command.

U DO J_lTOS: 12 LooJ: 13 K=J, 14 OtrTPU':: 15 EN!), 16 R'Jl'{:

11 to J_l TO 5, 12 Lo-J,_ U I('<J; 14 ClJ'IPV!, IS EtID: 16 RUN:

0000 000C2 000C3 COOC4 000C5 000(6 oooc-, oooea 00009 000l~ 0001l 0001' 00013 00~14 ""Ol~ 00016 OCD17 00018 00019

Co=."d ~>

to J'=j TO 5, LooJ, "~J, OUU'\J'l': =, RC"N,

SAS tog IS:4B

Program Edl~""

:~=.nd ~> Proqr ... Edit.,..

~~~~ ~ J~COI ~CC04 ;~o:;,

~g~~~ :Jc:a ::::J ;",,) ::Cl1 ::011 C:Ol1 GC8l'1 C~015

:JC~lO COli coolS c~n~

Page 14: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

11 00 J"l ro 5: I~ r....:r, H K"-.1,_

00001 OOCO: 00(0) 00004 00005 00006 OWO? 01lO09 00009 00010 00011 coon 00013 00014 OUO.l~ 00016 on017 00019 00019

II OIJ1'P\I'I; I~ END, 15 RUN!

If there are no more <lrgument, then you found' on the message

II 00 ]_1 1'0 5; II ~-J:

13 1(-.1: 14 OlIJP\I'I; 15 END, 16 1'1JN:

$AS Log- 15,fe

occurrences of the search get the note 'string not line.

C=cd =" Ptogr-~ .. E<lHor

~O"Ol

QC~n O:~oJ O;;~~4

g~!g~ ~;;~1

:::Cg c;,;~

~;n10 C:;Jll GJJ'l C;~lJ

0':l4 :,015 ~:n6 :'01; ~C~lB ~;~;9

Co=.".d -~ ~C;E' S!l<lNO J NOT £0=.

11 00 J_l 10 S: 12 L-J; 13 ~"-.1: 14 otm>trl': 15 ENt:: 16 RUl<;

The FIND command can take an optional operand following the search string: PREFIX, SUFFIX, or WORD. A word is any string that has a delimiter on both sides _ A delimiter is anything other than an alphabetic letter or a digit. A prefix is any string that has a delimiter on the left but not on the right, and a suffix has a delimiter on the right but not on the left. There is an assumed delimiter at the start of each line. For example, if you enter FIND PUT SUF, the system finds the suffix PUT in the word OUTPUT.

482

~~:;:~'tTI<7~ § 1::5~ ~~. 11 00 J"l :"Os; 11 L-J l! K~; 14 ot."!?UT: 15 END, 16 RUN:

11 OOJ-l"roS, 12 L-.1; 13 K"-.1, It 0lfIP1JT; 15 ENO, 1& 1O.1.'N,

C=anj =>

~GCOI C~Ol cc;Ol ~:~04 ::;~5 CC:·J& ":~Q7 ,c:~a

:::~9

gg~!i C~~12

ggm GG~15 o~"6 C~n7 C::ll9 OC;,,9

The BYE command ends your SAS session. The RULE command causes the rule to be displayed on the message line when no other message is pending.

The PRINT command sends your currently displayed data lines to the printer. If you enter the PRINT command here, the note '6 lines printed' appears.

" " H

i~ "

00 ~~l 10 s: LaJ; K-"J, otrI1'lJl': u"', RUN,

Page 15: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

n~aQl

0000% GOOOl

Egg~: G0006 0"007 ~::C8 00009 eCOle n3011 0:012 CC~lJ ~COl4 C:Ol~

ce016 G0017 ;)vOle GC:19

6 Unu pd"t.d. DO J'"I 1'0 $; L-.J, KaJ, 0I.fI'P1J'l:: ~,

RUN:

You can print PRINT ALL.

off the entire log by entering

C""",ood ~> prlot .n SJ.s tog 15,49 NO!E, 6 linn priM"".

11 DOJ~ll'OS, 11 ~, 13 K-..T, 14 OUTPUT, 1~ [ND, 16 ____ !:~:. _____________________________________________________________ _

C=m.nd => NOr[, n lines prlntoci.

ro J~l TO S, U

" " ,. " "

00:)01 OO~O~ 00003 OCC04 COOOS O~OO~

Oe007 C~:~9 OO~09 O~lQ

aoon CcLl" 000!3 oon4 C.~Ol~ CJ016 CC017 OCOlS CC~l9

~, J(;=J, romn, ~,

""N, proqr ... ~dnor

The X command calls the host operating system and passes to it whatever you type following the X. Type X SHO TIM and press ENTER.

Co=~,d -> " 01", U .. N07E· 2l Une,. printed.

li r-..T~~l TO 5: 1] K-..T; 14 OllTPUT, 1, ~ND; H RUN,

C,,.,,.n4 =>

483

c;o .... nd =~ 10-ocT-IH3 UItU,)6

amiD, 00002 00003 00004 OMO~ 00006

gg~~~ OC~~~ 00:;10 00011 C~Oll O~Oll C~~14 O~~lS 00016 CeDI? OCOl8 00019

11 00 Ja1 TO $: 12 t.-J; U K:.J, 14 OllrPUT; 15- tN>; Hi 1I.\JN;

This command date and time the cursor is aware of the

causes the system to display the on the line following the line that on. The display manager is not

fact that the VMS, the host operating system, wrote anything on the screen, and if you enter the REFRESH command, the display manager erases your screen and returns it to the way it was before the X command was executed.

Now suppose you want to copy the log lines to a data set so they will be available after you end your full-screen session. First assign a logical file name to a data set name with the ASSIGN command, such as ASSIGN.MYLOG.DAT LOG and press ENTER.

11 DOJ"1 '1'0 S; .2 L...J, 1] KOOJ, 14 0\I1P\JT; 15 ENO, 16 Ilut-',

Cc= .. c.d => Pr~'l""n f<1ltor

C~~OI

~~3;~ C~:~4

gg~;~ c:::., 0:::6 ~c~~9 ::::~ G~~ll C~~ll ~JJll C:~:4 CJ~:5 000:6 C~J:7 C~O:9 :C,:J

11 DC J_I TO S: I~ L-..T; 13 K=.!· 14 OI.;TI'UT, 15 E)/[); 16 RUN;

Cc:::t.nd =~

SAS Log 15,50

Progra .. Edltar

Page 16: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

Then you can copy all the lines in the log to MY LOG . OAT by entering SAVE LOG.

Cc:::<anc => save 109"

00 JmJ ro 5: (.;J: K-.J; ot"TI'VT, l~ll: Rl~,

Coo=a~d ~~ Ncn, file [00 .aved.

11 ooJ:lro.l: 12 DoJ, 13 K-.J: 14 CtJTP\17, 15 Th1), l~ RIJN:

Notice that after command, a note saved appears.

S1.S t.og 15:50

Progr-o .. [<11 tor

you enter the SAVE LOG indicating that the log was

Finally, you need to be familiar with the GO command, which is used to transfer to a new screen without displaying any intermediate screens. Currently the only new screen you can go to is the output window, so type GO OUTPUT LINE to get to the SAS output window containing your printed output. Add the LINE keyword to get a command line and go into line browse mode. Line browse mode is the normal processing mode for the log and help windows. Page browse mode is the default for the output window.

~IT~t~li':=:oe MP~;v~~

O~OOI 00002 ~on03 0"004 C:~05 o:oo~

~~gg~ ~~~~9 C:ClO OCOll CC~,1 0:013 CXH OwlS CC:16 GOO17 000:8 COO;9

11 00 ):1 ro 5; Jl L=o.J, II H-.), 14 0lITP1Jf; " mD, 16 'UN,

Sl\S:.og 15:50

484

:;1\,$ Outpu<

5-'5 15:39 rlIIO"Y, ocrot!lll'. au

'"

On the output window, program function key 4 is a toggle switch for going from line mode with a command line to page mode without a command Ii ne.

'"'

To return to the log/program screen, press the END key, program function key 3.

ii " " " "

00 J:l 1'0 $, L-J, K;J, OU'IPVT: [NO: RIJN:

Proqru [dlto~

There are commands you can use on the program editor window only. The RECALL command used on the program editor command line recalls all the SAS source statements typed since the last time you entered the SlJBMIT command.

Page 17: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

CO""",,,d -~ SM! Lo~ IS,S)

11 !XI J~1 1'0 5, ,1 L=J: 11 JCo;J, H CVI'P1Jf, U END, 16 R\JN,

U OOJ:ll'O~' lZ ~,

1] K=J: 14 0U'll'~"r' U ~ND: 16 BUN,

Co""""n~ ==>

coon !)..ITA B; OOOJl Oi'HON n.S-13Z, aOO~l 00 J=1 1'0 5, COC~4 t.;; ''''O~5 K:~' ~O~J6 OUJ!'UT: CaCJ7 END, C,~"9 Rtm, OCCJ9 OCOIO C~~ll oeOH COOll ~~J14 ~JJ)S CC~16 O~~17 OO~18 OCOU

Enter RECALL again, and the display manager recalls the lines typed since your next-to-Iast submission, putting them in front of any other lines in the window and causing the rest of the lines to move down.

g " " " H

00 J=1 to S, ~,

K=.1, 0UIP1Jf, El>'D; ~UN,

c~C)l DJ.t" B, OCJJ2 OPtiON n.S~lJ2: C~J)l DO J=1 TO S, CoJJ'4 L-..I, C:~lS K-..I: ~u;l6 OU1'?UT, eel? END,

~~3~: R~"; C~J:O C:O:l C~"" C:OlJ c~a CoJ,S C~:;;6 O~~17 c~~:e c:c:9

11 00 .1=1 to 5, 11 !.=.}, 13 !(>oJ; It O\I'IPut; IS END; 16 JUN:

O~OOl noc COWI:T, a~002 PIE )11', Q~:;'l RUN; 0:J04 DJ.T" B, JJ:l~S onION TLS:L12, ~S~C6 DO .1-1 :ro s, J:S07 !,:oJ, ":l"r.~ "....." :;e009 ctm'UT, e:~l(; EN!); e- ,11 RUN: e;nz ~:gt~ COOL5 ~OOI6 OO~17 CJOI@ onOl9

Program E<1l~or

SJ..S L~ IS,SI

485

You can continue recalling until you receive the error message no prior submit', which indicates that every block of lines submitted since the start of your session has been recalled. After another SUBMIT, the recall function returns the screen to the bottom of the stack of submitted blocks of code.

II DOJ~l:roS: l~ L=.1, II K-..I, '. Olo"TPlIT, ;5 END; :6 R\JN,

0"":)1 PROC OOWIT, OO~~2 PIE X, m"~l RUN, C;cC~ O"'U B: C;COS CPriO'! n.S;013l; e:0;6 00 J~l to 5,

~~~~~ ~j: ~'O-~ CV~P\II;

O;Jl~ E~",

g~m ~'~, C:J:J ~"~'4 ::~15 ~~OI6 O"~t' ~~O.8 ::~:.

11 no _'=1 TO S, 12 r.-J: 13 K:.J, 14 0<;71'<1'1", 15 END, 16 RUII,

O~:Ol I'ROC PRINT, C:lOS2 Rt..'N: COO"' PRCX: CC!W\!', :~SS4 PIE )11', :::C, RW, '-_~~~ Dl>r~ II, :::~-, :JPTION nS=l:i2; o:ssa 1)0 J'l Ttl s: :::,~ L;:J; "~:;ia K~J, :::11 ~l:TI'\IT: ~JO:I f~':J, :::lll RJN; ~:>o'" l~Ol: CSJ16 ,~Oll

,,:c:s ,~, :I

" " " .. " "

00 J_1 to S, L:.J, K:], O1.::"?<I'I": EN:>, RW,

1::0: PROC PRINT; ;~;~1 RU'N; :~c·" PROC =""""r, l:~~\ PH X; ~~:c; R~'N:

~~~3~ Dl>l~p~bN 7_S~1l2, ::::oe 00 .!=l TO ~, ::~~~ L:.J: ':J,J ,,;:J;

OL7?<-.: E),';),

R1..'N:

11 00 J=l TO $: 12 1rJ: 13 K=J: l~ OUTPUT; is END; 16 RUII,

ceon OATA A, OC~02 X~l' OOO~l !l.L'N: CC~~4 PROC PR:NT, o~~~" RUN: JDJC5 PROC GOWIT, CO~O, PIE X, OOOOB i"JIl, 00009 OAT~ s: COOlO :w- ION nS~U2: UU:Jll :x;; J_l TO ~:

o~al2 !,:oJ; oe013 K;:J: CJ014 O\JTI'UT; 00015 gNP, 00016 R1JN, CeOl? 00018 GDDl9

SAS LOll U,Sl

Program E~ltor

Pro!1'"am t<11tor

s.o.s Log 15,51

SJ.S Log lS,Sl

Page 18: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

I t f [ f

f f

~ggl~r"'; C~c:l RW, CCC~4 nIX: PRINT; C~~:5 ~W,

gg3S~ ~~r=x~'ti' C~:~9 Rl'l<, C;:09 DA~'" B, ~:~.J OF-:"IO)l T_S~132, C:~ll 00 ~_l 1'0 5; O~~12 L...:I, ~C:lJ K-J; c:~14 ClJ'IFUT, .~c:" "'.-0, C;;:6 RUN,

~~;1~ C~C19

11 DO J"I 1'0 51 12 L-J, 13 K-JJ H O\T!?\FI', IS EI/tl, 16 RUN;

Co:;:'),n<i =~ recall IA"''"'': No pr,or ",,,, .. It c~cn DATA A; OCQQl X_l, c .. OJ l<\IN: 000:4 ?1lOC PRINT, ::~t;~ RW, OC~:6 FRee CCHAIll, ::,"07 ?if l(,

~g5~; a..'-¥i 8, c;:~o cprIO~ 1".5-n2, :~::.; 00 J_l 10 5; ~:~~: L_J; cee:) IC"";; ~"HI D,...,..lIT; C::)1; E."':l: CC~!~ R~'N; cco" C~J:8 ~;;;:1

Progrn E<l!tor

Another way to get previously executed lines back into the program window is to use the COPY command. Type COPY on the command line followed by the first and last line numbers of the statements as they appear on the log, and those lines are copied into the program window at the bottom.

~c~c~~ J~~s::3o~JnR!t!~;: t03'.;"SXs ~Nsii~'~in£.Ji. ~y (OOCOOOOO) •

I DATA A; 2 X~l' 3 RUN,

---~---------------------.--------------------------~--- ---------------C~=.nd => copy 1 3

::~o~ DATA A, O":~l )(~l' ~:co, R\..", :c:;. p~oc PR1NT; :::~5 RL.,,; ::~~, ?~OC CCHAlt'l, C::)7 PIE x; ::c:a R~~; ,"~c. ;,~"" e. c:~l" C?T:Cll TLS~1l2: C~::~ 00 J'l ':'0 5; ~~'" L~; :~~:l K_J; ::~:4 mrr:>UT: c~:'5 t~'D; ::~:" R\JN, ~c~ll

~"~:" ~~~11

~CO~l DATA A, G":~l X~l, ~OD:·3 RllW, O~::~ PROC p~lIn, 00005 '"'''' O~"~6 P~OC cot.\Jl:T: CJ:~7 PIE X: o::,a RUN, C:::'l DATA e, CC~JO OPTION nS_112: ~OCll "" J_l 1'Q ~,

C~012 Lo;J, ~C013 K~, ~:D" OL'll'V'I, ~""JS END; C:J16 II~'N, L~u;1 liATA A; oo~:a X~l;

C~;;:, R~'N";

486

COpy followed by a logical file name brings in an external file. For example, ASSIGN the data set TEST .SAS to the logical name TEST and follow that command with COPY TEST, The lines from the external data set TEST. SAS are included in the window at the location 'specified with the A (After) line command. When the logical name is unassigned, the display manager automatically assigns logicalname,SAS.

Co=and"""~ 0501'1" ust.s .. test

coon DAr ... A, OO:Cl X~l; CC~D RUN: 00::4 PP-OC PUm', ~::~5 IIW, :·:C~ PROC =T, o :~" PI;: x, C.::8I1UN: !;:::'i D.o.; ... II: ~o"'o OrtlON ns="", ~:;Jll 00 J~l ':"0 s: CJ~;l Lo;1: c:",3 K~; C::14 OU'TF1JT; ~;;:;5 END: ::0;0 R~"" O~~17 DATA A, ,:o:e X_I; ~::Jl' R~"lI,

Proqru EdItor

18:04

~m";l~l J~~.t:~3ort.ln~!t!~;: !~~]'"~°St ~i;rii!,~~l~irr~ ~y (CO~o<OOO) ,

1 DA'lA A; 2 X_I; 3 lIiJN;

CQ=an<i => copy test

00001 DArA A, ~C"aJ Xsl, .CO~3 R1.'N: C~:C4 PRX PRIm';

gg~~~ ~li';C COlART; ~~~~7 PIE )(; C:C:B ;teN, C:J:9 DArA e C;;J10 OFTlON ttS_1l2; C~O!l 00 J~l T::l 5, C~J:2 LooJ, :~O:3 K~; CO~14 O:.rTl'lIT, 000,5 E~: C~n:6 R1.'N, oCO; 7 OA~A A: C~Q:II X~.: ;;:):9 ~ut\;

Prow.,. Edtocr

Page 19: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

OOWl Dl\tA A; 00002 »01, OOCO)1WN; OO~04 HOC CLM IIA'U.~B, OOC()$ MODEL J=K; OOC06 lVII, OOCO~ r~oc PRlN!, ooce8 ~UN, OC~09 rROC t:CHAP.I; "~ClO PIE ~, oaCll /WN, OOC\2 01.1 .... B, oocn OPTION n,s'1l2; OOCl'" 00 J:l '1'0 $, OOC15 ,.-.1; OOC1& K=J; OOC17 01.m'1Jl'; ccole tNI), ~~~:9 11.1.>'11,

The other lines in the window are pushed down, and you can view them by scrolling FORWARD.

~:f;:r:l~~ J~~$t:~3o~A.S~~n:;\:;~;: l~gj·.~·lli ~':'s~i~~l~N~ ~1.,{ (00000000) •

1 DATA .... , ~ X-I, 3 RUN)

cc=-~~-;;;;;.;-;~;~;;;;--------------------------------------------p;~;;;-i~jt~~

O~~Ol 0'1 ........ ; C:~02 X=I; '~;~QJ R'JN, :~<)I)4 P'OC (IT}' DATA:II; C~.1!l5 MODEL ~:K; C~~6 11.,,11, cc""~ ~~OC PRINT, ~;~:a ~JN' ~::,;;~ noc GOiAF.1:

"""'" Pj~ ~, ::Jll R'"~, ~:J12 :>,~: ... D, ::~:l O?:ION :n.S:132: 0:~14 00 J=1 TO S; ~~Ol§ ~...."

~~Jl6 K-J; O~:17 0U7PlIl'; ooO,e END, 00019 RUN;

C=.nd=>

C~~lO PIE X; nnmlRUN, Q~011 DArA B, coon OPlION :n.S:132; coO'"' 00 .1-1 TO 5, CCOl5 L-.J; O:~16 K",;, U~017 Ol,iJPUT, CQOl9 =, CCO:9 RUN; OG~,O D.O.TA A; COOll X=I: ~c~'" RUN, OCOl3 000.4 COO.S oco.6 coon C'~~,~

rr,qru EdItor

The OUTPUT command is used to control the automatic display of printed output pages when your submitted SAS code contains a PROC step. Type OUTPUT OFF and press E:.NTER. Now you can execute all of this SAS code, but no printed output is displayed. (Graphic output is not affected _)

487

ColIC''''' =>

---------------- ----------------(;o ..... n<l =. ""~P"C "H

C0010 PIE l' OGOl). RUN, 0001l O ... TA II; DCJll. WI1CN :n.S:131: 00014 00 J~; TO S, 00015 L",;; 000,6 K"-', OOOI~ v.r1'Ptr.; Ol~19 [~'D; OJOU ~'.r.<,

c~:.o DA'!'A A, ce~l: ~~1; ~COH RUN; oeon r'.'H C~025 0:016 <l002' CC02S

OC010 PIE 1; GoOll aUN, C~J12 :lATA II; cC:ll OPT10~' :n.S-U2, C~J14 00 J:l TO $, CO.,lS L"-" C:016 K<J; V~017 01'TPl11; c:~:8 EriO; CC~19 lUN; C:C2~ ~ATA A; C~~'l ~:l; C~~21 RUN, ~."'''1 CC~14 D: 25 00.,6 OC027 C:OZ8

s.o.s Log l~'OS

Even with OUTPUT OFF, your printed output is still there, and if you want to see it, simply enter GO OUTPUT_

SAS 1.09 \0,0,

,e R~, ~CTE, 1HE DATA SET WORK ..... 1t'-S 1 CBHltVAnONS ANll 1 VARI-'BLtS.

Proqr ... [dlto<

Page 20: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

Note: on the program editor command line, the OUTPUT command not followed by either ON or OFF causes the log or help window to be replaced by the output window.

When browsing printed output in page browse mode, you can go from page to page by pressing the program function keys for FORWARD, BACKWARD, TOP, and BOTTOM. TOP takes you to the fj rst page of output for the cu rrently displayed procedure. If you are already on the first page, the TOP program function key displays the first page for the previously executed procedure.

::>Ei'r!IDEN': VAIlIA.BLE, J

SO'Ja~E

~" ~,~

:caUCTm ro~.u.

10.00000000

0.00000000

10.COOOOOOO

mE ISS

10.COOOOOOO

0.00000000 1.00000000

99999.99 99999.99

57;MATE

tOOt'OO OOOCOOO

SUM OF SQW,lES

10 .00000000

0.00000000

10.00000000

"!WE I SS

10.0(000)00

T FOR H), PAPJMETD.=O

~ SQUA.RE

10.00000000

0.00000000

r vALUE PR • F

PR > ITI

,~

t:ENEJlAL LINEAA KDrt.S PHoc"""

10.UOOOOOOO 99

O.OOCOCOOO

r VALUE

PR ) Il'l

PR ) r

SAl; o...tput

PlI. ) f

0.0000

Koor 1'15. 0.00000000

typE III

10.00000

In page browse mode, you can get a command line at any time by using program function key 4, and then you can execute line browse mode commands such as FIND.

Co"".nd => f1~d IH

CORlu:cn:D rorAL

i!:TEECEPT , O.OOCOCOOD 1.0C~OCOQQ

st.~ Of SQUA!;ES

10.00COOOOO

10.00000000

l""<l>t I SS

lO.OtDOOC·OO

T FOR m: cA."-'\M!:TEI<=a

999~9.9g

9j99~.99

SAS o...t?ut

CENElIAL L!NE./JI. IClDELS PROCruu

I!U.N SQU.olIE

to . 00000000

0.00000000

r vAlIJE

SID 0. t>TI

488

p< SI. ... OF SQUARES

STII>IA.TE

::C:lOOO OCOO~OO

10.00000000

O.OOOOJOOO

10.0000JOOO

~~! SS

10 .CC"CO~CC

T FOIl. ;ro, PAl'A"..,TE;R=O

999~~.99 9999).99

c:EN!RAL LINEAJ IfX)!U PROCEOORE

HEAA SQUAiU!

10.00000000

0.00000000

PR > ITI

SAS o...tput

0.0000

,=~

0.00000000

TYPE III

10.00Coo

Back on the program editor Window, include your TEST file to show the CHANGE command. CHANGE A B changes the first occurrence of A to B. CHANGE * does the REPEAT CHANGE function. Also you can change every occurrence of B to A by entering C B A ALL.

Ja RUN, NO:., ::HE DArA SET w:;lIU(.A HAS 1 aeso.'/ATlONS AND 1 VAP.!.o.aus.

c;;;;;~;-~~-~~~-~;;~------------------------------------------p;;;;;-r;;l~~;

le RUN! NO,t, nlt 0}o.1.o. sn WCIIX .... ItA.S1. O"S!;II.V.o.UW5 AND l. VA!l.11\.!I~I.S.

OC~Ol FIlO(: Cl.I< DAlA~B, OC~Jl MODEL J=K! ~C~Jl R~"N; OC;~t

~~~gi :CC07

~~~~~ C:J:~ C:~:l :~~:l

g~~;~ ~:~l~

":;o.~ oon, ?

":0.8 OJOH

38 R\'"N; NC:r, n!I: DJ":A sn OICiIX.A!!AS 1 oasEIIVAl'l0N5 »lD 1 VA!l.1AJlLES.

:COOl PROC G!./" OA~A=B; :""~l "'-XlEL J~K; :::n 1ll!1<; [:~~1

;;~~O~ C::C~ (oo~?

C::~8

~~5~.~ ::~ll C:~:2 [c~ll

i;5~~ ~::: 16 [::17 (O~'$ :~J19

SAS 1.00; 18,01

Page 21: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

00001 PROC ~ DElTA_D; OOOOl ~EL J_K, 00003 \l.UII; 00004 o~oo5 00006 00007 00009 O~OQ9 ')o~lD O~~ll ~~Oll )~nJ

""~'4 ):)015 ):Jl& ~OOl? :JOI8 )0019

eo=nd ~~

39 RUII;

s.o.s Leg 18,07

NOrE, lIlE [lArA SET ~.A f!AS 1 CSSE\l.VAT1ON5 AND 1 '~AAlABUS.

c~;;';;~~-";;;;-~i;;~q;-;-------------------------------------------;;~g;;;;;-i~~~~;

00001 pl\OC CUi IIE1TA_D, DeOOl MOC~L J~K, C~OO) R[}I;, COO~4 ~c~cs CC~:l~ ~CCO' ::"~a S~:J9

::~~,~

:::ii ~~":J ::~:; :O~H

,~O!s ,C~l' ,:~18 OCJ,9

:=.nd ~> c b • all

'0001 VI ...... ~I.Jo! nlmL-B; J0002 MO:)EL J_K. JOOO) IUN, ,~nc.

)~OOS ;O~D6 :~il07 :~~:a ,0'09

~~g~~ r:Oll DOOll O~014 D~~15 00016 OD017 O~01a OuD19

Co .... nd~,. US Log 18,07

38 ~UII, NOTE, '!HE nAtA st~ WCRK . .\.!WI 1 0IISE\l.V.\.7HJN5.AAD 1 VAAI.\BLf:S.

OCOOI PJ:OC ct.M DAT'\-'\" oc~al ~EL J=JC; 0000' ."'" 00004 ooOO§ O~O~6

~ggg~ CCO~9 OOOl~ ~enl GC~l1 ~OOlJ ~0014 00015 00016 00017 CC~18 OOOl~

The CAPS distinguishing letters.

OFF command between upper-

is useful for and lowercase

489

00'01 PIICC rn.M DAr...".." C:;Q02 I'ODEL J·K, ~ocoJ 10.'"'" C:C04 ocoo~ OC006 C::'07 ~~CC8 ~~:09 0:010 QD~ll

C:,ll JCCll CC014 O~(15 ~~vI6 ::;~'117

~~O,9

OOOlQ

CC~Ol PIIr>C CIM o..o.T~-", O~~G~ MCXJ£L JxK; O~OJ3 ~I..IoI; C~n04

g;~g~ ~~~~~ ::~:;q

0:);):0 ~~;):l

C:~:l COO" C:::':~

m:~ E~3:~ CCJ:~

C~=.n:l => e· .. · ·z· .11

DD~OI ?ROC cU; O"r"~A; OC~a2 JoOIlEL J_.{, GGJ03 I!L'N, ~gg~~ (" comment '/

OCOC~ 00007 ococa

DCCOI Pl!OC C'Jo! DA~"=", OCC02 MODeL J-~, cem] 1!1/N, OCcO", r ~QU""t '/ Goec, n~oo~

~OCO' ooeos

!!AS Lq; 18,07

progra: EdItor

Finally, the NOFS command takes you out of the display manager and puts you into SAS line mode. It is the same as OPTION NOSOURCE NOFS command except that it also causes the screen to be cleared and display manager memory to be freed.

Page 22: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

?ROC GUO' ~n"A; "0001. J=K; R~~;

/' CoHent '/

To resume the seSSion in full-screen mode, enter OPTION FS;.

To complete your introduction to the ability of the display manager to save you time, examine the program function key command equivalents, which are listed below.

490

Pressing program function key is just like typing HELP on the command line and pressing ENTER, To save time, you could type HELP ANOVA to get help on the ANOVA procedure, or you could simply type CHART and press program function key 1 to receive information on PROC CHART.

A.~~A

~~a ~~~ ~c~i~~"~:c~~o~~s ~::t:.!~t~f ~:;l~;~ foe balonCed PROC NlO"A • DATA_SA.5 ... tnet >,

< cr..o.sSICIJo.SSES ,'uhbles; ~

~fJt,,~·~~n~~;·~Jf~ <~~~JEL R~GWf RE~ SOiHH SIDAJ; SIotIIC'tZ SNC TILSD nIKtY AlJ'1iA"P ~ER J[RATlOo<valu. liNES CWIH NO~T Cl)I E-effoct >, >

< ABS0lI.5 •• cl.al:>les, ~ < f1I~Q ",'1:01>1 .. , ~ < TIST Ii" !f~~u E~~H~~~' > < ffJ,.'IOVA H~dt.cts E-.f!.et ~ < I PUtlnl PR:Ntt~, < 1I~ yorl.al:>les; >

ih~ ,"....,..'.1. pc<)<;ed~,. ~ .. ""', ... onalyah 0' nrhn<a 'or t>o.l.",,"" d.~. tCOII • ~1d. vul.ty of experlmMlul d<oS1gns, eROC N/OVA ~ DATA~SASdnu.~ >,

< (::Xi'ICl.ASSES vac':oI>l~" >

~J1,ie~ri~~;'~;fe~ <~.hiim RECIIF RECWO Sc:;.(E~fE S!DAX ~Icn SNI( TILstl Tt.1CEY ALPIIA"PIoIALLD. KlI.All00<v.lu. LiliES ClDIf~ NOSCllT CUI f:eff.c~ ~, ~

< ~SORB vac1ab:"., ~ < [R~Q var1able; ~ < r;:ST H~@f!ec~. E:effe~t; ~ < V-'"-"o ...... < :-I-.t'.."t. ':eH.et ~ < / PRIN'IH PllIN1T~, ~ < BY v.riables; >

~,

TI'.e ow.r prc~.~"c. p'o~,,~u vect1<al one! hoTi%ortUl bar chart' (01<0 Hlled hh'og' ... m~l. bl",,~ ~ho~u_ pl. "h.cu_ oftd .~.~ chacU. pj1,OC OWT < D"T"~SASd.t .. et IJ'I"I1n../col""",. per l~ch >,

< IV H~''''l •• , ~

< "~uP~!~!:~.\~6~on~~~l!""IC=t"'~c~ ClCO As<:£NDII'G OfSCENOINII "~r_.I .... IfOllP.o,u~, ~

< ~Q1...p~!~~~. <S~~:r"abl~~~~~·r~lOC AScrro;)oI\; Do~<:WOIN:: II.Er-vdu. NesTA. nlEQ o;::nu;Q PU\CUIT CPERCENT SI..'M _~, ~

~ s~ogt?~;~t"~~: Stb'~~:,.r~I.L£~~Tzl:R~~I\I~'

SAS I{.olp

SAS :ielp

PrQgca~ Editor

$AS Hel"

----------------------------------------------------------------------------

Page 23: control program that greatly enhances the productivity of ... Busby.pdf · control program that greatly enhances the productivity of the SAS programmer. ... ~CCl' ~~Ol~ CCOlj Ca»nd

Similarly, program function key 2 is equivalent to PRINT, and program function key 3 means END on the output window. Program function key 4 means RECALL on the program window, but it means command line t0991e on the output window. Program function key 5 is for FI NO; program function key 6 means CHANGE; program function key 7 is BACKWARD; program function key 8 scrolls FORWARD; program function key 9 is the split key; program function key 10 is LEFT; program function key 11 is RIGHT; and program function key 12 moves the cursor to the command line. In addition, the ENTER key means SUBMIT when there are no other commands pending on the program editor window.

All of the program function keys, including ENTER, are attention keys that cause the display manager to gain control. There are also some screen editin9 keys you may find useful. The home key puts the cursor on the first u np rotected field of the screen; ref res h redisplays the screen; the line feed key erases to the end of the field; and the backspace key toggles insert mode.

To exit from the system, submit an ENDSAS statement to the SAS compiler or enter BYE on any command line.

TIl. QW<, p~o<:edu'e produces vartlcal Ind horlzonul bar chern J~;:~.:.ll..:l MBtogr ...... j, bl<><l< chuts. pIe Chan., and .Ur

PROC 0iAA1 < ~T'>'~SAS<i.t ... t U'I·llnes/col",",,~ per Inch>, < BY .arlablu: )

< ~:m~!~!bi. <~6bP:.;~t!~NO=r·~~tios (:100 A,!;:ENDINC OESCDmlNC REF"V.lu IIO!H''-CE >, >

< ~~~!~!~~. < ~~:.~i~l~E"~~E~;;o~ar~lOO A,S:C:NC1N(; O[~~eNDI"" ]{[r=vUue NOH'>'T fR~Q qREQ PF::~tN1 Cl'ERC£N7 SUM ~ >, ~

< ·~~~~:t~j: SukR&'~::;:~l~l" t.~~;ooL 'im~~sh.r·

O;~"l C~~$O~' ;;",01 "O~:J l""~t lCnDS cocOIi QOn07 Juooa

!'On: SAl; INS1l1\lT£ INC •• SI(; CDlctE, BOX 8000, CAP.~, N.C. 21SU-EWOO ,

SAS Hell'

491