And since I'm into sharing my dark secrets, here's a very useful util I wrote a while back (probably from some-one else's inspiration, so don't sue me...)
GLOBAL catalog it, then at the UV prompt enter > SEE HPMAST HPMAST.FILE - KEY...............: 001-01011 RECORD #1 001: F1.........................: 002: F2.........................: 05/02/96 003: SURNAME.UP.................: BARTLETT 004: INIT.......................: DQ 005: Title......................: MR 006: First names................: } }B 007: D.O.B......................: 008: F8.........................: 009: Employer...................: 010: Salary.....................: 0.00 011: F11........................: 012: F12........................: 013: F13........................: 014: Spouse init................: 015: Title......................: 016: First names................: 017: D.O.B......................: 018: F18........................: 019: Spouse emp.................: 020: Spouse Sal.................: 0.00 It will display each record alongside the dict item it found associated (it does get confused if your site is as well documented as this one..not!), but still worthwhile seeing data in relation to other data * SEE * D.Bartlett 02Dec96 * View contents of files alongside dictionary headings * ---------------------------------------------------------------- * Mod DQB 18Aug98 Try get the conversions right * Mod DQB 15Oct98 Clearselect after viewing * Mod DQB 01Apr98 Added 'N'ext record capability * Mod DQB 06Dec99 Added 'SEE FILENAME RECORD', ie no need for 'ITEM=' * ---------------------------------------------------------------- GOSUB HOUSEKEEPING GOSUB PARSE.SENTENCE GOSUB SHOW.PARAMS GOSUB PROCESS.DICT * Now get a list together so we have something to process BEGIN CASE CASE LISTNAME NE '' ; EXECUTE 'GET.LIST ':LISTNAME CASE ITEMNAME NE '' ; FORMLIST ITEMNAME CASE 1 SELECT HANDLE END CASE * then process these records... LOOP READNEXT KEY ELSE EXIT GOSUB PROCESS.DATA UNTIL DONE = 1 GOSUB PROMPT.USER IF DONE = 1 THEN EXIT REPEAT CLEARSELECT STOP * ---------------------------------------------------- PROCESS.DATA: DONE = 0 RECORD.NO += 1 READ RECORD FROM HANDLE, KEY THEN IF TO.LPTR = 'LPTR' THEN PRINTER ON GOSUB PRINT.HDR * Display all the fields... FOR F = 1 TO FLDS * Display field number... PRINT FMT(F,'3"0"R') : ': ': * then the DICTIONARY name for this field... PRINT FMT(DICT.FLDS<F>, '27"."L'):': ': * ...and extract the data... LINE = RECORD<F> * Check if there's a conversion...? IF DICT.CONV<F> NE '' THEN GOSUB CONVERT.DATA * And finally show the (converted) data, stripped out into * separate lines of 45 chars each... LOOP THIS.LN = LINE[1,45] PRINT THIS.LN : SPACE(46 - LEN(THIS.LN)) : LINE = TRIM(LINE[46,LEN(LINE)]) IF TO.LPTR NE 'LPTR' THEN GOSUB CHECK.PAGING UNTIL LINE = '' PRINT '***: ' : SPACE(29) : REPEAT IF TO.LPTR = 'LPTR' THEN PRINT NEXT F IF TO.LPTR = 'LPTR' THEN PRINTER OFF END ELSE IF ITEMNAME NE '' THEN PRINT ; PRINT CHAR(7) PRINT 'Item ':ITEMNAME: PRINT ' does not exist in ':FILENAME:'!': INPUT JUNK: STOP END END RETURN * ---------------------------------------------------- CHECK.PAGING: LN += 1 IF LN GE LINES.PAGE THEN INPUT CONT,1 CONT = UPCASE(CONT) * Mod DQB 01Apr98 Added 'N'ext record capability BEGIN CASE CASE CONT = 'Q' DONE = 1 ; F = FLDS ; EXIT.FLAG = 'QUIT' CASE CONT = 'N' F = FLDS ; EXIT.FLAG = 'NEXT' CASE 1 GOSUB PRINT.HDR END CASE END ELSE PRINT END RETURN * ---------------------------------------------------- PRINT.HDR: * Display the filename, and key... PRINT @(-1) PRINT FMT((FILENAME : ' - KEY'),'32"."L'):': ':KEY: IF KEY.CONV NE '' THEN OUTKEY = '(' :OCONV(KEY,KEY.CONV) : ')' PRINT FMT(OUTKEY,'20R') : END PRINT SPACE(5):'RECORD #':RECORD.NO PRINT LN = 2 RETURN * ---------------------------------------------------- CONVERT.DATA: * If there are MVs / SMs, convert each individually... MULTI.LINE = 0 BEGIN CASE CASE INDEX(LINE, @FM, 1) ; MULTI.LINE = 1 CASE INDEX(LINE, @VM, 1) ; MULTI.LINE = 1 CASE INDEX(LINE, @SM, 1) ; MULTI.LINE = 1 END CASE IF MULTI.LINE = 1 THEN NEW.LINE = '' QQ.MORE = 1 LOOP REMOVE NEXT.VAL FROM LINE SETTING QQ.MORE NEXT.VAL = OCONV(NEXT.VAL, DICT.CONV<F>) BEGIN CASE CASE QQ.MORE = 2 ; NEW.LINE := NEXT.VAL : @FM CASE QQ.MORE = 3 ; NEW.LINE := NEXT.VAL : @VM CASE QQ.MORE = 4 ; NEW.LINE := NEXT.VAL : @SM END CASE UNTIL QQ.MORE = 0 REPEAT LINE = NEW.LINE END ELSE * Convert single value LINE = OCONV(LINE, DICT.CONV<F>) END RETURN * ---------------------------------------------------- PROMPT.USER: IF EXIT.FLAG = 'NEXT' THEN * Skip straight to the next record - no prompting done here EXIT.FLAG = '' END ELSE PRINT PRINT '[':FILENAME:', ':KEY:'] -- ': PRINT 'Press Return to continue...': ; INPUT CONT,1 CONT = UPCASE(CONT) IF CONT = 'Q' OR CONT = 'X' THEN DONE = 1 ; EXIT.FLAG = 'QUIT' END RETURN * ---------------------------------------------------- PROCESS.DICT: * Build a list of Dictionary fields SELECT D.HANDLE DONE = 0 LOOP READNEXT FLD ELSE DONE = 1 UNTIL DONE READ DREC FROM D.HANDLE, FLD THEN TYPE=DREC<1> IF TYPE[1,1] = 'A' OR TYPE[1,1] = 'D' THEN DPOS = DREC<2> IF DPOS > 0 AND NUM(DPOS) THEN GO4IT = 0 BEGIN CASE CASE DCOUNT(DREC,@FM) < 9 ; * 6- 8 lines DCONV = DREC<3> DDESC = DREC<4> IF DDESC = '' THEN DDESC = @ID GO4IT = 1 CASE DCOUNT(DREC,@FM) < 11 DCONV = DREC<7> DDESC = DREC<3> IF DDESC = '' THEN DDESC = @ID GO4IT = 1 END CASE IF(GO4IT) THEN GOSUB DICT.CONV END END ELSE IF DPOS = 0 AND KEY.CONV = '' THEN BEGIN CASE CASE DCOUNT(DREC,@FM) < 9 ; * 6- 8 lines KEY.CONV = DREC<3> CASE DCOUNT(DREC,@FM) < 11 KEY.CONV = DREC<7> END CASE END END END REPEAT FLDS = DCOUNT(DICT.FLDS, @FM) * PRINT 'THERE ARE ':FLDS:' FIELDS': ; INPUT CONT RETURN * ---------------------------------------------------- SHOW.PARAMS: PRINT PRINT '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' PRINT 'SEE ... File Dict / Data Viewer' PRINT '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' PRINT PRINT 'SEE filename .................. :- View random data' PRINT 'SEE filename LIST=listname ... :- View selected records' PRINT 'SEE filename ITEM=record.id ... :- View specific record' PRINT 'SEE filename BRANCH=branch .... :- View branch file' PRINT 'SEE filename record.id ........ :- View specific record' PRINT 'SEE filename record.id-record.id :- View specific record' PRINT ; PRINT PRINT PRINT PRINT 'Press ENTER to view data in ':FILENAME:' file ...': INPUT X,-1: RETURN * ---------------------------------------------------- DICT.CONV: IF TRIM(DDESC) = '' THEN DDESC = FLD CONVERT @VM TO '' IN DDESC DDESC = TRIMF(DDESC) * Mod DQB 18Aug98 Try get the conversions right IF TRIM(DICT.FLDS<DPOS>) = '' THEN DICT.FLDS<DPOS> = DDESC END IF TRIM(DICT.CONV<DPOS>) = '' THEN IF TRIM(DCONV) NE '' THEN DICT.CONV<DPOS> = DCONV END END RETURN * ---------------------------------------------------- PARSE.SENTENCE: FILENAME = FIELD(@SENTENCE, ' ', 2) OPTIONS = FIELD(@SENTENCE, ' ', 3) TO.LPTR = FIELD(@SENTENCE, ' ', 4) OPEN "VOC" TO F.VOC ELSE STOP 201, "VOC" OPEN 'DICT',FILENAME TO D.HANDLE ELSE STOP 'UNABLE TO OPEN DICT ':FILENAME END OPEN '',FILENAME TO HANDLE ELSE STOP 'UNABLE TO OPEN FILE ':FILENAME END IF TRIM(OPTIONS) NE '' THEN BEGIN CASE CASE OPTIONS[1,6] = 'BRANCH' BRANCHNAME = TRIM(OPTIONS[7,99]) BRANCH.POINTER = "Q":@FM:BRANCHNAME:@FM:FILENAME WRITE BRANCH.POINTER ON F.VOC, "SEE.QFILE" THEN OPEN 'DICT','SEE.QFILE' TO D.HANDLE ELSE STOP "UNABLE TO OPEN DICT ":FILENAME:" AT BRANCH" END OPEN '','SEE.QFILE' TO HANDLE ELSE STOP "UNABLE TO OPEN ":FILENAME:" AT BRANCH" END END CASE OPTIONS[1,5] = 'LIST=' ; LISTNAME=TRIM(OPTIONS[6,99]) CASE OPTIONS[1,5] = 'ITEM=' ; ITEMNAME=TRIM(OPTIONS[6,99]) CASE 1 * IF INDEX(OPTIONS,'-',1) > 0 THEN * LIST = '' * FROM.NO = FIELD(OPTIONS, '-', 1) * TO.NO = FIELD(OPTIONS, '-', 2) * IF TO.NO < FROM.NO THEN STOP "WAKE UP!!" * IF NOT(NUM(TO.NO)) THEN STOP "NUMBERS ONLY!" * IF NOT(NUM(FROM.NO)) THEN STOP "NUMBERS ONLY!" * FOR SEQKEY = FROM.NO TO TO.NO * LIST<-1> = SEQKEY * NEXT SEQKEY * ITEMNAME = LIST * END ELSE ITEMNAME = OPTIONS * END END CASE END RETURN * ---------------------------------------------------- HOUSEKEEPING: PAGE.OFF = @(0) LINES.PAGE = 22 RECORD.NO = 0 LISTNAME = '' ITEMNAME = '' EXIT.FLAG = '' DICT.FLDS = '' DICT.CONV = '' DICT.CONV = '' KEY.CONV = '' PROMPT '' RETURN END ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/