f



Here is my question

We have a datastructure with multiple values

DS
Desc1 20a
Desc2 10a
Desc3  8A
Desc4 20a
Desc5 12a

I currently have to code by customer which description to use.
I'd like to instead build a file
customer|field
1:Desc2
2:Desc5

I want to be able to go to the file and for customer 2 move the value from =
Desc5 into my Desc on my customer data file

I have tried using %ADDR(input field name here) and it doesn't return what =
I want.

Any Idea how to get the right Description from the dataarea. based on eithe=
r a pointer or some other way? These values change as the DS is passed into=
 my program as a parm and there are may more values than just 5 to be hones=
t and I will be mapping multiple fields for some customers.

Cust.Desc =3D Desc2
Cust.Account =3D Desc5

I want to remove the hard coding and short of writing the data area to a fi=
le and using selects to do this I don't know another way.

PS the boss is an SQL no go. I can't use that solution else i'd have a one =
record file with all the fields from the DS and use a select with fields.

Select :fieldin into :descout from xyz

or something like that.=20
Any ideas??
0
ghostdancersarah
5/31/2016 8:31:07 PM
comp.sys.ibm.as400.misc 9219 articles. 4 followers. Post Follow

1 Replies
693 Views

Similar Articles

[PageSpeed] 27

On Tuesday, 31 May 2016 21:31:08 UTC+1, ghostdan...@gmail.com  wrote:
> We have a datastructure with multiple values
>=20
> DS
> Desc1 20a
> Desc2 10a
> Desc3  8A
> Desc4 20a
> Desc5 12a
>=20
> I currently have to code by customer which description to use.
> I'd like to instead build a file
> customer|field
> 1:Desc2
> 2:Desc5
>=20
> I want to be able to go to the file and for customer 2 move the value fro=
m Desc5 into my Desc on my customer data file
>=20
> I have tried using %ADDR(input field name here) and it doesn't return wha=
t I want.
>=20
> Any Idea how to get the right Description from the dataarea. based on eit=
her a pointer or some other way? These values change as the DS is passed in=
to my program as a parm and there are may more values than just 5 to be hon=
est and I will be mapping multiple fields for some customers.
>=20
> Cust.Desc =3D Desc2
> Cust.Account =3D Desc5
>=20
> I want to remove the hard coding and short of writing the data area to a =
file and using selects to do this I don't know another way.
>=20
> PS the boss is an SQL no go. I can't use that solution else i'd have a on=
e record file with all the fields from the DS and use a select with fields.
>=20
> Select :fieldin into :descout from xyz
>=20
> or something like that.=20
> Any ideas??

I suppose you could move all the fields into an array of 20A
eg=20
eval descs(1)=3DDesc1
eval descs(2)=3DDesc2
etc then change your table to
Cust,desc
1,2
2,5
then=20
cust.desc=3Ddescs(desc)
etc

0
Jonathan
6/8/2016 12:58:27 PM
Reply: