AS400 – Physical Files

335 pts.
Tags:
AS/400
AS/400 DB2
Physical Files
Hi I have some qusetion in AS400 How can we convert rows into columns and columns into row for a PF in AS400. Please send me the coding for this requirement. Thanks

Software/Hardware used:
AS400

Answer Wiki

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

The question is not logical if you are only doing it on the AS400
It sounds what you want to do is to download the file to a .CSV and then use the transpose function Excel.
This will take the sample file below and convert it to the 2nd example
A B C D E
1 2 3 4 5
X Y 8 9 Z
———————–
A 1 X
B 2 Y
C 3 8
D 4 9
E 5 Z

Discuss This Question: 2  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
    What is your OS version and release? In current releases of the OS, this would usually be done with recursive SQL. You show initially three rows with five columns. Will there ever be a different number of rows or columns? The generation of a new column when an additional row is added to the table would be a problem, though not insurmountable. The logic just gets complex. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    Also (in V6R1 and later), you might choose to use OLAP specifications to create a CUBE 'super-aggregate' set of rows. That might help simplify coding. 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