Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8041869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:22:19+00:00 2026-06-05T04:22:19+00:00

I need to create a new member for an existing physical file in my

  • 0

I need to create a new member for an existing physical file in my RPG-program. I know of two ways, and I must say, that I like neither:

  1. use QCMDEXC to make a call to ADDPFM
  2. write an CL-program, that calls ADDPFM and call that from RPG

The first one involves cat’ing together a command that has to be parsed by QCMDEXC which does not sound to performant (I know, the expansive part here is not the call, but the creation of the member) — but what bothers me really about it, is that I don’t find it straightforward, but on the contrary hard to follow and not very aesthetic.

The second one uses a compiled program, so there is no concating and parsing involved. Also, it does not look that horrible in your RPG-code, because it is only one normal procedure call. But I’ll have to create an extra external program, that need’s to be transfered to all systems my RPG-program will be used on. It also kind of conflicts with my sense of aesthetics, creating an extra source and binary just to do one api call.

Is there a way to call the api directly, without QCMDEXC? Or maybe another RPGish way of creating a new member to a PF? Google was no help to me at all..

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:22:22+00:00Added an answer on June 5, 2026 at 4:22 am

    There is no way to directly create a physical file member from within RPG.

    The options you listed are good. Another is the system() API. If this is a new app, try to avoid multiple members; they are not friends with SQL. Traditional multi-member apps use a wrapper CL to handle the ADDPFM and OVRDBF before calling the RPG:

    PGM &month
    DCL &month *char 3
    DCL &mbr *char 10
    chgvar &mbr ('SALES' *cat &month)
    addpfm sales &mbr
    monmsg...
    ovrdbf sales mbr(&mbr)
    call RPG_PGM
    endpgm
    

    Obviously, with more recent versions of RPG, we can do the overrides in the F specs. But there is still no way to manipulate file members directly from within RPG. I tend to write procedure wrappers for system() or QCMDEXC and put that in a service program so I can do OS-level work from within my RPG programs. If you prefer, write a specific ADDPFM procedure and call that ‘API’.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new at this, but I need to create new tables from existing
I have a Excel sheet with two columns and I need to create new
I need to create a new Hash object using two arrays. But, the conditions
I have the following three arrays and need to create a new two-dimensional array
I'm new in powershell. I need to create a member of type DirectoryInfo. I
I am not looking to create new events. I need to create a canvas
I need to create a new DB2 instance and import a database from the
I need to create a new line of data within an array where the
I am new to Zkoss and i need to create completely new css theme
In MySQL, I need to create a new table called users with the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.