× 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 flexible do you need to be? Are you trying to make a generic utility?
Doe the list of attribute names (aka columns) change from one execution to another? Is it the same data file or are you trying to be generic?

If you are going to be processing the same data file but may be the selected attributes will change then I would do RPG ...

[pseudo code]

Load array of attributename from attribute table;

Read first inputfile
Dou endofinputfile
Output.item = input.item;
For x = 1 to #ofAttributes;
Select
When attributename(x) = 'commonname';
Output.Attributename = attributename(x);
Output.Datavalue = input.commonname;
When attributename(x) = 'another.column.name';
... etc.
When
...
ENDSL
Write output
Endfor
Read inputfile
enddof

[/pseudo code]

Paul Therrien
Orion South, Inc.
504-374-9551
800-437-7173
ptherrien@xxxxxxxxxxxxxxx

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

The file of attributes has the following:
*Attribute Name*
commonname
ponumber
batchnumber
productiondate
receptiondate
storeno
netweight
.
.
.

The file of items has
Item CommonName PoNumber
1234 Test Item 123456
5645 Another Item 143556

What I want to do is for the attribute named "commonname", get all items and the data for the CommonName field.
Then repeat for each attribute in my dirver file using the data from the corresponding field.

I will be creating new records in my driver file for each item/attribute pair.

Thanks,
On Thu, Jun 7, 2012 at 1:14 PM, Alan Campin <alan0307d@xxxxxxxxx> wrote:

Data examples?

On Thu, Jun 7, 2012 at 11:09 AM, Jeff Young <jyoung0950@xxxxxxxxx> wrote:
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.

--
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.