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