How do I sort SOURCE MEMBERS by date?

Before we start - ask yourself "Why haven't I migrated my source from legacy Source Files to a more modern storage medium like the IFS?" You know you should. I know you should. We all know you should. Find out why here

Use IFS Browser for stream files, which supports standard VS Code sorting.

How Do I Sort Source Members by Date in VS Code for IBM i?

IBM i source members contain critical code like RPG or CL and organizing them by date helps identify recent changes for troubleshooting or audits. This lesson covers the "Code for IBM i" extension, setup steps, and available options for sorting or approximating date-based organization.

Let's try to examine the topic from multiple viewpoints: extension capabilities for member management, limitations in sorting features, workarounds using IBM i commands or tools, and implications for efficiency in solo versus team environments. By the end, you will hopefully understand core functionalities, nuances like source dates versus member dates, and potential problems sometimes caused by large libraries or multi-connection setups.

Understanding Source Member Sorting in VS Code for IBM i

VS Code, enhanced by the "Code for IBM i" extension, offers a modern interface for IBM i development, surpassing green-screen tools like SEU in usability. However, sorting source members by date (creation or last change) directly in the Object Browser is not natively supported as of January 2026, unlike general VS Code Explorer sorting for local files. This gap stems from the extension's reliance on IBM i object queries, which default to name-based ordering. (note this is subject to change with the rapidly evolving Code for IBM i extension so if I am wrong, please let me know!)

Looking at the bigger picture, this impacts workflows in several ways: during debugging, sorting by date makes it easy to spot recent changes, potentially cutting analysis time by 20–30% according to developer anecdotes. Feedback from the community shows a demand for improvements, reflecting the needs of open-source tools. There are details to consider, like telling apart member-level dates (such as last save) from line-level source dates, which can be adjusted in the extension’s settings. Some tricky cases include large libraries with over 10,000 members, where unsorted lists slow down navigation, or partitioned systems that need cross-connection comparisons. This also ties into compliance, where sorting by date helps ensure audits are traceable in regulated industries.

Let's explore installation, browser usage, workarounds, and source dates to equip you with practical solutions.

Section 1: Installing and Configuring the Code for IBM i Extension

Compare with alternatives like RDi: VS Code is free and lightweight but lacks some graphical elements; extensions like Source Orbit add dependency views. In enterprise settings, opt for IBM-supported versions for updates and SLAs. Implications: Open-source nature allows custom forks, but stay updated to avoid vulnerabilities.

Here's an example of the Object Browser in action:

VS-Code for IBM-i Object Browser

Section 2: Connecting to IBM i and Browsing Source Members

Establish a connection to access libraries and members.

  •  Click the IBM i icon in the Activity Bar.
  • Select "Connect to IBM i" and input host, username, password, or SSH details.
  • In the Object Browser, expand libraries, then source physical files (e.g., QRPGLESRC) to view members.

Advanced Tweaks and Nuances: Enable secure connections with TLS for production; plaintext poses risks. Multi-connections allow side-by-side comparisons for dev/prod. Implications: Latency in remote setups slows browsing; optimize with local caching if available. Edge cases: Virtualized environments may require port adjustments; test thoroughly.

Section 3: Filtering and Approximating Sorting of Source Members

Direct sorting by date is not supported in the Object Browser; members list by name from IBM i queries. You can change your filter like this:

vs-code for ibm-i object browser filteers by name

Step-by-Step Guide to Workarounds

  • For filtering: Right-click a source file → "Add Filter" → Enter patterns (e.g., name-based). Refresh to apply.
  • For date approximation: Use IBM i commands via the extension's terminal (e.g., WRKMBRPDM with F17 for sort options, though green-screen).
  • Advanced: Run DSPFD TYPE(*MBR) OUTPUT(*OUTFILE) to an outfile, then query with SQL (e.g., SELECT * FROM outfile ORDER BY MBLCD) and open results in VS Code.

Section 4: Enabling Source Dates for Line-Level Tracking

NOTE - this does not apply to IFS Source code. Only to source kept in Source Files. Modern IFS uses software change tracking tools like GIT/SUBVERSION/etc while Source Files use the date value and rely on programmers to add comments to their changes.

Source dates track per-line changes, aiding in change history without member sorting. To enable source dates in Visual Studio Code for IBM i, follow these steps:

  • Ensure the QCCSID system value is not set to 65535.
  • Enable source dates in the connection settings.
  • Use the Diff mode for tracking changes, which diffs the base document against the latest dirty version.
  • Use the source dates gutter to show changes since the last save or to filter by date.
  • Restart Visual Studio Code for the changes to take effect.

Advanced Tweaks and Nuances: Dates update on save; issues may arise in multi-user edits. No reset command; use CPYSRCF for copies. Implications: Enhances audits but adds overhead. Edge cases: Disabled by default; enable per connection.

Open your IBM-i connection settings and click the Source Code heading. Example of source dates enabled:

enable source dates in vs-code for ibm-i

Now you will see the line source dates in the gutter:

enable source dates in vs-code for ibm-i - source file line dates changes

Key Takeaways and Implications

While direct member sorting by date lacks in VS Code for IBM i, workarounds like commands and source dates provide viable alternatives. These tools modernize workflows but highlight gaps versus RDi.

The good news is that Code for IBM-i is always evolving and hopefully (also very probably) this information is out of date by the time you read this!

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>