In a message dated 00-03-01 10:47:34 EST, you write:
Group ID = If =“SA” Then “BY-AS” Else If ( = “SS/RS” And
InList(“IM”,“SC/IT”,“SV/VN”,“TM”)) Then “BY-AP” Else If =“SS/RS” And InList(“ANT”,“FSW”,“GG/NP”,“PC”) Then “PM-PC”
Try:
decode(system, ‘SA’, ‘BY-AS’, ‘SS/RS’, decode(component, ‘IM’,‘BY-AP’,‘SC/IT’,‘BY-AP’,‘SV/VN’,‘BY-AP’,‘TM’,‘BY-AP’,‘ANT’,‘PM-PC’,‘FSW’, ‘PM-PC’,‘GG/NP’,‘PM-PC’,‘PC’,‘PM-PC’),‘UNKNOWN’)
Replace SYSTEM and COMPONENT with appropriate database table.column values.
As I don’t have your database, I can’t syntax check this, so be careful that all of the quotes and parens match. The idea is that the first decode checks for a SYSTEM value of ‘SA’. If found, then it returns ‘BY-AS’. If the SYSTEM value is ‘SS/RS’ then the list of various values and return codes is provided by a second nested decode. The final “else” of ‘UNKNOWN’ was not specified, but it is my practice with a combination decode as complicated as this one to provide a “catch all” for anything that was not defined correctly, or not defined at all.
There is no equivalent to “In List” in decode. You simply must list each item out with a matching result value. Again, I have not syntax checked this, but it should give you a starting point!
Regards,
Dave Rathbun
Integra Solutions
www.islink.com
Listserv Archives (BOB member since 2002-06-25)