Precisely Speaking
May 21, 2012, 07:43:36 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: So what's news with you?  Tell us about it in "Getting To Know You"!
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Multi-value I-descriptor In SB/Unidata  (Read 537 times)
adewitt
Professional
***
Posts: 42


« 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.
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1532



WWW
« Reply #1 on: November 23, 2011, 02:19:48 PM »

I take it that RECORD<19> is multivalued?
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
adewitt
Professional
***
Posts: 42


« Reply #2 on: November 23, 2011, 02:24:43 PM »

Yes it is.
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1532



WWW
« 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'))
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
adewitt
Professional
***
Posts: 42


« Reply #4 on: November 23, 2011, 05:38:36 PM »

No go, Kevin.

I'll take it up Monday.

Happy Thanksgiving.
Logged
Colin Alfke
Professional
***
Posts: 22


« 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
Logged
adewitt
Professional
***
Posts: 42


« 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.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!