Substring and then concatenate to build key in logical file

200 pts.
Tags:
Development
hi...i have a 20 position alpha cust# field. we have a truncation issue with scanners, so sometimes the number comes in with the 1st number truncated. we get no hit, and treat it as a new customer. i want to build a logical file, and i think i need to create 3 new fields: the first field would be sst(2 19) of the customer #, the second would be sst(20 1) of the cust# (usually a blank), the third concat(firstfield secondfield) so i get a 20 position field to use as the key. When i use (USE I) (input) on the SST, it compiles, but once i add the concat, it bombs with Field not found - A CDCUS2 CONCAT(CDCUSM1 CDCUSL1) CPD7926-* . CPD7926-* . when i have (USE blank) on the sst, it bombs with CPD7552- on the SST lines.

Answer Wiki

Thanks. We'll let you know when a new response is added.

I’ve looked in the IBM doc, and it’s noted that you can CONCAT zones from physical files only, not defined zones.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • RussK1
    If I understand your question, you need a partial field to represent the scanned in data and that data would be sufficient to uniquely identify the record desired. I believe one of the following should workd. If you can modify the scanning pgm, then you could build a logical like this: R RECFMT PFILE(PFNAME) PFLD19 I SST(KEY 2 19) KEY NXTFLD ETC K PFLD19 (define whatever fields or all fields - depending on how you want to change the code) Since the original KEY will still be in the record, you don't have to concatenate anything - and the new key represents the scanned in data. If you have to have the record length/layout exactly the same for some reason, then another possible approach is to create a logical that substrings the key field into two fields, doing the concatenation in the pgm itself. PFLD1 I SST(KEY 1 1) PFLD2 I SST(KEY 2 19) NXTFLD ETC K PFLD2
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following