Multiple member

285 pts.
Tags:
How to find the records of 5 different members of a file where age field value is 50 in each of the member in CL and RPG?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi Satheesh,

its not possible to open and close the members one by one. suppose if file have 25 members, its inappropriate. There should be some other method which reads each members and checks.

Renjith

Discuss This Question: 11  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • pdsathishkumar
    we can do in RPG... just you declare your file in F spec like this...
     F pfname      if   e             disk    usropn extmbr(var1) 
    D var1               s             10a   
    C                       eval      var1='mbr1'  
    C                       open      pfname        
    ****** do you operation using setll and read*******
    C                       close      pfname
    here find age 50 from one member... after again open another member and field age 50..
    3,790 pointsBadges:
    report
  • pdsathishkumar
    you can open member one by one and read it, And, check age=50... eval var1='MBR1' open pfname read pfname if age=50 dsply age endif close pfname eval var1='MBR2' open pfname read pfname if age=50 dsply age endif close pfname do like this........ it ll work... you check it one more time...
    3,790 pointsBadges:
    report
  • deepu9321
    In CL, have you tried using OVRDBF command, for overriding the Database file to Read records from particular member only. Once, you done with the required operations, you can use ENDOVR. And, Override with other Member(if required). Pradeep.
    3,910 pointsBadges:
    report
  • Renjithgr
    Hi Pradeep, can you tell, how to access each members differently in CL. If possible can u show mw some sample codes? Renjith
    285 pointsBadges:
    report
  • Renjithgr
    Please help on this
    285 pointsBadges:
    report
  • TomLiotta
    Please help on this What help is needed? An appropriate answer has been given by Pradeep. Use the OVRDBF command to set any member name that you want to read from. Tom
    125,585 pointsBadges:
    report
  • Renjithgr
    My qn was how to read all members one bye one. Hardcoding doesnot work in this case
    285 pointsBadges:
    report
  • philpl1jb
    Have a CL create a member list using the command: DSPFD MyLib/MyFile Type(*MBRLIST) OUTPUT(*outfile) Outfile(mylib/myOutFile) F pfname if e disk usropn extmbr(MLNAME ) F Outfile if e disk The rpg reads each row from outfile -- MLNAME is a field in outfile Then opens pfname and uses it Closes pfname loops to read another row from outfile
    50,605 pointsBadges:
    report
  • TomLiotta
    My qn was how to read all members one bye one. It can depend on the version of your OS. Please provide some info on your environment. CL can read the records from the output file that Phil mentions. You can also use the RTVMBRD command to retrieve member names one at a time. The RTVMBRD command avoids needing to read the DSPFD output file. (You could also use the List Database File Members (QUSLMBR) API to list members in a user space.) From i 6.1 on, you can do it easier in a single program. If you need to do it in CL earlier than i 6.1, it requires at least two CL programs. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    2 CL's yes. if one of the cl's needs to read the outfile If CL throws the outfile and then calls the RPG IV program The RPG program can read the outfile and use the extmbr to get the member names and in the one call processes all the members in the file then just 1 cl. Phil
    50,605 pointsBadges:
    report
  • Renjithgr
    Thanks Philip and Tom
    285 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following