Difference between revisions of "Free Form Definitions"

From MidrangeWiki
Jump to: navigation, search
(Free-Form Statements)
Line 12: Line 12:
  
 
==Free-Form Statements==
 
==Free-Form Statements==
* CTL-OPT takes the place of H-specs.
+
* CTL-OPT ... the free-form version of H-specs.
* DCL-F takes the place of F-specs
+
* DCL-F ....... the free-form version of F-specs
* DCL-C takes the place of D-spec constants
+
* DCL-C ....... the free-form version of D-spec constants
* DCL-S takes the place of D-spec stand-alone fields
+
* DCL-S ....... the free-form version of D-spec stand-alone fields
* DCL-DS takes the place of D-spec data structures
+
* DCL-DS .... the free-form version of D-spec data structures
* END-DS is a new statement to terminate most DCL-DS statements
+
* END-DS .... a new statement to terminate most DCL-DS statements
* DCL-PI takes the place of D-spec procedure interface definitions
+
* DCL-PI ...... the free-form version of D-spec procedure interface definitions
* END-PI is a new statement to terminate procedure interface definitions
+
* END-PI ..... a new statement to terminate procedure interface definitions
* DCL-PR takes the place of D-spec procedure prototype definitions
+
* DCL-PR .... the free-form version of D-spec procedure prototype definitions
* END-PR is a new statement to procedure prototype definitions
+
* END-PR .... a new statement to procedure prototype definitions
* DCL-PROC takes the place of P-spec begin statements
+
* DCL-PROC .. the free-form version of P-spec begin statements
* END-PROC takes the place of P-spec end statements
+
* END-PROC .. the free-form version of P-spec end statements
  
 
==Examples==
 
==Examples==

Revision as of 16:02, 31 May 2016

One of the major new features of ILE RPG, introduced in 7.1, is free form definition specifications.

Features

  • Removes the column restrictions on definitions.
  • Can be interspersed with standard, fixed form, definitions.
  • /free and /end-free no longer required.

Requirements

  • IBM i 7.1 or higher.
  • 7.1 PTF 5770WDS SI51094.
  • If using SQLRPGLE, 7.1 PTF Group SF99701 level 26 or higher.

Free-Form Statements

  • CTL-OPT ... the free-form version of H-specs.
  • DCL-F ....... the free-form version of F-specs
  • DCL-C ....... the free-form version of D-spec constants
  • DCL-S ....... the free-form version of D-spec stand-alone fields
  • DCL-DS .... the free-form version of D-spec data structures
  • END-DS .... a new statement to terminate most DCL-DS statements
  • DCL-PI ...... the free-form version of D-spec procedure interface definitions
  • END-PI ..... a new statement to terminate procedure interface definitions
  • DCL-PR .... the free-form version of D-spec procedure prototype definitions
  • END-PR .... a new statement to procedure prototype definitions
  • DCL-PROC .. the free-form version of P-spec begin statements
  • END-PROC .. the free-form version of P-spec end statements

Examples

<source lang="rpg">

    D* fixed-form declarations
    D string        S       50A VARYING 
    D date          S         D DATFMT(*MDY) 
    D obj           S         O CLASS(*JAVA:'MyClass') 
    D ptr           S         * PROCPTR 
   
      // free-form declarations 
      DCL-S string VARCHAR(50); 
      DCL-S date DATE(*MDY); 
      DCL-S obj OBJECT(*JAVA:'MyClass'); 
      DCL-S ptr POINTER(*PROC);
    
      // constants
      DCL-C max_count 200; 
      DCL-C deleted 'D'; 

</source >

Links

Dawn May: Free format RPG and TR7


This article is a stub. You can help by editing it.