How can I concatenate files for transfer from the iseries

5 pts.
Tags:
AS/400 Query
Concatenate
i5
I have 3 files with a common layout in a common library on the i5.

The source files (query results) have different definitions so I am unable to append the result of query2 to query1.

So what I want is to perform a UNION or concatenate them into a single download file.

I have tried a UNION but keep gettting syntax errors.

 

 



Software/Hardware used:
excel,i5series

Answer Wiki

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

As long as the common layout is IDENTICAL, you can use the CPYF command to copy all data into a single file.
CPYF from the 1st into a new file CRTFILE(*YES)
CPYF the 2nd and 3rd into that same new file MBROPT(*ADD) – and you probably need *NOCHK (use F10 and page down to “Record format field mapping”)

Mike

Discuss This Question: 3  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
    I'd say a UNION view is a reasonable way to go as long as they have a "common layout". I don't know why you're getting a syntax error. Show us your statement so we can look it over. It's probably related to "different definitions". Tom
    125,585 pointsBadges:
    report
  • DanTheDane
    If the three resultsets are identical in layout, you may let query 1 output (create) a file, and query2 and query3 output (with 'add') directly to the file created in query1. DanF
    2,555 pointsBadges:
    report
  • dinuas400
    In the AS400 transfer data from iseries in the file name tab enter the names of the files those you want to extract and then go to data options there you can give the selected fields or all the fields... and then next we have the where tab there you can give the conditions then order by tab is also there
    510 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