Adding and updating physical file

15 pts.
Tags:
Physical File
RPGLE
I have a physical file with no key. I want to add new record to it and if record is added if I want to update it. How can I do it without a key?
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 5  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.
  • philpl1jb

    Would your RPGLE program have any way to recognize the record?

    If so, then you can use an in-beaded SQL statement.

    54,090 pointsBadges:
    report
  • supreet85
    physical file is an empty file. there is no record in it. the data that i enter on the screen must be added to this physical file. some records are retrieved from other physical file which will also be added to the physical file with no key 
    15 pointsBadges:
    report
  • hunshabbir7
    Strange, how you will prevent from record duplication etc and what will happen if there are more records meeting your criteria. Embedded SQL will be used with all conditions in WHERE clause.
    2,900 pointsBadges:
    report
  • philpl1jb

    If it's the only record in the file then you can use SQL updates with no where clause (which will update all rows)

    or in native code since you can only update the file once after its accessed you will need to access it for each update 

    Setll *start Myfile

    Read Myfile

    .. do stuff

    Update MyRecord

    54,090 pointsBadges:
    report
  • lance2221357
    Table no index,  RRN be used actually.
    So can use RRN(Table) as Key,
         Like Duplicate data to Target system.
    But the Table donot Reorganize.
    Example:
      update  ds5420w  set              
                   W0AM01=4 where rrn(ds5420w) = 4  
    270 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.

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

Following

Share this item with your network: