***************************************************************;
*** CONFIGCRS.SAS ***;
*** This program need only be run once to set up menus etc. ***;
***************************************************************;


data _NULL_;
  HOME=sysget('HOME');
  call symput('M_HOME', trim(left(HOME)) );
run;
libname HOME "&M_HOME";RUN;

proc pmenu cat=m.m;
menu FSV1;
  item 'ACTIONS' menu=ACTIONS;
  item 'HELP' selection=hlp;
  item 'KEYS' selection=key;
  item 'QUIT' selection=q;
  item 'CANCEL' selection=can;
  selection hlp "FSLIST '&M_PDIR/HLP_FSVIEW';setpmenu m.m.fsl1";
  selection key "FSLIST '&M_PDIR/HLP_KEYS';setpmenu m.m.fsl1";
  selection q 'END;FSVIEW;END;'; ** Necessary to end Multiple sessions **;
  selection can 'CANCEL;FSVIEW;CANCEL;';
menu ACTIONS;
  item '-' selection=nd;
  item SCROLL menu=SCROLL;
  item 'GOTO VARIABLE' dialog=gt;
  item 'HIDE (Variables)' selection=vh;
  item 'SHOW (Variables)' selection=vs;
  item 'BLOCK INFO' selection=blkinf;
  item 'EXTRACT' dialog=extract;
  item 'PRINT' menu=prt;
  item 'SORT ASCENDING' dialog=srta;
  item 'SORT DESCENDING' dialog=srtd;
  item 'WHERE' dialog=whr;
  item '  WHERE ALSO' dialog=whra;
  item '  WHERE UNDO (LAST)' selection=whru;
  item '  WHERE UNDO (ALL)' selection=whrc;
  selection nd ';';
  selection vs 'show var;';
  selection vh 'drop;';
  selection blkinf "wdef 1 1 &M_SPLTT 80;FSVIEW work.block work.m.fsvbr.formula;
      wdef &M_SPLTB 1 &M_LROW 80;setpmenu m.m.FSV_BASE";
  selection whru 'WHERE UNDO;';
  selection whrc 'WHERE CLEAR;';
dialog gt '= @1';
  text #2 @3 'GOTO: (Enter a Variable to "go to" )';
  text #4 @3 '  >>';
  text #4 @8 len=8;
  text #6 @3 "EXAMPLE: ADID";
dialog srta 'SORT ASCENDING @1';
  text #2 @3 'SORT ASCENDING: (Enter a Variable to sort by)';
  text #4 @3 '  >>';
  text #4 @8 len=8;
  text #6 @3 "EXAMPLE: ADID";
dialog srtd 'SORT DESCENDING @1';
  text #2 @3 'SORT DESCENDING: (Enter a Variable to sort by)';
  text #4 @3 '  >>';
  text #4 @8 len=8;
  text #6 @3 "EXAMPLE: ADID";
dialog whr 'WHERE @1';
  text #2 @3 'Enter a new WHERE search instruction below.';
  text #4 @3 '  >>';
  text #4 @8 len=70;
  text #6 @3 "EXAMPLE: UNIT='234591' OR UTYP='5'";
dialog whra 'WHERE ALSO @1';
  text #2 @3 'Enter a WHERE ALSO search instruction below.';
  text #4 @3 '  >>';
  text #4 @8 len=70;
  text #6 @3 "EXAMPLE: UNIT='234591' OR UTYP='5'";
dialog extract "CREATE HOME.HUGQEXT";
  text #2 @3 "Save an EXTRACT of this data in data set 'HOME.HUGQEXT' ?";
  text #4 @3 "  NOTE: Location of LIBRARY 'HOME': '&M_HOME'";
menu prt;
  item '-' selection=nd;
  item 'Jville #1' selection=jv1;
  item 'Jville #2' selection=jv2;
  item 'FOB3 #1' selection=fb3p1;
  selection nd ';';
  selection jv1 ';';
  selection jv2 ';';
  selection fb3p1 ';';
menu SCROLL;
  item '-' selection=nd;
  item BACKWARD;
  item FORWARD;
  item TOP;
  item BOTTOM;
  item RIGHT;
  item LEFT;
  item 'RIGHT MAX';
  item 'LEFT MAX';
  selection nd ';';
RUN;
****************************************;
proc pmenu cat=m.m;
menu FSB1;
  item 'NEXT' selection=f ;
  item 'PREV' selection=b ;
  item 'ACTIONS' menu=BACTIONS;
  item 'HELP' selection=hlp;
  item 'KEYS' selection=key;
  item 'QUIT' selection=q ;
  item 'CANCEL' selection=can;
  selection f 'FORWARD';
  selection b 'BACKWARD';
  selection q 'END';
  selection hlp "FSLIST '&M_PDIR/HLP_FSEDIT';setpmenu m.m.fsl1";
  selection key "FSLIST '&M_PDIR/HLP_KEYS';setpmenu m.m.fsl1";
  selection can 'CANCEL;wdef 1 1 &M_LROW 80;';
menu BACTIONS;
  item '-' selection=nd;
  item 'SCREEN' menu=SCREEN;
  item 'GOTO' menu=GOTO;
  item 'PRINT' menu=prt;
  item 'WHERE' dialog=whr;
  item '  WHERE ALSO' dialog=whra;
  item '  WHERE UNDO (LAST)' selection=whru;
  item '  WHERE UNDO (ALL)' selection=whrc;
  selection whru 'WHERE UNDO;';
  selection whrc 'WHERE CLEAR;';
  selection nd ';';
dialog whr 'WHERE @1';
  text #2 @3 'Enter a new WHERE search instruction below.';
  text #4 @3 '  >>';
  text #4 @8 len=70;
  text #6 @3 "EXAMPLE: UNIT='234591' OR UTYP='5'";
dialog whra 'WHERE ALSO @1';
  text #2 @3 'Enter a WHERE ALSO search instruction below.';
  text #4 @3 '  >>';
  text #4 @8 len=70;
  text #6 @3 "EXAMPLE: UNIT='234591' OR UTYP='5'";
menu SCREEN;
  item '-' selection=nd;
  item 'NEXT' selection=sr;
  item 'PREVIOUS' selection=sl;
  selection sr 'RIGHT';
  selection sl 'LEFT';
  selection nd ';';
menu GOTO;
  item '-' selection=nd;
  item 'LAST (OBS)' selection=lo;
  item 'FIRST (OBS)' selection=fo;
  selection lo 'BOTTOM';
  selection fo 'TOP';
  selection nd ';';
menu prt;
  item '-' selection=nd;
  item 'Jville #1' selection=jv1;
  item 'Jville #2' selection=jv2;
  item 'FOB3 #1' selection=fb3p1;
  selection nd ';';
  selection jv1 ';';
  selection jv2 ';';
  selection fb3p1 ';';
RUN;


proc pmenu cat=m.m;
menu FSV_BASE;
  item 'ACTIONS' menu=ACTIONS;
  item 'HELP' selection=hlp;
  item 'KEYS' selection=key;
  item 'QUIT' selection=q;
  item 'CANCEL' selection=can;
  selection hlp "FSLIST '&M_PDIR/HLP_FSVIEW';setpmenu m.m.fsl1";
  selection key "FSLIST '&M_PDIR/HLP_KEYS';setpmenu m.m.fsl1";
  selection q 'END;wdef 1 1 &M_LROW 80;';
  selection can 'CANCEL;wdef 1 1 &M_LROW 80;';
menu ACTIONS;
  item '-' selection=nd;
  item SCROLL menu=SCROLL;
  item 'GOTO VARIABLE' dialog=gt;
  item 'HIDE (Variables)' selection=vh;
  item 'SHOW (Variables)' selection=vs;
  item 'EXTRACT' dialog=extract;
  item 'PRINT' menu=prt;
  item 'SORT ASCENDING' dialog=srta;
  item 'SORT DESCENDING' dialog=srtd;
  item 'WHERE' dialog=whr;
  item '  WHERE ALSO' dialog=whra;
  item '  WHERE UNDO (LAST)' selection=whru;
  item '  WHERE UNDO (ALL)' selection=whrc;
  selection nd ';';
  selection vs 'show var;';
  selection vh 'drop;';
  selection whru 'WHERE UNDO;';
  selection whrc 'WHERE CLEAR;';
dialog gt '= @1';
  text #2 @3 'GOTO: (Enter a Variable to "go to" )';
  text #4 @3 '  >>';
  text #4 @8 len=8;
  text #6 @3 "EXAMPLE: ADID";
dialog srta 'SORT ASCENDING @1';
  text #2 @3 'SORT ASCENDING: (Enter a Variable to sort by)';
  text #4 @3 '  >>';
  text #4 @8 len=8;
  text #6 @3 "EXAMPLE: ADID";
dialog srtd 'SORT DESCENDING @1';
  text #2 @3 'SORT DESCENDING: (Enter a Variable to sort by)';
  text #4 @3 '  >>';
  text #4 @8 len=8;
  text #6 @3 "EXAMPLE: ADID";
dialog whr 'WHERE @1';
  text #2 @3 'Enter a new WHERE search instruction below.';
  text #4 @3 '  >>';
  text #4 @8 len=70;
  text #6 @3 "EXAMPLE: UNIT='234591' OR UTYP='5'";
dialog whra 'WHERE ALSO @1';
  text #2 @3 'Enter a WHERE ALSO search instruction below.';
  text #4 @3 '  >>';
  text #4 @8 len=70;
  text #6 @3 "EXAMPLE: UNIT='234591' OR UTYP='5'";
dialog extract "CREATE HOME.BLKEXT";
  text #2 @3 "Save an EXTRACT of this data in data set 'HOME.BLKEXT' ?";
  text #4 @3 "  NOTE: Location of LIBRARY 'HOME': '&M_HOME'";
menu prt;
  item '-' selection=nd;
  item 'Jville #1' selection=jv1;
  item 'Jville #2' selection=jv2;
  item 'FOB3 #1' selection=fb3p1;
  selection nd ';';
  selection jv1 ';';
  selection jv2 ';';
  selection fb3p1 ';';
menu SCROLL;
  item '-' selection=nd;
  item BACKWARD;
  item FORWARD;
  item TOP;
  item BOTTOM;
  item RIGHT;
  item LEFT;
  item 'RIGHT MAX';
  item 'LEFT MAX';
  selection nd ';';
RUN;
/*
****************************************;
proc pmenu cat=m.m;
menu FSB1;
  item 'NEXT' selection=f ;
  item 'PREV' selection=b ;
  item 'ACTIONS' menu=BACTIONS;
  item HELP;
  item 'QUIT' selection=q ;
  selection f 'FORWARD';
  selection b 'BACKWARD';
  selection q 'END';
menu BACTIONS;
  item '-' selection=nd;
  item 'SCREEN' menu=SCREEN;
  item 'GOTO' menu=GOTO;
  item 'STATUS' dialog=stat;
* item 'STATUS' selection=stat;
  item 'PRINT' menu=prt;
  item 'WHERE' dialog=whr;
  item '  WHERE ALSO' dialog=whra;
  item '  WHERE UNDO (LAST)' selection=whru;
  item '  WHERE UNDO (ALL)' selection=whrc;
  selection whru 'WHERE UNDO;';
  selection whrc 'WHERE CLEAR;';
* selection stat 'af c=m.m.stat.program';
  selection nd ';';
dialog whr 'WHERE @1';
  text #2 @3 'Enter a new WHERE search instruction below.';
  text #4 @3 '  >>';
  text #4 @8 len=70;
  text #6 @3 "EXAMPLE: UNIT='234591' OR UTYP='5'";
dialog whra 'WHERE ALSO @1';
  text #2 @3 'Enter a WHERE ALSO search instruction below.';
  text #4 @3 '  >>';
  text #4 @8 len=70;
  text #6 @3 "EXAMPLE: UNIT='234591' OR UTYP='5'";
dialog stat ';';
  text #2 @3 "   Home Directory: &M_HOME";
  text #3 @3 "            State: &M_STA (&M_ABR-&M_STF)";
  text #4 @3 "  District Office: &M_DON";
  text #5 @3 "Address Reg. Area: &M_ARA";
  text #6 @3 "     Block Number: &M_BLK";
menu SCREEN;
  item '-' selection=nd;
  item 'NEXT' selection=sr;
  item 'PREVIOUS' selection=sl;
  selection sr 'RIGHT';
  selection sl 'LEFT';
  selection nd ';';
menu GOTO;
  item '-' selection=nd;
  item 'LAST (OBS)' selection=lo;
  item 'FIRST (OBS)' selection=fo;
  selection lo 'BOTTOM';
  selection fo 'TOP';
  selection nd ';';
menu prt;
  item '-' selection=nd;
  item 'Jville #1' selection=jv1;
  item 'Jville #2' selection=jv2;
  item 'FOB3 #1' selection=fb3p1;
  selection nd ';';
  selection jv1 ';';
  selection jv2 ';';
  selection fb3p1 ';';
RUN;
****************************************;
*/
proc pmenu cat=m.m;
menu FSL1;
  item 'DOWN' selection=f ;
  item 'UP' selection=b ;
  item 'LEFT' ;
  item 'RIGHT';
  item 'BOTTOM';
  item 'TOP';
  item 'QUIT' selection=q;
  selection f 'FORWARD';
  selection b 'BACKWARD';
  selection q 'END';
run;