Author Topic: Multi-value I-descriptor In SB/Unidata  (Read 12187 times)

adewitt

  • Professional
  • ***
  • Posts: 45
Multi-value I-descriptor In SB/Unidata
« on: November 23, 2011, 02:12:04 PM »
I'm not very good at writing these complex multi-value i-descriptors.  Heck, I'm not good at writing i-descriptors period with resorting to the SUBR() function and a basic program.  What I need to do is
1. EXTRACT(@RECORD,19,0,0)
2. TRANS('ITMMST',@1,107,'X')

My two tries:
I(EXTRACT(@RECORD,19,0,0);TRANS('ITMMST',@1,107,'X')
I(EXTRACT(@RECORD,19,0,0);REUSE(@1);TRANS('ITMMST',@2,107,'X')

It seems whatever I do I end up with:
LIST WIP F19 S_PL_CFG_CD
           CPN    Cfg_cd
12345  05561 0
           12345
           22322

Instead of
LIST WIP F19 S_PL_CFG_CD
           CPN    Cfg_cd
12345  05561 0
           12345 1
           22322 0

So how would you write the I-Descriptor to get the second outcome?

Thanks.

precisonline

  • President
  • Administrator
  • Rock Star
  • *****
  • Posts: 1612
    • Precision Solutions
Re: Multi-value I-descriptor In SB/Unidata
« Reply #1 on: November 23, 2011, 02:19:48 PM »
I take it that RECORD<19> is multivalued?
-Kevin
Accidents "happen"; success, however, is planned and executed.

adewitt

  • Professional
  • ***
  • Posts: 45
Re: Multi-value I-descriptor In SB/Unidata
« Reply #2 on: November 23, 2011, 02:24:43 PM »
Yes it is.

precisonline

  • President
  • Administrator
  • Rock Star
  • *****
  • Posts: 1612
    • Precision Solutions
Re: Multi-value I-descriptor In SB/Unidata
« Reply #3 on: November 23, 2011, 03:27:14 PM »
I'm largely guessing, but you might try this:

I(EXTRACT(@RECORD,19,0,0);REUSE(@1);TRANS('ITMMST',@1,107,'X'))
-Kevin
Accidents "happen"; success, however, is planned and executed.

adewitt

  • Professional
  • ***
  • Posts: 45
Re: Multi-value I-descriptor In SB/Unidata
« Reply #4 on: November 23, 2011, 05:38:36 PM »
No go, Kevin.

I'll take it up Monday.

Happy Thanksgiving.

Colin Alfke

  • Professional
  • ***
  • Posts: 23
Re: Multi-value I-descriptor In SB/Unidata
« Reply #5 on: November 24, 2011, 08:40:36 AM »
I think your first one should have worked - you do need to make sure that the SM (<6>) in the dict is 'MV' and not 'S'.

This is one we use (INVOICE is a local MV'd dict - field Pos.Subpos = 1.M)
(F('INVOICE.FILE',INVOICE)<112>)
that creates:
EXTRACT(@RECORD,1,0,0);TRANS('INVOICE.FILE',@1,112,'X')

If your F19 is setup in SB+ as 19.M on the WIP file then:
(F('ITMMST',F19)<107>)
Should create the proper dictionary. We make sure the "key" has a #.M Field Pos.Subpos and the "link" uses 0.M.

hth
Colin

adewitt

  • Professional
  • ***
  • Posts: 45
Re: Multi-value I-descriptor In SB/Unidata
« Reply #6 on: November 28, 2011, 07:06:14 AM »
I think your first one should have worked - you do need to make sure that the SM (<6>) in the dict is 'MV' and not 'S'.

This is one we use (INVOICE is a local MV'd dict - field Pos.Subpos = 1.M)
(F('INVOICE.FILE',INVOICE)<112>)
that creates:
EXTRACT(@RECORD,1,0,0);TRANS('INVOICE.FILE',@1,112,'X')

If your F19 is setup in SB+ as 19.M on the WIP file then:
(F('ITMMST',F19)<107>)
Should create the proper dictionary. We make sure the "key" has a #.M Field Pos.Subpos and the "link" uses 0.M.

hth
Colin

Ding, ding, ding; we have a winner!  It seems I was trying ot over complicate a simple process.

Thanks Colin.