Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using %KDS to setll on File

Status
Not open for further replies.

jrowden773

Programmer
Oct 19, 2007
9
I have a program where I use the example below from the Websphere on using %KDS but my question is if the key list is not all Character type and is a mixture of character and numeric how do you get around this?

It complies when I do it this way but a get a decimal data error when I hit SETLL %KDS(pgreckeys) pgrec.

Any suggestions would be greatly appreciated as I realize that this maybe a newer technique then a traditional key list and I would like to know how to use it.


A..........T.Name++++++RLen++TDpB......Functions++++++++++++++++++
A R CUSTR
A NAME 100A
A ZIP 10A
A ADDR 100A
A K NAME
A K ZIP
FFilename++IPEASF.....L.....A.Device+.Keywords+++++++++++++++++++++++++
Fcustfile if e k disk rename(CUSTR:custRec)
DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++
D custRecKeys ds likerec(custRec : *key)
...
/free
// custRecKeys is a qualified data structure
custRecKeys.name = customer;
custRecKeys.zip = zipcode;
// the *KEY data structure is used as the search argument for CHAIN
chain %kds(custRecKeys) custRec;
/end-free
 
I don't use %KDS, because we have to compile back to V5R1, but I have tried it at another job and found it to be pretty klutzy to use.

Personally, I'd do the chain like this:

chain (customer : zipcode) custRec;

To me, that's far easier to understand. %KDS can be a pain to use. And, as you have seen, there can be issues. Do you have any numeric subfields over that data structure (I'm thinking Zip code)?



Da mihi sis crustum Etruscum cum omnibus in eo.

 
Isn't your supplied code from an IBM manual? I think I've seen it somewhere. You state that your key is a mixture of character and numeric. That doesn't fit with your code. Since you have numeric fields in your key, do you have a numeric that isn't set properly? That would fit the error you're getting. Aslo, you state that you're hitting SETLL but that isn't in the pasted code.

If what you're showing us isn't your code, paste your code so we can see what might be the problem.

[rockband]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top