Skip to main content
Doc Ruckel
Participating Frequently
Sep 18, 2025 9:28 AM UTC
Question

Using PROCREAD to process items from a list in a PROC

Greetings all!

Attempting to:

  • Create a list in PROC
  • Call a catalogued Basic program
  • Using PROCREAD in that Basic program in a LOOP/REPEAT construct
  • Expecting the PROCREAD would pop off list elements until exiting the LOOP/REPEAT construct.

To date, I haven't been able to get any data passed.  Does anyone have the mojo to get this bugger working?

THX in advance for y'alls always great advice!

~Doc

    2 replies

    James Adrig
    New Participant
    Sep 18, 2025 12:03 PM UTC

    Greetings all!

    Attempting to:

    • Create a list in PROC
    • Call a catalogued Basic program
    • Using PROCREAD in that Basic program in a LOOP/REPEAT construct
    • Expecting the PROCREAD would pop off list elements until exiting the LOOP/REPEAT construct.

    To date, I haven't been able to get any data passed.  Does anyone have the mojo to get this bugger working?

    THX in advance for y'alls always great advice!

    ~Doc

    Why not just keep it simple and do everything in Basic? We replaced all our PROC's more that a decade ago; the code is much simpler and easier to debug/modify.

    John Sherman
    Participating Frequently
    Sep 19, 2025 10:34 AM UTC

    Greetings all!

    Attempting to:

    • Create a list in PROC
    • Call a catalogued Basic program
    • Using PROCREAD in that Basic program in a LOOP/REPEAT construct
    • Expecting the PROCREAD would pop off list elements until exiting the LOOP/REPEAT construct.

    To date, I haven't been able to get any data passed.  Does anyone have the mojo to get this bugger working?

    THX in advance for y'alls always great advice!

    ~Doc

    Super simple example of what works for me.

    The active list from my SELECT in the PROC automatically carries to the program I invoke.

    In the program, I LOOP READNEXT like normal.

    VOC MY.PROC
    0001 PQ
    0002 HSELECT FILE
    0003 STON
    0004 HMY.PROGRAM
    0005 P

    BP MY.PROGRAM
    0001 LOOP WHILE READNEXT ID
    0002    CRT 'Processing ':ID
    0003 REPEAT