× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



How about using embedded dynamic SQL? Basically do the following for each item.

1. Create SQL string to run from your driver file.
2. Prepare & describe the SQL string.
3. Open the cursor.
4. Do your processing.
5. Close the cursor.


Gary Monnier

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jeff Young
Sent: Thursday, June 07, 2012 10:10 AM
To: RPG programming on the IBM i / System i
Subject: Re: Getting all data for a specific column from a file

My file looks like this:
Field
ITEM#
COMMONNAME
PONUMBER
BATCH00001
PRODU00001
RECEP00001
STORENO
NETWEIGHT
.
.
.
.
.
.

My driver file has the following fields:
Item
Attribute Name
Attribute Data

For each attribute name, I want to get just the item and data from the corresponding column for all records from the input file.

Thanks,

On Thu, Jun 7, 2012 at 12:53 PM, Alan Campin <alan0307d@xxxxxxxxx> wrote:

What you are asking is not very clear to me.

When you say column, do you mean row?

Column_Name Value
ColumnA XXY
CoiumnB AAA

etc.

An example of what the data looks like might help.

On Thu, Jun 7, 2012 at 10:46 AM, Jeff Young <jyoung0950@xxxxxxxxx> wrote:
All,
I have a file that contains data for multiple items.
Each column of that file contains data for a different attribute.
I have a file of attribute names that match the column name.
I do not know at compile time how many items or columns need to be
processed.
I want to read my file of column names and get all the items for
that column along with the corresponding data.

What would be the best way to do this?

Thanks,

--
Jeff Young
Sr. Programmer Analyst
--
This is the RPG programming on the IBM i / System i (RPG400-L)
mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/rpg400-l.

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.




--
Jeff Young
Sr. Programmer Analyst
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.