Download presentation
Presentation is loading. Please wait.
Published byRoy Hensley Modified over 9 years ago
1
Conference 2004 SIR Development
2
Current Release SIR2002 n Data Management –Multiple Databases –Integrated Master Modules –SQLServer for ODBC –Secondary Indexes –Long Strings
3
Current Release SIR2002 n Application Development –GUI Based –Screen Painters –Unlimited PQL Program Size n (No ‘Table Space’) –Spreadsheet –PQLForms –Internet Enabled
4
Current Release SIR2002 n Single Generic Source on Windows XP n Releases on Windows, Sun, HP, IBM, Linux n SPRs fixed on demand - revisions on internet for download n Current version 20.35
5
SIR/XS 32 character names n Database Schema –Database Names –Record Names –Variable Names –Index Names –Passwords n Tabfiles & Tables n Families n Members n VisualPQL –Variables –Sub-Routines –Sub-Procedures –Labels –Buffer Names –Filenames
6
Standard Names –1 – 32 characters –Start with alpha –Capitalized –Contain letters, numbers, four special characters $ # @ _
7
Non-Standard Names –Enclosed in curly braces { } –From 1 to 30 characters (plus braces) –No translation –Any characters –Stored without braces so sort normally
8
Improved Recovery n Journaling Rewritten n Itemize rewritten n Roll back n Roll forward n Auto recover n Transaction processing n Incremental Unload
9
Journal n File Header –Database Name –Version of Software n Update Header –Data/Schema –Update Level Started –Date/Time Started –Date/Time Finished (for data updates) –User Name n Update Record –Before update –Before delete –After insert –After update –Existing record previous update level –User (in multi-user mode)
10
Journal Utilities n Journal Recover –Rolls forward from given place n Journal Rollback –Rolls back from given place n Itemize –Lists contents (headers) n Upload –Creates machine independent text file
11
Journal Processing n New PQL commands to process journals –Access to header data –Access to record values n Audit Trail n Other recovery strategies
12
Journal Commands n PROCESS JOURNAL n JOURNAL RECORD IS n PQL access to record variables n END JOURNAL RECORD IS n END PROCESS JOURNAL
13
PROCESS JOURNAL n [FROM = updlevel | START = date [,time] ] n [THRU = updlevel | END = date [,time] ] n [REVERSE] n [FILENAME= fname ] (sr5 is the default) n Return Data –[DATE = varname] [ENDDATE = varname] –[TIME = varname] [ENDTIME = varname] –[LEVEL = varname] –[RECORD = varname] –[TYPE = varname] –[USER = varname]
14
Example program integer*4 jtype value labels jtype (1) 'Record written‘ (2) 'Before rewrite‘ (3) 'After rewrite‘ (4) 'Deleted record‘ (3) 'After rewrite‘ (4) 'Deleted record‘ (-1) ‘Data header‘ (-4) ‘Schema header‘ (-5) ‘User header' (-1) ‘Data header‘ (-4) ‘Schema header‘ (-5) ‘User header' process journal TYPE= JTYPE RECORD = jrec level = jlevel FROM = 13 ifthen (jtype gt 0). write [vallab(JTYPE)] 'Record Type ' jrec.else. write [vallab(JTYPE)] 'Update level ' jlevel fi journal record employee write id name salary end journal record end process journal end program
15
Transaction Processing n Start Transaction n End Transaction (Commit) n Abort Transaction n Journal Based n Rollback on Abort
16
Incremental Unload n Creates Journal of Updates –Add to end of Unload –Automatic processing of levels –Automatic restore by reload –Optional separate file
17
Multiple Data Files n Split the.sr3 data file n No overhead for existing single file databases n Split based on serial key ranges –Case structure – case values –Caseless – record type/key value
18
Existing Data Structure Top Level Index Other Index Levels Data Level
19
New Data Structure Top Level Index Other Index Levels Data Level FILE INDEX
20
File Index n Contains key ranges n Contains filenames n Contains pointer to top level index for file n New schema command DATA FILES FILENAME = ‘ ‘ / FILENAME = ‘ ‘ FROM keyvalue / FILENAME = ‘ ‘ FROM keyvalue n Before any data added n Requires restructure
21
GUI Improvements n Main Menu Replace ‘On-Fly’ n Child Windows n DISPLAY TIPBOX "text" –shows a box with text that disappears Clipboard COPY/PASTE functions Clipboard COPY/PASTE functions n Synchronized scrolling lists n Right Mouse click & Mouse over messages n Image buttons - tool bar buttons on dialogs
22
New GUI controls n COMBO id,row,col,width n SPIN id,row,height,col,width n SLIDER id,row,height,col,width n PROGRESS id,row,height,col,width n TREE id,row,height,col,width,type
23
GUI Functions n SetPos(id,pos) –edit and list progress and slider n SelAll(id) –in edit/text n ClrAll(id) –in edit/text n RemoveAll(id) –in edit/text
24
GUI Functions (cont) n num = SCROLLAT(id) –Gets top line in list/text control n num = SCROLLTO(id,pos) –Sets top line in list/text control n num = CLIPSET(textexp) –Sets the clipboard to the text n num = CLIPAPP(textexp) –Appends text to clipboard n string = CLIPGET(dummy) –Gets text from clipboard a line at a time.
25
New GUI Commands n DISPLAY TIPBOX text –Same as infobox except no OK button –Dismissed as soon as it loses focus n SET IMAGE id,bitmap [n] –n = 0 - crop (default) –n = 1 – center –n = 2 - resize
26
XML n XML File structure –Text File –Hierarchical –Tags enclose –Resembles HTML with own tags n XML Names –Begin with character (or _ :) –Case sensitive –Allow letters, numbers - _ :. (No spaces)
27
Example XML <people> John D Jones John D Jones 2150 2150 1956 1956 </person> James A Arblaster James A Arblaster 1500 1500 1961 1961 </people>
28
XML Output n New PQL Procedure to produce XML files. XML SAVE FILE FILENAME = filename / ROOT = 'string' / ROOT = 'string' / BREAK = variable (TAG = 'string', BREAK = variable (TAG = 'string', ATTRIBUTES = (varname (format) ),...) ATTRIBUTES = (varname (format) ),...) ELEMENTS = (varname (format) ),...)), ELEMENTS = (varname (format) ),...)), variable......../ variable......../ BOOLEAN = (logical expression) / BOOLEAN = (logical expression) / MISSCHAR = character / MISSCHAR = character / SAMPLE = fraction/ SAMPLE = fraction/ SORT = variable,.... SORT = variable,.... DTD [= filename] DTD [= filename] SCHEMA [= filename] SCHEMA [= filename]
29
Example XML Program Example XML Program RETRIEVAL PROCESS CASES ALL. PROCESS REC EMPLOYEE. GET VARS ID, NAME GENDER BIRTHDAY. PROCESS REC 2 ONETIME. GET VARS POSITION STARTDAT STARTSAL. PROCESS REC 3 WITH (POSITION) ONETIME. GET VARS REVDATE NEWSAL RATING. PERFORM PROCS. END PROCESS REC END PROCESS CASES
30
XML SAVE FILE FILENAME= "XML4" /SORT=ID,POSITION,REVDATE /SORT=ID,POSITION,REVDATE /ROOT='Employees' /ROOT='Employees' /BREAK= /BREAK= ID (TAG='Employee', ID (TAG='Employee', ATTRIBUTES = (ID), ATTRIBUTES = (ID), ELEMENTS = (NAME GENDER(L10) BIRTHDAY)), ELEMENTS = (NAME GENDER(L10) BIRTHDAY)), POSITION (TAG = 'Job', POSITION (TAG = 'Job', ATTRIBUTES = (POSITION(L20)), ATTRIBUTES = (POSITION(L20)), ELEMENTS = (STARTDAT,STARTSAL)), ELEMENTS = (STARTDAT,STARTSAL)), REVDATE (TAG = 'Review', REVDATE (TAG = 'Review', ATTRIBUTES = (REVDATE), ATTRIBUTES = (REVDATE), ELEMENTS = (NEWSAL,RATING(L15))) ELEMENTS = (NEWSAL,RATING(L15))) END RETRIEVAL
31
Sample output Sample output John D Jones John D Jones Female Female 04 03 1960 04 03 1960 02 10 80 02 10 80 1500 1500 1600 1600 Good Good 1650 1650 Acceptable Acceptable
32
10 15 81 10 15 81 2000 2000 2100 2100 Good Good 2150 2150 Very Good Very Good James A Arblaster James A Arblaster
33
Tagged Files n Sir/XS features to assist in creating generic tagged files –i.e. files where content is surrounded by start and finish tags –Identify output as a tagged file on the OPEN –Subsequent WRITE commands surround each output element with a tag –The tag defaults to a variable name or can be specified on the WRITE.
34
Example Program RETRIEVAL OPEN TEST.HTM WRITE TAGGED PROCESS CASES ALL. PROCESS REC EMPLOYEE. GET VARS ID, NAME GENDER BIRTHDAY. WRITE (TEST.HTM) ID NAME GENDER BIRTHDAY. END PROCESS REC END PROCESS CASE END RETRIEVAL
35
Example Output 1 John D Jones 2 04 03 1960 1 John D Jones 2 04 03 1960 2 James A Arblaster 1 12 07 1942 2 James A Arblaster 1 12 07 1942 3 Mary Black 1 08 10 1953 3 Mary Black 1 08 10 1953 4 Jack Brown 2 03 07 1948 4 Jack Brown 2 03 07 1948 5 Fred W Green 2 05 18 1951 5 Fred W Green 2 05 18 1951
36
Reading XML Files n Creating an XML file in SIR –Can restrict to specific parts of the standard and still produce compliant, standard XML n Reading XML in SIR –cope with any XML compliant file –straightforward to produce an interface that copes with simple XML produced by SIR –much more difficult to meet the standard under all circumstances –need to use existing library/routines –Simple interface for PQL
37
Possible Approaches n READ –Could implement with DOM model but restricts to small (in memory) files n MESSAGE processing –Structure of file determines sequence –Independent message process for: n startDocument n startElement (name,attribute_count) n characters (len,string) n endElement n endDocument
38
New Concurrent Update n No Master Process n New Lock file (.sr7)
39
SQL in PQL PROCESS SELECT variable_list | * | ALL FROM [ tabfile. ] table_name FROM [ tabfile. ] table_name [ database.] record_name [ database.] record_name [INDEXED BY index_name] [INDEXED BY index_name] [WHERE condition] [WHERE condition]… END PROCESS SELECT
40
SQL in PQL n Processes from multiple data sources –Joins –Use WHERE to restrict –Full PQL conditions/expressions –No subqueries in WHERE n Returns one set of named variables at a time –Sequence as specified in command –No aggregation –No GROUP BY –No UNION
41
SIR Server n Similar in concept to SQLServer –Started on network –Waits for users to logon –Process requests –Returns results n Requests –Logon –Run named procedure –Logoff
42
Server Procedures n Single System Procedure File n Requests construct text output –All output to standard output goes back to client n Procedures –Contain SIR Commands –Run PQL
43
Client Facilities n Logon n Send Request (check error codes) n Get output line at a time n Logoff
44
Connect to SIRServer CONNECT conid SIRSERVER 'b1‘ USER 'dad’ PASSWORD ‘zzzz’ ERROR errid
45
Send Request n Request is only ever a CALL –Family[password].member[password (parameter list) SEND REQUEST CONNECT conid COMMAND ‘myprocs.report1‘ RESULT lines n Positive result – lines returned n Negative result – error with request
46
Get Results RETURN LINE myline CONNECT conid ERROR errid e.g. Loop (or FOR I = 1,lines / ROF). return line myline connect conid connect conid error errorid error errorid. if (errorid ne 0) exit loop. write myline pool
47
Conference 2004 SIR Development
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.