Natural Platform Incompatibilities Ralph Zbrog RGZbrogZZUtils com Natural
Natural Platform Incompatibilities Ralph Zbrog RGZbrog@ZZUtils. com Natural Conference 2005 1 © 2005 LEN CONSULTING LLC
For more information on our Natural for Windows curriculum, see www. zzutils. com/train. html. 2 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Focus Software AG’s goal: source compatibility between mainframe and Open Systems q Not GUI issues nor Natural Studio features ¢ Migration of existing mainframe source to Windows ¢ Development vs test server l Single version which can run on both l Modification of mainframe version l 3 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Overview Syntax ¢ System variables ¢ Maps ¢ Display window ¢ FUSER implementation ¢ Batch ¢ Operating system ¢ Hardware ¢ 4 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Syntax ¢ Earlier patch levels of 6. 1. 1 ASSIGN and : = mutually exclusive l SCAN (‘XYZ’) l Invoke help within a helproutine l • SET CONTROL ‘WBM’ AIV array definitions l Line number reference on AT END OF DATA l 5 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Syntax ¢ Replace semi-colon in DECIDE with IGNORE DECIDE ON FIRST #CODE VALUE 'A' WRITE 'Code A' VALUE 'B' WRITE 'Code B' VALUE 'C', 'D' WRITE 'Code C or D' VALUE 'E' ; /* IGNORE VALUE 'F' ; /* IGNORE VALUE 'G' ; /* IGNORE NONE WRITE 'Invalid Code' END-DECIDE 6 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Syntax Convert in-stream map to external object if using selection box (SB=) ¢ Multifetch ¢ l Mainframe • Single-fetch default • number for multi-fetch l Windows • • MFSET determines default ON/OFF override default NEVER cannot be overridden number ignored – default applied 7 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
System Variables ¢ User ID *INIT-USER defaults to SAGPC, Network ID, or registered user l Natural Configuration Utility Natural Parameter Files NATPARM Natural Execution Configuration Steplibs User ID l 8 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
System Variables *USER RZBROG *INIT-USER RZBROG *ETID RZBROG *INIT-ID PC_WIN *USER-NAME SYSTEM 9 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
System Variables ¢ *INIT-PROGRAM l Batch mainframe • Set to job name l Windows • Set to NATURAL l Use *ETID • Set ETID in PROC/JCL and batch script IF *MACHINE-CLASS = 'MAINFRAME‘ THEN ASSIGN #JOB = *INIT-PROGRAM ELSE ASSIGN #JOB = *ETID END-IF 10 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
System Variables ¢ *TIMESTAMP accuracy l Due to limited accuracy of *TIMESTAMP and speed of processors, consecutive random number generations may return the same value 11 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Maps ¢ Input field appearance l Filler character unnecessary • Tools Options Output Window Display input fields with frame l ¢ Use AD=‘_’ for platform compatibility Data cannot be “hidden” under map’s PF key lines 12 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Maps ¢ Cursor movement only within input/modifiable fields Cannot move cursor to output field l Cannot move cursor to “empty space” l • e. g. no screen-level help • e. g. no output-field help 13 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Maps ¢ PF key sensitivity l Cannot place cursor on line selection to invoke action via PF key • Double-click on output field 14 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Maps ¢ Page PF key sensitivity 1 08/23/05 14: 34: 45 PID FIRST-NAME MIDDLE-NAME ------------------11100102 EDGAR PETER SCHINDLER 11100105 CHRISTIAN SCHIRM 11100106 REINER GEORG SCHMITT 11100107 HELGA GERDA SCHMIDT 11100108 WOLFGANG SCHNEIDER 11100109 CHRISTA EVA-MARIA SCHNEIDER 11100110 GEORG PETER BUNGERT 11100111 GABRIELE HENRIETTE THIELE 11100112 GERHARDT KLAUS THOMA 11100113 KLAUS PETER TREIBER 11100114 KLAUS PETER UNGER 11100115 MARION HELGA VETTER 11100116 ROLAND KARL VOGEL 11100117 MARTIN EDWIN WABER 11100118 ROLF ERWIN WAGNER New PID: ____ Enter-PF 1 ---PF 2 ---PF 3 ---PF 4 ---PF 5 ---PF 6 ---PF 7 ---PF 8 ---PF 9 ---PF 10 --PF 11 --PF 12 --Help Quit Small Big 15 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Maps ¢ PF key sensitivity l Alternatives • Convert to browse-select • Input field on each line • Pop-up window for PF selection • Double-click on selected line • Pass line number • Associate output fields with specific keys • Double-click on specific field of selected line to indicate specific PF key 16 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Maps ¢ 1 1 1 1 PF key sensitivity #MACHINE (A 16) INIT <*MACHINE-CLASS> #MPS (I 4) CONST <3> #FPOS 01 (I 4/#MPS) /* Positions associated with PF Key #FPOS 03 (I 4/#MPS) #FPOS 07 (I 4/#MPS) #FPOS 08 (I 4/#MPS) #POS (I 4) DEFINE SUBROUTINE START-OF-PROGRAM SET KEY PF 1 NAMED 'Help' PF 3 NAMED 'Quit' PF 7 NAMED 'Small' PF 8 NAMED 'Big' PERFORM INIT-FLD-POS 17 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Maps ¢ PF key sensitivity DEFINE SUBROUTINE INIT-FLD-POS ASSIGN #FPOS 01 (1) = POS (EMP. PERSONNEL-ID) ASSIGN #FPOS 01 (2) = POS ( EMP. xxx) * ASSIGN #FPOS 07 (1) = POS (EMP. FIRST-NAME) * ASSIGN #FPOS 08 (1) = POS (EMP. MIDDLE-NAME) END-SUBROUTINE 18 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Maps ¢ PF key sensitivity DEFINE SUBROUTINE AFTER-INPUT. . . IF #MACHINE <> 'MAINFRAME' THEN ASSIGN #POS = *CURS-FIELD DECIDE ON FIRST #POS VALUE 0 IGNORE VALUE #FPOS 01 (*) SET CONTROL 'K 1' VALUE #FPOS 03 (*) SET CONTROL 'K 3' VALUE #FPOS 07 (*) SET CONTROL 'K 7' VALUE #FPOS 08 (*) SET CONTROL 'K 8' NONE IGNORE END-DECIDE END-IF 19 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Maps ¢ Page PF key sensitivity - demonstration 1 08/23/05 14: 34: 45 PID FIRST-NAME MIDDLE-NAME ------------------11100102 EDGAR PETER SCHINDLER 11100105 CHRISTIAN SCHIRM 11100106 REINER GEORG SCHMITT 11100107 HELGA GERDA SCHMIDT 11100108 WOLFGANG SCHNEIDER 11100109 CHRISTA EVA-MARIA SCHNEIDER 11100110 GEORG PETER BUNGERT 11100111 GABRIELE HENRIETTE THIELE 11100112 GERHARDT KLAUS THOMA 11100113 KLAUS PETER TREIBER 11100114 KLAUS PETER UNGER 11100115 MARION HELGA VETTER 11100116 ROLAND KARL VOGEL 11100117 MARTIN EDWIN WABER 11100118 ROLF ERWIN WAGNER New PID: ____ Enter-PF 1 ---PF 2 ---PF 3 ---PF 4 ---PF 5 ---PF 6 ---PF 7 ---PF 8 ---PF 9 ---PF 10 --PF 11 --PF 12 --Help Quit Small Big 20 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Maps ¢ Screen-level help; output field help l Based on *CURS-FIELD • 0 screen-level • n field-level 21 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Display Window Highlighted text may appear less legible ¢ Cannot copy output text via standard Windows/emulator ctrl keys ¢ l use %C to copy screen image to work area 22 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
FUSER Implementation ¢ FUSER vs Windows directories l Non-Natural access to objects in Natural libraries may cause irrevocable damage • i. e. do not use Windows or 3 rd-party utilities on FUSER 23 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
FUSER Implementation ¢ FUSER vs Windows directories l Convert direct access to FUSER to CALLNATs to API USR 0008 N USR 0330 N USR 0210 N USR 1035 N USR 1054 N USR 1055 N USR 1057 N USR 2014 N USR 2019 N determine/set SWA content type/name FUSER directory save/cat/stow edit SWA contents find libraries containing module find modules in a library read FUSER into array read source as a temp file read FUSER into SWA save SWA into FUSER 24 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Batch ¢ JCL vs scripts l . bat • CMSYNIN and CMOBJIN l VB script • FTP for Windows-based conversion Geoff Smith gsmith 59@ix. netcom. com (916) 947 -8715 25 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Batch ¢ Spaces within input stream Treated as delimiters l Fix: split into CMSYNIN and CMOBJIN l ¢ Empty data sets not created l Create a dummy record 26 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
NATRJE ¢ Replace references to NATRJE with SHCMD 27 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Operating System ¢ Collating sequence EBCDIC vs ASCII l FROM and THRU values l • Mainframe ‘ ‘ THRU ‘ 9’ • Windows ‘ ’ THRU ‘z’ l Upload translation of NOT character (¬) • Mainframe ¬= • Windows ^= • Compatible <> 28 EM=X¬X EM=X^X EM=X’ ‘X Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Operating System ¢ Using print files as input l No carriage control characters in Windows DEFINE DATA LOCAL 1 #PRINT (A 133) 1 REDEFINE #PRINT 2 #CC (A 1) 2 #ACCOUNT (A 10) 2 FILLER 1 X 2 #AMOUNT (A 15) * 1 #MACHINE-CLASS (A 16) INIT <*MACHINE-CLASS> END-DEFINE * READ WORK 1 #PRINT IF #MACHINE-CLASS <> 'MAINFRAME' THEN MOVE #PRINT TO SUBSTR (#PRINT, 2, 132) MOVE ' ' TO SUBSTR (#PRINT, 1, 1) END-IF. . . END-WORK END 29 /* Shift right /* Emulate cc Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Hardware ¢ Internal formats l Packed numeric emulation • Use Integer computations for speed l Integer vs Binary internal formats • Big endian vs little endian • Avoid redefinition of Integer/Binary • #B (B 4) : = 305419896 H’ 12 34 56 78’ • #I (I 4) : = 305419896 H’ 78 56 34 12’ 30 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Hardware ¢ Control Variables Big endian vs little endian l Use I 2 when redefining CV l 1 #CV (C) 1 REDEFINE #CV 2 #CV-INT (I 2) /* Open. Systems & Mainframe IF NOT #CV MODIFIED THEN ADD 256 TO #CV-INT /* Set MODIFIED 1 #CV (C) 1 REDEFINE #CV 2 #CV-INT (I 1) /* Incompatible mainframe technique IF NOT #CV MODIFIED THEN ADD 1 TO #CV-INT /* Set MODIFIED 31 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Hardware ¢ Floating point accuracy 32 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Miscellaneous ¢ Numeric statement references l ¢ Change to labels View containing a superdescriptor comprised of an MU l Adabas issue 33 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Fin 34 Natural Platform Incompatibilities © 2005 LEN CONSULTING LLC
Natural Platform Incompatibilities Ralph Zbrog RGZbrog@ZZUtils. com Natural Conference 2005 35 © 2005 LEN CONSULTING LLC
- Slides: 35