Presentation is loading. Please wait.

Presentation is loading. Please wait.

Business Information Server Run Design

Similar presentations


Presentation on theme: "Business Information Server Run Design"— Presentation transcript:

1 Business Information Server Run Design
a.k.a. MAPPER

2 Getting Started

3 MAPPER Run Design Course
Course Content Overview of MAPPER runs How to use the Commands Commands MAPPER Networking MAPPER Relational Interface (MRI) Screen Presentation

4 MAPPER MAPPER Run A MAPPER Run lets you take the manual commands that you do frequently to develop a specific result, and create a program that will develop the same result, just by executing it. A MAPPER Run is a script, or a sequence of executable commands, stored in a report. MAPPER runs are stored in the same kind of reports as MAPPER data.

5 MAPPER Run Language The Run Language or command set is an extension of the manual commands. In almost all cases there are run commands that are equivalent to the manual functions. There are many run commands that have no manual equivalent, mainly in the display and formatting of data. An example of a MAPPER run is the graphic commands. All of the chart commands are actually MAPPER runs. PCME is another example.

6 MAPPER Run Example Find all the records in 2B0 where STCD = IP
Sort by CustCode Match on ProductType, copy ProducCost from 1C0 Display the result

7 MAPPER Run Example Results

8 MAPPER Run Registration
A run must be registered to execute by the MAPPER Coordinator Runs can be registered for general use, or restricted. Department User-ID Station Time of day

9 MAPPER Run Registration
The same run name can be registered for different departments or different people – and be something entirely different! Point to 2 different scripts The same script report can be registered as multiple run names. Internal logic governs behavior

10 MAPPER Create a Drawer GENZERO – Create a new drawer
REGDRW – Register drawer for access

11 MAPPER Register a Run – Agenda

12 MAPPER Register a Run – Agenda

13 MAPPER Register a Run – Agenda

14 MAPPER Run Registration Reports
Runs are registered by Dept. in Drawer E2 Use the ATO and OTA runs to convert between Octal and ASCII drawer IDs.

15 MAPPER Run Statement @ SRH,0,D,002 d 'REP' ,MRP . Command parameters
Line type to process Option(s) Report to process Column(s) to process Command Indicates this is a command

16 Reports & Results

17 MAPPER @SRH Search @ SRH,0,D,002 d 'REP','CAT' \ ,MRP,TAPE .
Search for records where REP = MRP and CAT = TAPE @ SRH,0,D,002 d 'REP','CAT' \ ,MRP,TAPE/,JIL,MISC . Search for records where (REP = MRP and CAT = TAPE) or (REP = JIL and CAT = MISC)

18 MAPPER @SRH Search @ SRH,0,D,002 d 'REP','QTY' \ ,AEF,10/r,AEF,50 .
Search for records where REP = AEF and QTY is in the range of 10 to 50 @ SRH,0,B,002 'ShipDate' . Search for records where ShipDate is not blank.

19 MAPPER @SRH Search @ SRH,0,D,002,,,0175 d 'REP' \ ,AEF/,MRP <vfound>i4 . Search for records where REP = AEF or MRP. Variable <vfound> contains the number of records found. If none found, go to label 0175. @ SRH,018,H,014 dl(*.) 'REP' ,AEF . Exclude trailer lines from the result.

20 MAPPER @SOR Sort @ SOR,0,D,002 '' \ 'REP','CAT','QTY' ,1,2d,3n . Sort the data by REP, then by CAT (desc), and finally by QTY. The n option causes data to be treated as numeric, so that 9 is less that 11.

21 MAPPER @DSP Display Report
@ DSP,18,B,034 . Display report 34B18 @ DSP,-4 . Display result -4 @ DSP,18,B,034, Display report 34B18 starting at line 100 @ DSP,-4,,,,,,'Value of <x> is '<x> . Display result -4 with a message on the control line

22 MAPPER @DSP Display Run RPT
@0021: ldv,w <eline>=ELINE$ . Executing line @ dec,3 <eline> . Dec <eline> by 3 @ . Do the work @ dsp, Display results @ dsp,EDRW$,ERPT$,<eline> . Display run code @ rel . Release

23 MAPPER Exercise Search report 2D0 for all lines containing GAUZ or ANTI in the 'Cat' field. Display the result. Sort the result by 'Qty' within 'Rep'.

24 MAPPER @BRK Output Area
@ BRK,0,F char free-form drawer Today is DATE7$ Time is TIME$ User-ID is USER$ @ BRK . New -0 result created -0 result contains: Today is FEBRUARY 11, 2005 Time is 14:38:11 User-ID is DWY Any line not beginning goes into the output area.

25 MAPPER @RNM Rename Report
@ SRH … . Create a -0 result @ RNM -2 . Rename current -0 result as -2. @ RNM,0,C, Rename report 1C0 as -4. We can now refer to this report as -4 in our run. Be Careful!! We are still dealing with a permanent report.

26 MAPPER FCC Display Field Headings
Display a report. Enter FCC

27 MAPPER Exercise Start a new result in the Output Area.
Place several lines of text into the Output Area. Use at least 1 reserved word. Close the Output Area to make a new -0 result. Display the result. Resume the run and rename the result. Display the renamed result.

28 Variables & Reserved Words

29 MAPPER @LDV Load Variable
@ LDV,o <var1>,<var2>,<var3> … Options Variable types c center text a alpha-numeric l left-justify text f fixed decimal point o convert to lower-case h Hollerith p pack variable i integer r right-justify text o octal (2200 only) u convert to upper-case s string w load reserved word z zero-fill

30 MAPPER @LDV Load Variable
@ LDV <cab>i4=22,<drw>h1=E,<rpt>i4=427 . Load 3 variables for cabinet, drawer, report @ LDV,p <user>s32='Scott',<pwd>s32='tiger' . Load and pack 2 variables for user-ID, password @ LDV,rz <qty>i4=22,<price>f8.2= Load 2 variables – 1 integer, one fixed decimal @ LDV,w <rpt>i4=RPT$,<date>s11=DATE12$ . @ LDV,wp <user>s11=USER$,<run>s12=RUN$ . @ LDV,w <t>h1=TIC$ . Load variable with system reserved words

31 MAPPER @LDV Load Variable
@ LDV,W <time>s8=TIME$ :13:44 @ LDV <HR>s2=<time>(1-2),\ <MIN>s2=<time>(4-2),<Sec>i2=<time>(7-2) . Capture a reserved word value, split into 3 variables @ LDV <Tyme>s6=<HR><Min><Sec> . Load a variable with TIME without colons @ LDV <str>s32='Scott tiger Oracle database' . @ LDV <str>(7-5)='horse',<str>(13-0)='' . @ LDV <str>(0-3)='XyZ' . Load substrings. <str> variable now contains 'Scott horse XyZ'

32 MAPPER @LDV Load Variable
@ LDV,P <City>s24='BaNGAloRe' . @ LDV,U <City>(1-1) LDV,O <City>(2-0) . Variable contains unknown capitalization. Upper-case the first character, and lower-case the rest of the string. Variable now contains 'Bangalore'.

33 MAPPER @LDV Load Variable
@ LDV V1s24='Roseville',V156i8=0 . @ LDV,W V2=SOE$,V8s11=USER$ . This is the old way of naming variables. Internally, BIS still uses this nomenclature. Variables are usually numbered up to V199, May go higher if the run is registered for more variables. You should avoid using the two naming methods together in the same run.

34 MAPPER @LDV Load Variable
@ LDV V1i3=101,V2i3=102 . @ LDV V99s32=VV1,V100s32=VV2 . V99 is loaded with the value of V101 V100 is loaded with the value of V102 @ LDV,p <Var>s24='FirstName' . @ LDV <<Var>>s32='Dave' . Load the variable <FirstName> with 'Dave' Storing a variable name within another variable is NOT a recommended technique, but you may occasionally see it used in specialized situations.

35 MAPPER @LDA Load Variable Array
@ LDA <color>s8[5]='Red','Blue','Yellow','Black','White' . Load a 5-member array of colors, up to 8 chars each. @ LDA <users>s32[15],<passwords>s32[15] . Load 2 15-member arrays, up to 32 characters each. @ LDV <users>[5]='Alpha',<passwords>[11]='Bravo' . Assign values to the 5th user and 11th password. Same options and variable types

36 MAPPER @INC Increment Variable
@ LDV <counter>i4=1,<amt>i2=8 . @ INC <counter> . Inc <counter> by 1 @ INC,2 <counter> . Inc <counter> by 2 @ INC,<amt> <counter> . Increment <counter> by the value of <amt>. @DEC works the same way to decrement the value of a variable.

37 MAPPER @ART Arithmetic
@ ART 12+13;a/5;b*(a+3) <val1>i4,,<val3>i4 . a = 25 stored in <val1> b = 5 not saved c = 140 stored in <val3>

38 MAPPER @DEF Properties of a Variable
@ DEF,,LIN+1 <len>i2,<value> GTO LIN+2 @ ldv <value>i4=1 . Test if a variable <value> exists. If it does, use its value. If it does not, load a default value and use that. Now we are guaranteed that the variable <value> exists and has a usable value.

39 MAPPER @DEF Properties of a Variable
@ DEF,p <len>i3,<string> . @ LDV <LongString>(21–<len>)=<string>(p) . Determine how long <string> would be if packed (leading & trailing spaces removed) Load a longer string variable with the packed value of <string>, starting at position 21 for a length of <len>.

40 MAPPER @LCV Loc, Chg in a variable
@ LCV,LIN+1 b3 <Path> '\' <pos>i3 . Find the 3rd backslash character in the <Path> variable. Go to LIN+1 if there is no 3rd backslash in the variable. @ LCV,LIN+1 b99 <Path> '\' <pos>i3,<occ>i3 . Find the 99th backslash character in the <Path> variable. Most likely, there are not 99 backslash characters, so we go to LIN+1. The variable <occ> contains the number of backslash characters in <Path>. @ LCV,LIN+1 b<occ> <Path> '\' <pos>i3 . Find the last backslash character in the <Path> variable, since now we know how many there are.

41 MAPPER @LCV Loc, Chg in a variable
@ LCV,LIN+1 t$ <txtFrom> ' '/'' . Remove any embedded spaces <txtFrom> @ LCV,LIN+1 '' <string> 'Cat'/'Horse' . Change all occurrences of 'Cat' to 'Horse' in the variable <string>. Changing to a longer value works as long as there is room in the variable. If the new string is too long, it is truncated.

42 MAPPER Reserved Words Obtain information from the system. Examples:
DATE12$ Date as DD MMM TIME$ Time as HH:MM:SS USER$ User-ID DEPN$ Dept number TIC$ Single Quote ' LINK$ Is run started NET$ Are we networked? EDRW$ Executing Drawer ERPT$ Executing Report MSEC$ Milliseconds since midnight See the Developer's Guide Help for a complete list.

43 MAPPER Exercise Calculate the cost of 3 pairs of shoes at per pair and 6% sales tax. Write into the Output Area: Cost = nnn.nn Sales Tax = nn.nn Total = nnn.nn Display the output. @ art 3*59.98;a*0.06;a+b \ . <cost>f8.2,<tax>f8.2,<total>f8.2 . @ brk,0,A . Cost = <cost> Tax = <tax> Total = <total> @ brk dsp,-0 . @ dsp,EDRW$,ERPT$ . @ rel .

44 MAPPER Exercise Search report 2B0 for all lines that contain ARCO in the 'CustCode' field. Display the result with the message "Search complete" on the control line. Resume the run. Write "Search was successfully completed" into the Output Area. Convert the Output Area to a result. Display the result. @ srh,0,B,002 d 'CustCode' ,ARCO . @ dsp,-0,,,,,,'Search Complete' . @ brk,0,A . Search was successfully completed. @ brk dsp,-0 . @ dsp,EDRW$,ERPT$ . @ rel .

45 Branching & Labels

46 MAPPER Labels @12 . @12: . Acceptable @012: . @0012: .
@0012: ldv <rpt>i4=1150 . You can put commands on the same line as the label. Labels are from 001 – 199, but can go higher (up to 599) if the run is registered for more. Acceptable Better

47 MAPPER @IF @GTO Branching
@ IF <flag> eq 'Y' . ; GTO LIN+2 . @. Do something here. @. Continue here.

48 MAPPER @IF @GTO Branching
@ IF <value> gt 3 . ; GTO @. Do something here. @ GTO @0004: Do something else here. @0006: . Continue here

49 MAPPER @IF @GTO Branching
@ IF <value> eq 3,(0004),12,(0006),'Y',(0008) . ; GTO @0004: Branch here if <value> = 3. @ GTO @0006: Branch here if <value> = 12. @0008: Branch here if <value> = Y. @ @0011: . Continue here

50 MAPPER @IF @GTO Branching
@ GTO END . Terminate run or return to calling run if LINKed. @ IF LINK$ gt 0 GTO END . ; REL . If this run was started from another run, return to that run. Else, terminate.

51 MAPPER @GTO Branching @ GTO RPX 047 .
Execute report 47 in the current drawer. Report 47 does not need to be registered as a run. (GTO RPX is a very old technique, still supported, but not recommended.)

52 MAPPER @ BLT or BLT Label Table

53 MAPPER Exercise Write a run that displays the message "No Finds" in the Output Area. Do NOT register the report as a run. Write a run that searches report 2B0 for all lines containing ZICO in the 'CustCode' field. If there are no finds, use GTO RPX to jump to the report you created in Step 1. @ srh,0,B,002,,,0150 d 'CustCode' ,ZICO . @ dsp,-0 . @ rel . @. @0150: GTO RPX 143 . This is report 143 @ brk . Clear Output Area No Finds @ GTO END .

54 MAPPER Exercise Search report 2B0 for all lines containing IP in the 'STCD' field. If more than 5 lines are found, display the result with the message 'more than 5 lines found' on the control line. If 5 or less lines are found, display the result with the message '5 or less lines found' on the control line. @ srh,0,B,002 d 'STCD' ,IP <found>i4 . @ if <found> gt 5 . ; gto @ ldv,p <msg>s80='More than 5 lines found'. @ gto @. @0057: . @ ldv,p <msg>s80='5 or less lines found' . @0058: dsp,-0,,,,,,<msg> . @ dsp,EDRW$,ERPT$ . @ rel .

55 Working With Reports

56 MAPPER @ADR Add Report @ ADR,0,B,,0199 @ LDV,w <rpt>i4=RPT$ .
Add a new report in drawer B0. Load the new report number into the <rpt> variable. Jump to label 0199 if the ADR fails.

57 MAPPER @LZR Line Zero Info.
@ LZR,0,B,011,0199 <lines>i4,<cpl>i3,<hdgs>i2 . Information about report 11B0. Capture the number of lines, characters per line, and number of headers lines in variables. Jump to label 0199 if the report 11B0 does not exist. .

58 MAPPER @ADD Append Report
@ SRH … . Create a -0 result @ ADD,-0,018,H,244 REP,-0,018,H,244 . Append the result to an existing report. This creates a new -0 result. Replace this result into report 244H18. @ ADD,-0,-2 RNM -2 . Add -0 result to -2 result, creating a new -0. Rename this as -2. -2 now contains the combined data.

59 MAPPER @RSL Create a Result
@ RSL,0,D,002 RNM -1 . Create a result copy of report 2D0, rename as -1 @ RSL,-1 RNM -2 . Create a copy of result -1, rename as -2 We now have two temporary copies of report 2D0

60 MAPPER @REP Replace Report
@ SOR … . Create a sorted -0 result @ REP,-0,018,H,244 . Sort some data. This creates a new -0 result. Replace this result into report 244H18. @ REP,018,H,202,018,H,210 . Copy report 202H18 into report 210H18. This either creates a new report or overwrites the previous report 210H18.

61 MAPPER @DUP Duplicate Report
@ DUP,-0,018,H . Copy result -0 into the next available report in drawer H18. @ DUP,018,H,132 . Copy report 132H18 into the next available report in drawer H18. Reserved words RPT$ and STAT1$ both contain the new report number.

62 MAPPER @DLR Delete Report
@ DLR,018,H,150,0199 . Delete report 150H18. Jump to label 199 if this report does not exist.

63 Reading Reports

64 MAPPER @FDR Find and Read
@ FDR,0,B,002 '' 'STCD' ,IP RLN 'CustCode' <CCode>s . Find the first record where the 'STCD' field = IP. Read the value of the 'CustCode' field into a variable <CCode> . The variable is declared here, type S, and automatically sized to the data field. RLN must be preceded by a successful FDR or RDL. @ FDR,-0 '' 2-1 *,= ,<ln0>i4 inc <ln0> . Find the start of the data in a report or result. (Find the *= line, then go to the following line.)

65 MAPPER @RDL Read Line @ SRH . . . RNM -2 .
@ FDR,-2 '' 2-1 *,= ,<ln2>i4 inc <ln2> . Find the start of the data in a report or result. @0002: . @ RDL,-2,<ln2>,0008 'RPT','ABST','STAT' \ . <Report>s,<Abstract>s,<Status>s . @ @ inc <ln2> GTO @. @0008: . Continue here when all data lines in -2 have been processed.

66 MAPPER @RDC Read Continuous
@ FDR,-2 '' 2-1 *,= ,<ln2>i4 inc <ln2> . @ BRK,0,A . @ RDC,-2,<ln2> 'Fld1','Fld2' <Val1>s,<Val2>s . Fld1 = <Val1> Fld2 = <Val2> @ BRK RNM -3 . Find the start of the data in a report or result. Create a new result in the Output Area. Read all the lines from result -2. Create one Output Area line for each data line. Break and rename the new result as -3. @ RDC must be followed by one Output Area line.

67 MAPPER @RDC Read Continuous
@ FDR,-2 '' 2-1 *,= ,<ln2>i4 inc <ln2> . @ BRK,0,A . *One .Two .Three .Four .Five . *======.======.======.======.======. @ RDC,-2,<ln2> 'Fld1','Fld2','Fld3','Fld4' \ <Alpha>s,<Bravo>s,<Charlie>s,<Delta>s . |<Charlie>|<Bravo>| |<Delta>|<Alpha> @ BRK RNM -3 . Reformat the data in result -2 into a new result -3. (For this example, fields in -2 result are assumed to be 6 characters in size.)

68 MAPPER @DVS Define Variable Size
@ DVS,0,D,002 'REP','CAT','QTY','Sale' \ <Var1>s,<Var2>s,<Var3>i,<Var4>s . Create variables equal in size to report fields.

69 MAPPER Exercise Search report 2B0 for records where 'STCD' = IP.
Create a result containing a subset of each record. Each line in the result should be of the format: Product Type: value … Serial Number: value … Cust Code: value Display the new result. Do the same thing, but put 3 lines in the new result for each record in your search result: Product Type: value Serial Number: value Cust Code: value HINT: you will need labels and a loop to do the second part, but not the first part. @ srh,0,B,2 d 'STCD' ,IP rnm -1 . @ fdr,-1 '' 2-1 *,= ,<ln1>i4 inc <ln1> . @ brk,0,B . @ rdc,-1,<ln1> 'ProductType','SerialNumber','CustCode' \ <PT>s,<SN>s,<CC>s . Product Type: <PT> Serial Number: <SN> Cust Code: <CC> @ brk dsp,-0 . @. @0002: . @ rdl,-1,<ln1>,0004 'ProductType','SerialNumber',\ 'CustCode' <PT>s,<SN>s,<CC>s . Product Type: <PT> Serial Number: <SN> Cust Code: <CC> @ inc <ln1> gto @0004: . @ dsp,EDRW$,ERPT$ . @ rel .

70 Updating Reports

71 MAPPER @LOK Lock for update
@ LOK,18,B,034 . Lock the report for updating. You must lock a permanent report before you can update it. (Don't need to lock a result.) Internally, this requires the run to wait for exclusive use of the report. @ ULK . Unlock the report after the update

72 MAPPER @LN+ Add Lines @ LDV <ln1>i4=37 .
@ LN+,-1,<ln1>,6 . Add 6 empty lines to result -1 after line 37. @ LOK,018,B,166 . @ LN+,018,B,166,,1,,'IPFEDS' @ ULK . Add 1 line to the end of report 166B18, containing the data shown.

73 MAPPER @LN- Delete Lines
@ LDV <ln1>i4=37 . @ LN-,-1,<ln1>,6 . Delete 6 lines from result -1, starting with line 37. @ LZR,018,B,166 <ln>i4 dec,4 <ln> . @ LOK,018,B,166 . @ LN-,018,B,166,<ln>,5 ULK . Delete the last 5 lines of report 166B18.

74 MAPPER @LNX Duplicate Lines
Duplicate line 12 of result -1 6 times. @ LOK,018,B,166 . @ FDR,018,B,166 '' 'UID' 'DAVE' . @ LNX,018,B,166,LINE$,1 ULK . Find the record with a 'UID' field of 'DAVE'. Duplicate this line. Note the use of the LINE$ reserved word. LINE$ contains the line number in the report where the FIND was made.

75 MAPPER @LNY, LNP Yank, Put Lines
@ FDR,018,B,166 '' 'UID' 'DAVE' . @ LNY,018,B,166,LINE$,12 . Find the record with a 'UID' field of 'DAVE'. YANK 12 lines. @ FDR,-2 '' 'UID' 'NEXT' ,<ln2>i4 . @ DEC <ln2> LNP,-2,<ln2> . PUT the Yank'd lines before the record with a 'UID' field of 'NEXT'. Note the use of the LINE$ reserved word

76 MAPPER @WRL Write Line @ LDV <Title>s79='Now is the time … '
@ LOK,18,B,034 . @ WRL,18,B,034,<line> 'RPT','ABST','STAT' \ ,<Report>,<Abstract>,<Status> ULK . Write 3 values into fields into a tab-type line in report 34B18. (Assume <line> has already been loaded.) @ LDV <Title>s79='Now is the time … ' @ WRL,-2,<ln2> 2-79 *,<Title> ULK . Load a string variable, write into an asterisk-type line in result -2. @WRL overwrites any existing data, and may also change the line type. The size of the field and the size of the data should match.

77 MAPPER @WRL Write Line @ LDV <Hdg1>s20='RPT .ABST .STAT .'
@ WRL,-2,<ln2> *,<Hdg1>/*,<Hdg2> . Assume -2 contains data in cols Assume -2 is at least 100 chars. wide. This example shows how to extend the report headers, thus adding 3 fields to the result in columns Your run can now use the fields 'RPT','ABST', and 'STAT'.

78 MAPPER @DFU / @CMU Deferred updates
@ DFU,0,F,001,018,H,013,\ 018,H,165,2756,B,495 . @ Update reports @ CMU . Defer updates on these reports: 1F0, 13H18, 165H18, 495B2756 Make changes to reports Commit all updates at once. "All or nothing" @DCU will decommit updates.

79 MAPPER @LCH Loc, Chg in a rpt
@ LZR,-2 ,<cpl>i3 . @ LCH,-2 afm 1-<cpl> [/< . Change [ to < @ LCH,-0 afm 1-<cpl> ]/> . Change ] to > Change all [ and ] to < and > Note that this command creates a new -0 result. This is how Cool ICE changes HTML tags. [TABLE] becomes <TABLE> If changing blanks, use the options afmt$

80 Run Functions

81 MAPPER @TOT Totalize @ TOT,0,D,002 'r.01' \ 'QTY','Sales','Cost' ,+,*,= . Multiply QTY times Sales, and store the result in Cost. Round to 2 decimal places. @ TOT,0,D,002 'os' 'QTY' ,+ Total the QTY field. Omit everything but the total from the result. Place total under the QTY field.

82 MAPPER @TOT Totalize Sort by REP and CAT.
@ SOR,0,D,002 '' 'REP','CAT' ,1,2 @ TOT,-0 'osr.01j(c)' \ 'REP','CAT','QTY','Sales' \ ,s1,s2,+,+ . Sort by REP and CAT. Subtotal QTY and Sales by REP and CAT. Omit all but subtotals from results. Round to 2 decimal places. Insert commas.

83 MAPPER @TOT Totalize Fill fields with data.
@ TOT,0,D,002 '' 'OrderNumber',\ 'OrderDate' ,=GoodBye,=DATE11$ . Fill fields with data. Fill the OrderNumber field with the word "GoodBye". Fill the OrderDate field with today's date, in YYYYMMDD format. Many TOT examples in the Help.

84 MAPPER @MCH Match @ MCH,0,C,001,0,B,002 'd' \ 'ProductType','ProducCost' ,1,a \ 'ProductType','ProducCost' ,1,a . Copy the ProducCost field from 1C0 to the ProducCost of 2B0 where the ProductType fields are equal.

85 MAPPER @MCH Match @ MCH,0,D,001,0,C,001 'dn' \ 'ProductType' ,1 \ 'ProductType' ,1 . Display the records in 1C0 that do not have a matching ProductType in 1D0.

86 MAPPER @MCH Match @ rsl,018,H,021 rnm -2 .
@ ldv <Hdg1>s16='Price .Qty .' . @ ldv <Hdg2>s16='========.======.' . @ wrl,-2, *,<Hdg1>/*,<Hdg2> . @ mch,018,H,020,-2 d \ 'UPCNum','PricePerKg','QtyonHand' ,1,a,b \ 'UPCNum','Price','Qty' ,1,a,b . @ rep,-0,018,H,021 . Add 2 fields to 21H18, copy data from 20H18 where UPCNum fields match, replace result back into 21H18.

87 MAPPER @MCH Match

88 MAPPER @CHG INPUT$ Accept command line input
@ CHG INPUT$ <DoSort>h1 . @ RSL,0,B,002 . @ IF <DoSort> eq 'Y' . ; GTO LIN+2 . @ SOR,-0 '' 'STCD' ,1 . If a Y was passed as a command line parameter, sort the data. Otherwise, skip the sort. MYRUN,Y vs MYRUN

89 MAPPER @CHG INPUT$ RDI,select,f0,OracDB,scott,tiger
@ CHG INPUT$ <Task>s8,<drw>s5,<db>s32,\ <user>s16,<pwd>s16 . @ LDV,P <Task>,<drw>,<db>,<user>,<pwd> The RDI run accesses a relational database. The run accepts the task, data drawer, database name, db user-ID, and db password as command line parameters. This is also sometimes called Fast Access because the run now does not need to solicit this information.

90 Change or load a variable
MAPPER @CHG Variables Change or load a variable @ CHG <SOE>h1 SOE$ . @ CHG <Counter> <Counter> + 1 . @ INC <counter> . CHG is a more expensive command than INC or DEC. Try to use INC or DEC whenever possible, rather than CHG.

91 MAPPER Exercise Search report 2B0 for all lines that have a Status Code of SH and Ship Dates for the 4th quarter (October through December). Match the result with report 1C0 to copy the 'ProducCost' field into the result. (1C0 is the issuing report.) ('ProductType' is the common field.) Sort the result by 'ProductType' within 'CustCode'. Rename this result as -7. Using -7, get a grand total of the 'ProducCost' field, rename the result. Using -7, subtotal the 'ProductCost' field by 'CustCode', rename the result. Append the Grand Total result to the Subtotal result. Display the result of the ADD, end the run. @ srh,0,B,002 d 'STCD','ShipDate(3-2)' ,SH,10/r,SH,12 . @ dsp,-0 . @ mch,0,C,001,-0 d 'ProductType','ProducCost' ,1,a \ 'ProductType','ProducCost' ,1,a . @ sor,-0 '' 'CustCode','ProductType' ,1,2 rnm -7 . @ tot,-7 '' 'ProducCost' ,+ rnm -1 . @ dsp,-1 . @ tot,-7 '' 'ProducCost','CustCode' ,+,s rnm -2 . @ dsp,-2 . @ add,-1,-2 . @ dsp,EDRW$,ERPT$ . @ rel .

92 Performing Calculations

93 MAPPER @CAL Calculate @ CAL,0,B,2 '' 'STCD','StatusDate',\
'ProductType'(1-5),'CustCode','SpcCod',\ 'ShipDate','ShipOrder' ,a,b,c,d,e,f,g \ if:c="BLACK";then:c="WHITE";\ if:c="GREEN";then:c="Brown";\ if:a="IP"&d="AMCO";then:e=LINE;\ then:f,d(1)=d1(b)+90;then:g,d(w)=d1(f); Change BLACKBOX to WHITEBOX and GREENBOX to BrownBOX If STCD = IP and CustCode = AMCO then: store line number in SpcCod, add 90 days to StatusDate, and store the new date & day of the week in ShipDate & ShipOrder.

94 MAPPER @CAL Calculate

95 MAPPER @CAL Calculate .Product . . .Number .ProdSize .
.============.==========. |LAG | | @ cal,18,H,038 '' 'ProductNumber(5-3)',\ ProductNumber(9-4),'ProdSize' ,a,b,c \ c="";c(1-4)=b;c(6-3)=a; dsp,-0 . Copied as numbers. Close, but not quite what we want.

96 MAPPER @CAL Calculate .Product . . .Number .ProdSize .
.============.==========. |LAG | | @ cal,18,H,038 '' 'ProductNumber(5-3)',\ ProductNumber(9-4),'ProdSize' ,a,b,c \ c="";c(1-4)=LIT(b);c(6-3)=LIT(a); @ dsp,-0 . Copied as character strings.

97 MAPPER @CAL Calculate Problem: Sort data by Day and Time. Saturday – Friday and AM before PM

98 MAPPER @CAL Calculate @ cal,-0 '' 'Day','Time'(1-2),'Time'(3-3),\
'Time'(7-2),'DY','Tyme'(1-2),'Tyme'(3-3) \ ,a,b,c,d,e,f,g f=lit(b);g=lit(c);\ if:a="Saturday";then:e=0;\ if:a="Sunday";then:e=1;\ if:a="Monday";then:e=2;\ if:a="Tuesday";then:e=3;\ if:a="Wednesday";then:e=4;\ if:a="Thursday";then:e=5;\ if:a="Friday";then:e=6;\ if:d="PM";then:if:b<12;then:f=b+12; . @ SOR,-0 '' 'DY','Tyme' ,1,2 .

99 MAPPER @CAL Calculate @ brk,0,A . *C.P.S.Q D .M .Y
*=.=.=.======.==.==.====. | @ brk lnx,-0,4,100 . @ cal,-0 '' 'C','P','S','Q','D','M' \ ,a,b,c,d,e,f a=RAN(1,5);\ b=RAN(1,5);c=RAN(1,5);d=RAN(12,50);\ e,j(z)=RAN(1,31);f,j(z)=RAN(1,12);\ ALPHA=VMAX(d);BETA=VSUM(f);GAMMA=VAVG(e) \ <alpha>i6,<beta>i6,<gamma>f6.2 rnm -1 .

100 MAPPER @CAL Calculate @ dsp,-1 . Beta = <beta>
@ brk,0,A . Alpha = <alpha> Beta = <beta> Gamma = <gamma> @ brk dsp,-0 .

101 MAPPER Exercise Display report 2B0.
to make the following changes: Add 100 to each 'SerialNumber'. If 'STCD' = OR, change the value to XX If 'CustCode' = FEDS, write the current line number in the 'SpcCod' field. Display the result. @ dsp,0,B,002 . @ cal,0,B,002 '' 'STCD','SerialNumber',\ 'CustCode','SpcCod' \ ,a,b,c,d b=b+100;\ if:a="OR";then:a="XX";\ if:c="FEDS";then:d=LINE; . @ dsp,-0 . @ rel .

102 MAPPER Count Examples 2D0
Use REP as the key field, subtotal Qty, Sale. Make a list of all the different products. Scale OrderDate by quarter, use REP and CAT as key fields, subtotal Qty, Sale Statistical calculations on QTY field Entry count, Sum, Average Standard Deviation, Variance

103 COUNT Example Subtotal Qty and Sale fields (2 dec. places), for each Rep. Only display fields used. Equivalent run statement: @ CNT,0,D,2 'p' 'Rep','Qty','Sale' DSP,-0

104 COUNT Example Results

105 COUNT Example Show the number of records for each product category.
Equivalent run statement: @ CNT,0,D,2 'p' 'Rep','Cat' ,=,1 DSP,-0

106 COUNT Example Results

107 COUNT Example Subtotal Qty, Sale (2 dec. places) by week (OrderDate) (Dates are all in January, 1997) Equivalent run statement: @CNT,0,D,2 'ps1d11(1w)' 'Orderdate','Qty','Sale' \ ,1,+,+/r,,, DSP,-0

108 COUNT Example Results

109 COUNT Example S option S2d11(1m/19900901/19910402) S Scaling option 2
Scale on key field 2 D11 Dates are in DATE11$ format (YYYYMMDD) 1m Interval is 1 month Sept. 1, 1990 is the first date to scale April 2, 1991 is the last date to scale Dates outside this range are excluded.

110 COUNT Example Statistical calculations on QTY: Entry count, Sum, Average, Std. Dev., Variance Entry Ct Sum Average Std. Dev. Variance Equivalent run statement: @CNT,0,D,2 'ph' 2-1,'Qty' \ ,1,=/,1,+/,1,'/'/,1,!-/,1,!!-

111 MAPPER Suggestion You should read up on both the Calculate (CAL) and Count (CNT) commands in the HELP to better understand the power they offer. Then play with them. You will find many different uses for them.

112 MAPPER Exercise Make a result of the data in the HousesDescription report (23H) and add the fields 'Listed' and 'Price' to end of the header line. Copy the data for these two fields from the HousesData report (22H) into the result. Scale the 'Listed' field by month and place the entry count for each interval in the 'Price' field. Display the result. @ rsl,18,H,23 . @ wrl,-0, *,'Listed.Price .'/*,'======.======.' @ dsp,-0 . @ mch,18,H,22,-0 d 'house_no','listed','price' ,1,a,b \ . 'house_no','listed','price' ,1,a,b . @ cnt,-0 'ps1d1(1m/900901/910202)' 'Listed','Price' ,1,= . @ dsp,EDRW$,ERPT$ . @ rel . @.

113 Constants & Named Reports

114 MAPPER :DEFINE Constants

115 MAPPER :DEFINE Constants
BLT replaces all :DEFINE labels with their values. Internally, BIS does this automatically before executing a run.

116 MAPPER NAME – Named Reports
Use the NAME run to assign a name to a report or range of reports. You can then use this name in your run in place of C,D,R Use the NAMES run to display named reports available to you.

117 MAPPER Named Reports NAME run – create a new named report.
NAMES run – display existing named reports.

118 MAPPER Named Reports

119 MAPPER Named Reports Search a range of reports. 41-44F0
@ SRH,'ELECTION' dh 'S DST' , Search a range of reports F0 @ SOR,'INVENTORY' '' 'Price' ,1 . Sort a named report. 1F0 This is another way of defining a CONSTANT. We can change the definition of a named report without changing the run.

120 Date Commands

121 MAPPER @DAT – Dates in a report
@ DAT,0,B,002 '' 'ProducPlan',\ 'ProducActual','ShipDate' ,+,-,= . Compute difference between Plan Date and Actual Date. Put value in ShipDate field.

122 MAPPER @DAT – Dates in a report
@ DAT,0,B,002 'w' 'ProducActual',\ 'ShipDate','SpcCod' ,b,i=,: . Convert Actual Date to MMDDYY format, determine day of week.

123 MAPPER @DC – Dates in variables
@ dc dw=today <THEDAY>s9 . Determine today's day of the week. @ dc d7=today+5;dw=a <DATE1>s18,<DAY1>s9 Determine date, day of the week 5 days from today. @ dc d7=today-4;dw=a <DATE2>s18,<DAY2>s9 Determine date, day of the week 4 days before today. @ dc d11( )-d11( ) <DAY3>s5 Determine the number of days from August 15, 2002 to March 11, 2004. See the Help for more DAT and DC examples.

124 MAPPER Exercise Use ACME-Orders (12H) as your data.
Convert the 'OrderDate' field to DATE7$ format. Do this in 2 stages: to reformat the date portion of 'OrderDate' to DATE11$ format in another field. to copy data back to the 'OrderDate' field, converting to DATE7$ format. @ @. .OrderDate ShipDate @. .===================.===================. @ :50: :50:24 @. @ cal,18,H,12 '' 'OrderDate(1-4)','OrderDate(6-2)', 'OrderDate(9-2)',\ 'ShipDate(1-10)','ShipDate(11-9)' ,a,b,c,d,e d="";e="";\ d(1-4)=LIT(a);d(5-2)=LIT(b);d(7-2)=LIT(c); dsp,-0 . @ dat,-0 '' 'OrderDate','ShipDate' ,h=,l . @ dsp,-0 . @ dsp,EDRW$,ERPT$ . @ rel .

125 Subroutines

126 MAPPER @RSR Run Subroutine
@ RSR Run subroutine at label . Run execution resumes here . . . @0021: . Start of subroutine @ ESR . End subroutine While executing the subroutine, the same environment (variables and results) is available. Changes made to variables and results are available after the subroutine has finished.

127 MAPPER @RSR Run Subroutine
@ RSR,0018,B, @ . Run subroutine at label 0021 in report . Run execution resumes here . . . @0021: . Start of subroutine @ ESR . End subroutine While executing the subroutine, the same environment (variables and results) is available. Changes made to variables and results are available after the subroutine has finished.

128 MAPPER @CALL Call Subroutine
@ CALL (<qty>,<Price>) . @ . Call subroutine at label @ . Run execution resumes here . . . @0021: (<Q>,<P>) . Start of subroutine @ RETURN . End subroutine Only variables passed as parameters are available in the subroutine. Current -0 is also passed to sub. All variables in the subroutine are local to it. -0 from subroutine is passed back to caller.

129 MAPPER @CALL Call Subroutine
@ CALL,0018,B, (<qty>,<Price>) . @ . Call subroutine at label 0021 in report 10B18 @ . Run execution resumes here . . . @0021: (<Q>,<P>) . Start of subroutine @ RETURN . End subroutine Only variables passed as parameters are available in the subroutine. Current -0 is also passed to sub. All variables in the subroutine are local to it. -0 from subroutine is passed back to caller.

130 MAPPER @CALL Call Subroutine
*========= @ CHG INPUT$ . . . @ CALL 0001 () . @ REL . @ . @0001: () . Start of subroutine . . . @ RETURN . End subroutine The entire run is structured as a called subroutine. Now the logic is available as a stand-alone run, and as a routine that other runs can call.

131 MAPPER @CSR Clear Subroutine
Clear the "in subroutine" status of RSR, and let the run continue on from this point. You can no longer return to the calling run.

132 MAPPER Exercise Create a data result.
Load a variable with a search parameter. In a RSR subroutine, search the data for the value in the search parameter variable. Return to the main run and display the search result. CALL a different subroutine to do the same task Pass the ORIGINAL data result to the subroutine Pass the search parameter variable to the subroutine, but call it a different name inside the subroutine HINT: You will need to in this run. @ rsl,0,B,2 rnm -1 ldv <SrhParm>s2='IP' . @ RSR @ dsp,-0 . @ rsl,-1 ldv <SrhParm>='OR' . @ CALL 0151 (<SrhParm>) . @ rel . @. @0150: srh,-1 d 'STCD' ,<SrhParm> . @ ESR . @0151: (<Parm>) . @ srh,-0 d 'STCD' ,<Parm> @ RETURN .

133 MAPPER @RER Register Error Routine
@ RER,000,E, Register the standard RUNERR error routine in case your run gets an error. @ RER Register label 0199 in the current run as the error label to go to if the run gets an error.

134 MAPPER @RAR Register Abort Routine
@ RAR,000,E, Register this routine as the place to go to if the user aborts the run. @ RAR Register label 0199 in the current run as the label to go to if the run is aborted.

135 MAPPER @CER and CAR Clear Error / Abort Routine
Cancels a previously-registered error or abort routine, and reverts back to whatever error or abort routine was in place before the most This allows different portions of an application to have different error or abort routines.

136 MAPPER @LNK Link to a run
@ LNK DAVE,Parm1,Parm2,Parm3 . Link to the run DAVE, passing 3 parameters and the current run's -0 result. @ IF LINK$ gt 0,(END) . ; . DAVE run tests to see if it was LNK'd to. If so, GTO END ends the DAVE run and returns to the calling run. @LNK lets you effectively treat another run as a subroutine. You can pass parameters and input data, and receive back the other run's -0 result.

137 MAPPER @RUN Execute a run
@ RUN DAVE . Run the DAVE run @ RUN RDI,select,f0,orac,scott,tiger . RDI run Execute a registered run. The current -0 result is passed to the executed run, along with up to 80 parameters. Parameters are available as INPUT$ The current run ends, and does not regain control.

138 Advanced Run Functions

139 MAPPER @BR Background run
@ BR DAVE . Run the DAVE run @ BR FETCHRUN,orac,scott,tiger . Database run This command starts a run as a "batch job". There is no connection with a terminal, station, or user. No display or user interaction of any kind is allowed. BIS will error the run if a prohibited run statement is encountered. As the current -0 result is passed to the background run, along with up to 80 parameters.

140 MAPPER @SCH Schedule run statement
@ SCH BR DAVE . Schedule the DAVE run in background. @ SCH,, BR FETCHRUN,orac,scott,tiger . Schedule a database run in background. The run will start tonight at 10:30 PM. @ DC d1=today+3 <Date>s6 . @ SCH,<date>, BR DAVE . Schedule the DAVE run in background. The run will start 3 days from today at 5:45 PM.

141 MAPPER @SNU Send to User
@ SNU,18,B,034,JDOE,7 . Send report 34B18 to JDOE in Dept. 7 @ SNU,-0,DWY,2 . Send result -0 to DWY in Dept. 2 Manually display the message as a result with the MSG command. Save the result, if desired. Remove the message from the queue with the OK command.

142 MAPPER @PRT / @AUX Print
@ prt,-0,y,,,4,,2,Bobcat,Dave,y . Print the current -0 result. Delete line numbers 4 copies Double-space report System printer queue "Bobcat" Banner "Dave" Print report headings on the first page only @ aux,0,C,001,756 . Print report 1C0 on the local printer of station 756

143 MAPPER @LDV,Q Load variables based on content.
Assume <string> contains tab-separated values: John Smith Minneapolis . . . @ LDV,Q <Name>s32=<string>,0,\ <phone>s18=<string>,1,<City>s40=<string>,2 . Assume <string> contains colon-separated values: John Smith: :Minneapolis: . . . @ LDV,Q <Name>s32=<string>,0(:),\ <phone>s18=<string>,1(:),\ <City>s40=<string>,2(:) . Default field separator is a tab.

144 MAPPER @BFN Binary Find
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 . . . 1020 Each "look" into the data eliminates ½ of the list. Data must already be sorted. Very rapidly find a record in a very large list. 2 3 In this example, we search for a value of 1008. Find it in 3 attempts, rather than an average of 10. 1

145 MAPPER @BFN Binary Find
@ BFN,018,H,001 '' 'ID' \ ,<ID>(1-4) ,<vlno>i . @ RDL,018,H,001,<vlno> \ 'RPT' <vrpt>i . @ FDR,018,H,<vrpt> 'ID' \ ,<ID> ,<vlno> . @ RLN,018,H,<vrpt> \ 'FLD1', ... <Val1>, ... Find the ID value, read the report number from the index table. Find the ID value in the report, read associated data. ID RPT 1001 4602 1002 2417 1003 0002 1004 3977 1005 1153 1006 0388 1007 1019 1008 4997 1009 0054 1010 3107

146 MAPPER @HSH Hashing @ HSH <rpt>i4=<ID>,2-5000 .
@ BFN,<C>,<D>,<rpt> '' 'ID' ,<ID> \ ,<vlno>i6 . @ RDL,<C>,<D>,<rpt>,<vlno> \ 'Fld1', ... <Val1>s ... Find the Hashed report number where this data record is stored, based on the ID value. Given the same <ID> value and the same range, HSH will always generate the same number.

147 MAPPER Hashing: BIS-C vs 2200
BIS-C and BIS-2200 do not generate the same Hash values. If migrating an application from one platform to the other, the data must be re-hashed. BIS-2200 will create Hash values This is not available on BIS-C. You mush for hashing.

148 MAPPER Update Commands
There are several commands that combine their operation with the update capability. Search, Match, Calculate are three. These command will have a new call: Search update is SU Match update is MAU Calculate update is CALU

149 MAPPER Update Commands
First think of these commands as their original operation. For example, with Search we search for a specific string of information in a specific field or column. The result is a result containing only the lines of information the met the search criteria. Search Update works the same way, but now we can make a change to this result and have that change placed back into the original report. We could also delete these lines from the original report, or extract them out of the original report and create a new result containing just those lines.

150 MAPPER Update Commands
Update (UPD) takes the current result on display and places information back in the original report. Delete (DEL) takes the current result and deletes it from the original report. Extract (EXT) takes the current result and deletes it from the original report and displays the deleted information as a result.

151 MAPPER @SRU Search Update
@ SRU,0,B,006 d 'STCD' ,IP . @ DSP,-0 . Display UPDATE result Make manual updates to the result on display and then type one of these commands: UPD update report with these changes EXT remove selected records and save in a new result. DEL remove selected records

152 MAPPER @SRU Search Update
@ SRU,0,B,006 d 'STCD' ,IP EXT . @ DUP,-0,0,B . Remove all found records from 6B0. Save in the next available report in drawer B0. New report number is in RPT$.

153 MAPPER @SRU Search Update
@ SRU,0,B,006 d 'STCD' ,IP DEL . Remove all found records from 6B0. @SRU can only be done to a permanent report, not a result.

154 MAPPER @CAU Calculate Update
@ CAU,0,B,006 '' 'ProductType'(1-5) \ ,a if:a="BLACK";then:a="WHITE"; UPD Change all "BLACKBOX" strings to "WHITEBOX" and save the changes back into the permanent report. @CAU can only be done to a permanent report, not a result.

155 MAPPER Networking

156 Networking Run Commands
@NET Network Sign-on @NRD Network Read @NWR Network Write @NRN Network Run @NRM Network Remote @NRT Network Return @NOF Network Sign-off Networking Run Commands There are seven networking run commands. We will go through each of these commands.

157 MAPPER Network Config. Report
Any name you choose Network name or IP address Comm Type Port Number Site letters

158 MAPPER MAPPER Networking
@ NET,RV-Cool4,A,JDOE,7 . Connect @ NRD,0,F,001,0,F . Read @ NOF . Disconnect @ DSP,-0 . Display Connect to a remote MAPPER system. Retrieve a report back to a local result. Disconnect and display the result.

159 MAPPER MAPPER Networking
@ NET,RV-Cool4,A,JDOE,7 . Connect @ NWR,0,F,001,0,F,008 . Write @ NOF . Disconnect Copy a local report to a remote permanent report. Disconnect.

160 MAPPER MAPPER Networking
@ NET,RV-Cool4,A,JDOE,7 . Connect @ NRM "^" . Write @ NOF . Disconnect Establish a manual session on the remote system. Return by typing the command ^^

161 MAPPER MAPPER Networking
@ NET,RV-Cool4,A,JDOE,7 . Connect @ NRN '' 'Type' ,1 " . Execute a run statement on the remote system. @ NRD,0,F,-0,0,F . Read result @ NOF DSP,-0 . Disconnect Execute a run statement on the remote system. Read back the result and display.

162 MAPPER MAPPER Networking
@ BRK . Create subroutine in result SRH,<C>,<D>,<R> . . . CAL, ' TOT, ' CNT, ' ESR . ' @ BRK . @ NET,RV-Cool4,A,JDOE,7 . Connect @ NWR,-0,-1 . Write to remote @ NRN " . Execute the subroutine @ NRD,-0,0,F . Read result @ NOF . Disconnect Build a subroutine in a result on the local system, pass it to the remote, and execute it there. Read back the result.

163 MAPPER Exercise Connect to a remote MAPPER system and pass over and execute a subroutine to: Load a variable with the MAPNAM$ reserved word Dump this variable into the Output Area and save as a result Read back the result, read the variable from it, and display the value as a local variable. When you finish, see Example 1 in the Help for command for an alternate solution. @ brk . ldv,wp <MAPNAM>s18=MAPNAM$ . ' . ' '<MAPNAM>' ESR . ' @ net,RV-COOL4,A,dwy,2 . @ nwr,-0,-1 . @ nrn, " <msg>s80 . @ nrd,-0,0,A . @ nof . @ rdl,-0, <Var>s18 . @ dsp,-0,,,,,,<Var> . @ rel . @. @150: dsp,-0,,,,,,<msg> . Error label

164 Calling Legacy Applications
MAPPER Networking Calling Legacy Applications

165 MAPPER Legacy app. logic
Enterprise server Input BIS run NT Server @CALL request Process This slide illustrates how to use the business logic of a legacy MAPPER application, but bypass the legacy presentation mechanism. (The legacy application can also continue to run in the traditional terminal environment.) You need to add Cool ICE entry and exit points in the 2200 run. The Cool ICE entry point is just after the point in the run where the run INPUT$ to gets its input from the screen. Data passed from the Cool ICE service provides the same values as normally come from the screen. At this point the internal logic of the run can proceed, since the run has the variables it expects, not knowing or caring where they came from. The Cool ICE exit point is just before the run would normally do its terminal display. The run builds a data result for the Cool ICE service and returns it to the Cool ICE service. New code is needed in the 2200 run to handle loading the variables and building the data result, as well as a flag to ensure that the new code is not executed in the old environment. Data returned Output

166 MAPPER MAPPER Networking
@ BRK,0,A . Create input data result *Var Value *==========.====================. |Name Dave |Addr Main St. |Phone @ BRK . @ NET,RV-Cool4,A,JDOE,7 . Connect @ NWR,-0,-0 . Write to remote @ NRN <Label>() " . @ NRD,-0,0,F . Read result @ NOF . Disconnect Execute statement on the remote system, passing an input result built locally. Read back the result.

167 MAPPER Calling MAPPER-2200 runs and data
@. Input data is in -8 @ NET,MAP22,,jdoe,7,password . @ NWR,-8,<cab>,<drw>,-0 . @ NRN 021 () . " . @ BRK,0,F BRK . @ NRD,<cab>,<drw>,-0,-0 . @ NOF . This slide shows how a Cool ICE service makes a MAPPER networking connection to the 2200 MAPPER system. The service writes a data report to the 2200 and then to send over statement. This is what executes the legacy run logic on the 2200. The 2200 routine finished This gives control back to the Cool ICE service, which retrieves the data result from the 2200 and closes the connection. The Cool ICE service now has the data from the 2200 run in its own local result, and can use it to build the Web page.

168 MAPPER Processing on MAPPER-2200
@021: () . Entry point @ RNM -8 . @ FDR,-8 '' 'Var' ,Name . @ RLN 'Value' <Name>s . @ FDR,-8 '' 'Var' ,Addr . @ RLN 'Value' <Addr>s . @. Read other input values @101: . Execute run logic @ RETURN . This slide shows an example of the Cool ICE entry point in the 2200 run. Data from the Cool ICE service comes in in the -0 result. This example uses data in the format: *NAME Martha Jefferson We to find the *NAME tag, go to the following line, and read the value from columns 2-20. This is how we load the run’s variables with the correct values from the Cool ICE browser screen. By using the correct variable names, we can “fake out” the 2200 run into thinking its input came from the traditional MAPPER terminal screen. At Label 101 the existing internal logic of the 2200 run takes place just as it always has.

169 MAPPER Changes needed on MAPPER-2200
@CHG INPUT$ <name>s20, ... @GTO 101 . @021: () . Web entry point @. Read same values from input @. result as come from screen @101: . Execute run logic . . . @ RETURN . Back to MAPPER NT This slide shows an example of the Cool ICE exit point in the 2200 run. After the internal logic of the run has finished, the run builds a data result for the Cool ICE service and then (This is shown on the following slide.) This sends the -0 data result back to the Cool ICE service that called this routine.

170 MAPPER Building the data result on MAPPER-2200
@101: . Execute run logic . . . @BRK . *Field Value *=============.===============. |Total |64992 |Average |138.64 |Records |576 @RETURN . Back to MAPPER NT This slide shows an example of the 2200 run building the data result to be returned to the Cool ICE service. The usual technique (my usual technique) is to build a 2-column result containing field names and their values. These usually correspond directly to a set of variable names that the Cool ICE service will use in building the Web page in the Output Area. The exact formatting is not so important. What is important is that the Cool ICE service receives the data it needs in a format it understands.

171 MAPPER Relational Interface (MRI)

172 MAPPER MAPPER Relational Interface
Overview of MRI Using MRI Run statements RDI user interface run MRI configuration Summary This is what I plan to cover in our session today. We’ll examine what MRI is, what makes up MRI, and how we use and configure MRI. Then we’ll look at where MRI is today and where we see the product going in the near future. Because of the widely varying experience levels that members of the audience have with MRI, I’ve tried to strike a balance and present the appropriate mix of background and new information. I’ll be describing the capabilities of MAPPER/MRI, rather than conducting a tutorial on the specifics of how to use and configure it. That information is provided in the Unisys documentation listed at the end of my slides.

173 MAPPER MAPPER Relational Interface
Connects MAPPER with popular relational databases ORACLE, INFORMIX, SYBASE, ODBC RDMS2200, DMS II, SQLDB Local and remote databases Full update capability Manage databases Ad hoc access and application development Depending on the platform, MRI is either a feature of MAPPER itself, or a separate, but associated product. In all cases, the MAPPER Relational Interface is what enables MAPPER to connect with relational databases. Databases such as RDMS2200, DMS II, Oracle, Informix and Sybase. These databases may be on the same machine as your MAPPER system, or they may be on a remote host. Access to the database is not limited to just queries. You have full update access to your relational database. You can insert, change, or delete lines in tables. You can also create and drop entire tables. Using MAPPER/MRI, you can get to your relational database on an ad hoc basis without writing any code. Or you can develop your own applications. This is far more capability that the typical ODBC interfaces available today.

174 MAPPER MAPPER Relational Interface
Why use MRI? Access to relational data from within MAPPER without writing SQL MRI handles the details of each database Full power of MAPPER is available Extensive connectivity Applications are portable Using MAPPER/MRI, you can access your relational data without having to write any SQL code. MRI handles the specific details of each supported database. Internally, MRI creates the specific SQL for that database. Data is returned in a MAPPER result. At this point, the full power of MAPPER is available to further process the data any way you like. MRI has extensive connectivity capabilities, which enable you to connect with several different relational databases on different hardware platforms, using several different communication methods. Because this is MAPPER, applications are much more easily ported between platforms than other types of relational database applications.

175 How can I use MAPPER/MRI?
MAPPER MAPPER Relational Interface How can I use MAPPER/MRI? Ad hoc access to databases Manage your databases Application development Full power of MAPPER is available 3-tiered connectivity Put applications and data where they make sense There are numerous ways in which your site can make use of MAPPER/MRI. You can have ad hoc access to your relational data without writing any code or having to know SQL. This is done using the RDI run, which I’ll be describing in just a moment. Even though the bulk of database access is for queries, MAPPER/MRI also provides full update capability. This lets you manage your database, rather than just read from it. The MRI run statements let your applications connect to your relational data, and you still have the full power of MAPPER to further process your data and run the rest of the application. Since MAPPER/MRI connects to all 3 tiers of the Unisys architecture, you can put your applications and your data on the platforms where they make sense for your site.

176 MAPPER MAPPER Relational Interface
MRI consists of: MRIM server program 8 run statements RDI - user interface run Configuration files MRIDBA - administration run

177 MAPPER MRI Components MRIM MAPPER 3GL Applications Other Interfaces
Run Stmts RDI MRIM SQL Data 3GL Applications Other Interfaces Database RDBMS Syntax Analysis Relational Database

178 MAPPER MRI Networking MAPPER MRI Departmental (Windows/SUN/Linux)
SYBASE® ORACLE® INFORMIX® MAPPER Enterprise Server (2200/A Series) MRI 2200 RDMS A Series DBMS MAPPER MRI PC Windows SYBASE® ORACLE® MAPPER Net MAPPER Net MAPPER Net MAPPER Net This slide shows the extensive connectivity available with MRI. You can talk MAPPER-to-MAPPER-to-MRI-to-database. You can talk MAPPER-to-MRI-to-MRI-to-database. In this manner you can get to any database in the system from any MAPPER. The only restriction is that MAPPER/MRI on the PC platform can only be a client.

179 MAPPER MRI – Third Party Networking
MSW MAPPER MRIM SQL*NET® SQL Server® Open System 3GL Application SQL*NET® SQL Server® ORACLE® SYBASE® MAPPER Networking is our connection of choice, but there are some enviroments where it is not possible. For example, the database server is on a platform where MAPPER does not currently run. We can connect to the non-Unisys database systems using networking facilities provided by the 3rd party data managers .

180 MAPPER MRI Summary MRI lets MAPPER connect to relational databases
ad hoc access via RDI develop applications using run statements full power of MAPPER manage configurations via MRIDBA Transparent connectivity to different databases between hardware platforms put applications and data where they make sense

181 MAPPER MAPPER Run Statements
MAPPER Relational Interface (MRI) @LGN Connect to a relational database @LGF Disconnect to a relational database @DDI Get a description of a relational table @FCH Retrieve data from a relational database @RAM Modify a relational database @SQL Submit free-form SQL syntax @TRC Capture generated SQL syntax @MQL Submit SQL to MAPPER database

182 MAPPER MAPPER Relational Interface
@ LDV,p <table>s24='Employees' . Housekeeping @ LDV,p <DB>s24='UGSIData' . @ LDV,p <user>s16='Scott',<pwd>s16='tiger' . @ BRK . Create SQL in result *=== SELECT * from <table> order by EMP_ID ; @ BRK RNM -1 . @ LGN,009,Y,0,A,<DB> '',,<user>,<pwd> . Log on @ FCH,0,I,019,,,,,Y,,,,,,,,<DB> 'c ',-1 . FETCH @ LGF,029,n,<DB> . Log off @ DSP,-0 . Display result Connect to a relational database, submit an SQL statement, disconnect. Display the result.

183 MAPPER MAPPER Relational Interface
@009: . Logon failure . @ LDV,p <MSG>s80='Logon to '<DB>' failed' . @ GTO 099 . @019: . FETCH failure . @ LDV,p <MSG>s80='FETCH from '<table>' failed' . @029: . Logoff failure . @ LDV,p <MSG>s80='Logoff from '<DB>' failed' . @099:dsp,-0,,,,,,<MSG> . @ dsp,EDRW$,ERPT$ . @ rel . Error message display

184 MAPPER MAPPER Relational Interface
Network Configuration Report (1C2) Database name used in the run ODBC Data Source name configured in NT

185 MAPPER MAPPER Relational Interface
@ brk,0,a . *===== SELECT Rep, Cat, Qty, Sale, Cost from "2D0" ORDER BY ProductNumber ; @ brk rnm -1 . @ mql,0,f '',-1 dsp,-0 . Submit SQL statements to MAPPER database.

186 MAPPER MAPPER Relational Interface
RDI tiger

187 MAPPER MAPPER Relational Interface
RDI,,,UGSIData,scott,tiger

188 MAPPER MAPPER Relational Interface
RDI,SELECT,F0,UGSIData,scott,tiger

189 MAPPER MAPPER Relational Interface
List of available tables

190 MAPPER MAPPER Relational Interface
Description of table

191 MAPPER MAPPER Relational Interface
Enter ? to see available choices

192 MAPPER MAPPER Relational Interface
Choose columns and order to display Press F1 key

193 MAPPER MAPPER Relational Interface
Data in a result. All BIS functions available.

194 MAPPER Exercise Cabinet-Switch to remote BIS system. (Instructor will supply details.) Create a new report in the A0 drawer, and register it as XXX using the REG command. Write a run to: Connect to a relational database and retrieve data Further process the data set using BIS functions (Try to avoid SRH and SOR, since these are better accomplished with SQL WHERE and ORDER BY.) Use the RDI run as needed to test connectivity to the database, availability of tables, etc. Instructor will supply database, sign-on details. @ ldv,p <db>s18='UGSIData',<user>s8='mri',<pwd>s8='mri' . @ ldv,p <table1>s24='HousesData',<table2>s24='HousesDescription' . @ brk,0,A . *=== SELECT * from <table1> t1,<table2> t2 WHERE t1.House_No = t2.House_No ORDER BY County, Location ; @ brk rnm -1 . @. @ lgn,0008,y,0,A,<db> update(deferred),,<user>,<pwd> . @ fch,0,F,0008,,,,,y,,,,,,,,<db> 'c ',-1 rnm -2 dsp,-2 . @ lgf,0008,n,<db> . @ ldv,p <msg>s80='Houses listed per county' . @ cnt,-2 'p' 'County','Listed' ,1,= dsp,-0,,,,,,<msg> . @ ldv,p <msg>s80='Average house price by county' . @ cnt,-2 'p' 'County','Price' ,1,'/'/r,,.01 dsp,-0,,,,,,<msg> . @ ldv,p <msg>s80='House price standard deviation by county' . @ cnt,-2 'p' 'County','Price' ,1,!/r,, dsp,-0,,,,,,<msg> . @ rel . @0008: . @ dsp,-0 . @ dsp,EDRW$,ERPT$ .

195 External Interfaces

196 MAPPER @FIL Copy report to server
@FIL,-0 'C:\temp\data.txt' . Copy -0 result to a text file on the server. @FIL,18,B,034,b 'C:\pics\001.gif' . Copy binary report 34B18 to a .GIF file on the server.

197 MAPPER @RET Retrieve file from server
@ RET,18,B 'C:\temp\data.txt' . Copy a text file from the server into the -0 result in drawer B18. @ RET,0,F,b 'C:\pics\001.jpg' REP,-0,0,F,085 . Copy a .JPG file from the server into a binary result in drawer F0. Save in report 85F0.

198 MAPPER @OS Execute an OS command on the server
@ LDV,p <cmd>s80='dir C:\temp\' . @ OS,0,A '-d –f' <cmd> . Execute the DOS DIR command. Result is in -0 in drawer A0. @ LDV,p <cmd>s80='cmd /c dir C:\temp\' . @ OS,0,A '–f' <cmd> . Same as above. Note the use of the cmd /c command and the absence of the –d option.

199 MAPPER @PCW Copy rpt to workstation
@ PCW,18,B,031,002 'C:\temp\31B18.txt' . Copy report 31B18 to a text file on the workstation, starting with line 2. @ PCW,-6,002,0145 'C:\temp\Rslt6.txt' . Copy result -6 to a text file on the workstation, starting with line 2. If result -6 does not exist, go to label 0145.

200 MAPPER @PCF Workstation File Status
@ PCF,s 'C:\rose.jpg' . @ if STAT1$ eq 1 gto @ PCW,0,A,153 'C:\rose.jpg' . @0120: Check if file exists on the workstation. If yes, jump to label 0120. Else write MAPPER report to file.

201 MAPPER @PCR Ret. file from workstation
@ PCR,18,B,036,N \ 'C:\temp\PayrollData.txt' Copy a text file from the workstation into report 36B18. Not in binary format. @ PCR,18,B,-0,Y 'C:\pics\Logo1.jpg' REP,-0,18,B,085 . Copy a .JPG file from the workstation into a binary result in drawer B18. Save in report 85B18.

202 MAPPER @PC Execute a PC program on the workstation
@ LDV,P <fname>s80=\ 'C:\temp\data.txt' @ PCW,-0,002 <fname> PC,W "Excel.exe <fname>" PCR,0,F,-0,n <fname> dsp,-0 . Copy a data result to the workstation. Process with Excel while BIS run waits. Read file into a result and display.

203 MAPPER PCX Run Copy between BIS and the workstation

204 COM Objects

205 MAPPER @CCx COM Objects
@ CCC Create an instance of a COM object @ CCP Change a property of a COM object @ CCI Invoke a method of a COM object

206 MAPPER @CCx COM Objects
@ CCG Get the value of a property of a COM object @ CCR Release an instance of a COM object See "Send Run.txt" on your CD for a working example

207 Message Queues

208 MAPPER Message Queues @ QOPN ... Open a message queue
@ QPUT Put a message on a queue @ QGET Get a message from a queue

209 MAPPER Message Queues @ QINQ ... Inquire on a message queue attribute
@ QCLS Close a message queue See "WebSphereMQ and BIS.ppt" on your CD for more details.

210 Screen Presentation

211 MAPPER User Interface @OUT Character-based screen
@SC Character-based screen (New Look) @WIN Windows GUI commands AREA ATT CR DATA DEF DFLD DSPFORM EDIT EMP END FKEY FLD HELP DSPHELP PAGE PC MSG SOR TAB LIST SELECT BTN CBX CLS DFC EDT FON HID INP LST MBX MNU PC PCF PCR PCW PIC SHW TIP TXT WIN

212 GUI Presentation

213 MAPPER Default Colors and Font
@ DFC, . . . Set the default foreground and background colors of a GUI run. @ FON, . . . Set the font for a window, a run, or text.

214 MAPPER Show and Hide Controls
@ SHW, . . . Redisplay a control on the screen. @ HID, . . . Remove a control from the screen. @ CLS, . . . Close a control.

215 MAPPER @WIN Define a Window
Define a window and display it on the screen. This may be the main window of the application or a child window.

216 MAPPER @BTN Define a Button
Display a button on the screen. Command button – 'p' option Radio button – 'ar(1)' option Checkbox – 'ac(1)' option Picture on a button

217 MAPPER Define a combo box or edit box
@ CBX, . . . Display a combo box on the screen. A combo box is a drop-down list box that lets you directly edit a value. @ EDT, . . . Display an edit box on the screen.

218 MAPPER @LST Define a list box
Display a list box on the screen. Single-select Multiple-select MS-DOS files "Locate" button Other options

219 MAPPER @MBX Define a message box
Display a message box on the screen. OK OK and Cancel Retry and Cancel Yes and No Yes, No, and Cancel Abort, Retry, and Ignore

220 MAPPER @INP Accept Input
Wait for input from the screen Accept input from one or more screen objects.

221 MAPPER @PIC Display a picture
Display a picture on the screen. Several picture formats supported Border / frame Scroll bars Click – X,Y coordinates

222 MAPPER @TXT Define a text box
Display a text box (label) on the screen. Border Left / Center / Right justified Transparent background Clickable

223 MAPPER @TIP Define a tooltip
Display a tool tip (text) for a control when hover the mouse over the control.

224 MAPPER @MNU Menu Bar @ MNU, . . .
Display a menu bar (temp or permanent). Enabled / disabled Checked / unchecked Separator bars Multi-column pull-down sections

225 Calling PCME Functions

226 MAPPER Calling PCME from your run
A lot of the functionality of PCME is available to run designers by calling the functions. Here is an example that shows how to display your result using PCME. @. Create a data result @ SRH,0,B,001 'd' 'STCD' |,OR @. Call routine for PCME display @ CALL,3900,C, *('DISPLAY','') . This is a general purpose routine that is called. You invoke any of the supported functions by calling this routine, passing the name of the function. You can see a list of supported functions in report 155C3900.

227 MAPPER Exercise Cabinet-Switch to remote BIS system. (Instructor will supply details.) Create a new report in the A0 drawer, and register it as XXX using the REG command. Write a run to: Connect to a relational database and retrieve data Further process the data set using BIS functions (Try to avoid SRH and SOR, since these are better accomplished with SQL WHERE and ORDER BY.) Use the RDI run as needed to test connectivity to the database, availability of tables, etc. Instructor will supply database, sign-on details. @ ldv,p <db>s18='UGSIData',<user>s8='mri',<pwd>s8='mri' .

228 MAPPER @RET Retrieve a file from the server
@ RET,18,B 'C:\temp\data.txt' . Copy a text file from the server into the -0 result in drawer B18. @ RET,0,F,b 'C:\pics\001.jpg' REP,-0,0,F,085 . Copy a .JPG file from the server into a binary result in drawer F0. Save in report 85F0.

229 MAPPER Questions? ? ? ? ? ? ? ? ?

230 MAPPER Closing remarks Imagine it. Done. Unisys is a registered trademark of Unisys Corporation. BIS and MAPPER are registered trademarks of Unisys Corporation.


Download ppt "Business Information Server Run Design"

Similar presentations


Ads by Google