Michael Caskey <[EMAIL PROTECTED]> wrote on Tue, 21 Feb 2006 16:10:06 -0700
> I have been tasked with creating reports from our UniData > system using UniQuery. ... > > 1. Is there a better way to run these queries? > and > 2. Is there a better query editor; text-based or GUI or both? Others have posted suggestions for external tools, but assuming you don't have access to these, there are some things you can do within UniData to simplify your life a bit. There are three editors that come with UniData: ED, AE and SE. ED and AE are line editors, and AE is the more powerful one. Our system has ED remapped to AE, so we don't use ED at all. SE is a screen editor, and some find it easier to use. If you are setting up queries that you need to run on a regular basis, consider using UniData Paragraphs. These can be run from the TCL prompt as commands once they're written. Paragraphs are stored in VOC, and are similar to DOS Batch files. You can specify parameters and save queries for future use. You can also put several commands together to create a process. There are a few native ones that you can look at for reference. Here are three from our UniData/AIX system. LISTDICT is used to list dictionary items. The syntax is LISTDICT <FILE NAME> [LPTR] Top of "LISTDICT" in "VOC", 8 lines, 317 characters. 001: PA 002: IF <<C3,DISPLAY>> = '' THEN GO L100 003: IF <<C3,DISPLAY>> = 'LPTR' THEN GO L200 004: IF <<C3,DISPLAY>> # 'lptr' THEN GO L100 005: L200: SORT DICT <<I2,FILE NAME>> TYP LOC CONV MNAME FORMAT SM ASSOC BY TYP BY LOC BY @ID LPTR 006: GO DONE 007: L100: SORT DICT <<I2,FILE NAME>> TYP LOC CONV MNAME FORMAT SM ASSOC BY TYP BY LOC BY @ID 008: DONE: * Note that Attribute 1 is set to PA to indicate that this is a paragraph. The lines after that are processed. Parameters are specified using double angle brackets, and contain two fields. The first field indicates the parameter type (I=Required Input, C=Conditional Input) and position. The second field is a prompt to identify the parameter, and will be used if a required input is not specified. I wrote LP to list print jobs waiting to print in our AIX queues. If no queue is specified, all items in all queues are listed, otherwise only the specified queue is listed. Note that I'm executing AIX commands from TCL by prefixing the command with the "!" character. Top of "LP" in "VOC", 6 lines, 96 characters. 001: PA 002: IF <<C2,QUEUE>> = '' THEN GO L100 003: !lpstat -p<<C2,QUEUE>> 004: GO DONE 005: L100: !lpstat | more 006: DONE: * CP is a simple paragraph to alias the SPOOL command. Top of "CP" in "VOC", 2 lines, 38 characters. *--: P 001: PA 002: SPOOL <<I2,FILENAME>> <<I3,ITEMID>> Check the manuals for more help, or feel free to drop me a line off-list. --Tom Pellitieri Toledo, Ohio ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/