General Information Each PROC statement open a new program. One COBOL source can contain several IDENTIFICATION DIVISIONs due to COBOL's capability of nested procedures. EXEC CICS receives an ending END-EXEC for COBOL. There is currently no converting within CICS statements. Comment indicators /* */ result in asterix at COBOL column 1 FETCH is currently ignored. Could later on be used to distinguish static from dynamic subroutine calls CALLs are converted into COBOL syntax for static calls RETURN() statements move their resulting value into a global COBOL variable named -RETURN Preprocessor statements other than %INCLUDE are commented out Code lines are indented corresponding to their scope depth. Labels are converted to COBOL paragraphs as long as they are not embedded in a scope (DO WHILE ... LABEL: .. END) In the beginning the tool allocates five work files for sorting out 1. Environment Division 2. Working-Storage Section 3. Local Storage Section. 4. Linkage Section. 5. Procedure Division. The corresponding Section headers are written into the files. In the end these work files are merged into the resulting COBOL program. To Do: Include files should not have a procedure division. Data Declaration BUILTIN declarations are ignored. %INCLUDE statements result in COPY statements. If a library name is specified, the COPY .. OF DDNAME syntax is chosen. Based and controlled storage ist directed into COBOL's Linkage section. PL/1 CHAR declarations reuslt into PIC X. Controlled storage except varying occurance on level one must have to be adapted manually. Static storage is currently being ignored. CICS reentrance will have to be discussed. Declarations using the VARYING attribute are converted into FIXED CHAR VARYING will have to be coped with. PL/1 level numbers are taken over into COBOL level numbers. Variable declarations without level numbers become 77-levels in COBOL. If they are parameters they are placed into then LINKAGE SECTION. 77- or 01-level declarations of the main procedure are declared as GLOBAL. Repetion factors result into an OCCURS clause. If the factor is a variable name (controlled storage), OCCURS DEPENDING ON is generated with hundred being the current maximum. FILE declarations are removed, recsize and input-output-characteristics preserved for later usage (OPEN) BIN or BIN FIXED with (n) or (n,0) are converted into COBOL PIC S9(4) COMP for m<=15 , S9(9) COMP otherwise. Picture declarations are taken over for COBOL. Repetion factors placed at the end of each picture character example: PIC '(8)Z(2)9.(2)9' results PIC 'Z(8)9(2).9(2)' FIXED(x,y) becomes COBOL PIC S9(x-y)V9(y) COMP-3 Same to DEC and DEC FIXED Remaining FIXED is being swallowed down as being standard for COBOL. UNAL is being ignored due to being COBOL's standard. PLI standard ALIGNED will be a bigger issue and is not currently occupied by the converter. INIT () becomes VALUE INIT(()...) ignores due to COBOL assigning the same value to each occurance automatically. DCL of external entries are commented out. External functions returning a value will have to be coped with. Builtin functions (SUBSTR etc.) and qualified variables (x.y resluting into y OF x) will have to be converted in an additional step due to loss of context. ALLOCATEs are done using LE routine CEEGTST Variabel Assigment Assignments with arithmetic operators are recognized as COMPUTE objects: X = Y + .... COMPUTE X = Y + ... Concatenated sting assignments (X = Y || Z;) resultin into STRING Y Z DELIMITED BY SIZE INTO X Warning: X should be erase before (MOVE SPACE TO X) What about right alignents (hebrew) X = Y; results into MOVE Y TO X for Y being a variable, number or alpha literal Alpha literals extending over more than one line are not yet handled. Empty alphabetical literals '' result into LOW-VALUE Conditional Execution Empty THEN clauses result into NEXT SENTENCE The & character is recognized as COBOL AND The | character is recognized as COBOL OR SELECT becomes EVALUATE OTHERWISE becomes WHEN OTHER PL/1 END statements lead to the corresponding COBOL END-IF/PERFORM/EVALUATE repectively. semicolon at the end of a statement is used for checking pending end of scope statements, f.i. END-IF A ^ sign is recognized as a negation and results into a NOT Example: IF (X ^= Y) THEN .. Loop Processing Conditional DO WHILE statements are converted into COBOL inline performs Example: DO WHILE (EOF_E1 = 'NEIN'); PERFORM UNTIL NOT (EOF_E1 = 'NEIN') Iterating DO statements are converted into COBOL inline performs Example: DO I = 1 TO M; PERFORM VARYING I FROM 1 BY 1 UNTIL I = M; Input-Output Processing OPEN FILE() results into COBOL OPEN INPUT / OUTPUT depending on previous FILE declaration DISPLAY (X) becomes DISPLAY X CLOSE FILE(file1), FILE(file2) ... generates several single COBOL close statements ON ENDFILE statements are preserved for later READ AT END processing WRITE FILE(xyz) FROM (abc) results into WRITE xyz FROM abc error: WRITE should have a record name as parameter READ FILE(xyz) INTO (abc) results into READ xyz INTO abc PLI "ON ENDFILE" statements are inserted hereafter as AT END conditions PUT SKIP DATA or LIST become COBOL DISPLAY