AS/400 – Flat file

1215 pts.
Tags:
AS/400
AS/400 Subfiles
I wanted change a flat file as a keyed file. What are all the ways there?

Answer Wiki

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

Create a definitoin for the file with DDS or create a table with SQL.
Then do a CPYF from the flat file to the defined file.
Use the FMTOPT(*NOCHK) on the CPYF command

Discuss This Question: 4  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
  • TomLiotta
    Please give some description of your "flat file". Many of us think of them as "program-described" physical files with a single field. But some others would mean streamfiles in an IFS directory. What file do you have? Can you show examples of a couple rows? Tom
    125,585 pointsBadges:
    report
  • rajeshece
    Flat is file with single field like A R RFMT A FLD1
    1,215 pointsBadges:
    report
  • philpl1jb
    ok then you're on Charlie Browns solution Describe a physical file with fields for the stuff in your flat file .. but all text since your flat file is all text. This file's record should be at least the length of the flat file record and breaks out the fields you want to key on, key on those fields. Compile the physical file Then copy the flat file (CPFY) to the new file using the fmtopt *NOCHK. Then you can use the new keyed file. Phil
    49,950 pointsBadges:
    report
  • TomLiotta
    It only needs to use 'text' fields if the field positions contain text bytes. If positions contain packed values, then those positions need to be described as packed. If positions contain binary values, then the description should be binary. The DDS for the new physical file needs to list definitions of the subfields of FLD1 according to how those positions actually exist. When the image-copy is done (i.e., *NOCHK) there won't be any conversion. The new file should already have the appropriate definitions for whatever the data is. Of course, that will most likely be text... Tom
    125,585 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