This Visual Studio Code extension provides a collection of useful code snippets for IBM i-based languages, including:
RPGLE
CL
CLLE
SQL
Features
This extension simplifies development by offering ready-to-use templates and code snippets for common programming patterns in IBM i-based languages. It supports the following scopes:
Scope
Description
Trigger
rpgle, sqlrpgle
Basic template for RPG FREE program
rpgle-main
rpgle, sqlrpgle
NoMain module with exportable procedure
rpgle-nomain
rpgle, sqlrpgle
Basic exportable procedure with parameters
rpgle-proc
rpgle, sqlrpgle
Exportable procedure with parameters
rpgle-proc-params
rpgle, sqlrpgle
Exportable procedure with parameters and ON-EXIT
rpgle-proc-params-onexit
rpgle, sqlrpgle
CTL-OPT configuration with main
rpgle-ctl-opt
rpgle, sqlrpgle
CTL-OPT configuration with nomain
rpgle-ctl-opt-nomain
rpgle, sqlrpgle
Generates a BNDDIR statement
rpgle-bnddir
rpgle, sqlrpgle
Data structure declaration
rpgle-ds
rpgle, sqlrpgle
Data structure declaration with qualified template
rpgle-ds-template
rpgle, sqlrpgle
Data structure declaration with multiple fields
rpgle-ds-fields
rpgle, sqlrpgle
Data structure declaration with PSDS
rpgle-ds-PSDS
rpgle, sqlrpgle
ILEDocs comment block
rpgle-iledocs
sqlrpgle
Free Format RPGLE Main Procedure with SQL query execution and error handling
rpgle-sql-main-fetch
sqlrpgle
Procedure checks if a member exists in a file in the specified library
rpgle-sql-proc-check-member
sql
Query job log information
sql-joblog
sql
Delete a file uses CL command
sql-cl-dltf
sql
Display message uses CL command
sql-cl-dspmsgd
sql
Query message file
sql-msgfile
sql
Query SQLCODE information
sql-sqlcode-info
sql
SQL Query for Member Status
sql-member-stat
Snippet Files
The snippets are organized into the following JSON files:
rpgle.json: Contains snippets specific to RPGLE programming, such as templates for procedures, control options, and data structures.
sql.json: Includes snippets for SQL statements and queries commonly used in IBM i environments.
sqlrpgle.json: Combines RPGLE and SQL snippets for integrated SQLRPGLE programming, including examples of embedded SQL and error handling.
Click on the ... menu in the top-right corner and select Install from VSIX....
Select the downloaded .vsix file and install the extension.
Usage
Open a new or existing file with a supported language (e.g., .rpgle, .sqlrpgle).
Start typing a snippet trigger (e.g., rpgle-) and select the desired snippet from IntelliSense suggestions.
Customize the generated code as needed.
Requirements
Visual Studio Code version ^1.98.0 or higher.
IBM i development environment.
Known Issues
Ensure that the file extension matches the language scope for snippets to appear in IntelliSense.
Contributing
Contributions are welcome! If you have ideas for new snippets or improvements, feel free to open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License. See the LICENSE.md file for details.
Release Notes
All changes and updates to this extension are documented in the CHANGELOG.md file. Please refer to it for detailed information about new features, fixes, and improvements.