![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
OK, now you get to see how little I know. I have been working on the business intelligence side of the house (data retrieval) and/or management since the mid-80's. Before that I was a COBOL CICS IMS developer. So, I've never been a DataBASIC programmer. I do have manuals and also Jon Sisk's book on BASIC, but I'm feeling lazy while watching skating on TV (prompting the husband to head to the other room to watch football) and most of you can answer this before the next down. Question: What would a BASIC statement look like that deletes a MultiValue with a specified number or the first one with a specified value (whichever is easiest) and does not leave a gap, but moves the values behind it up in the list. File: MYFILE Record: 12345 Field: EMAIL MultiValued Values: emailaddress1 emailaddress2 emailaddress3 emailaddress4 and I want to delete the second one so that the list is emailaddress1 emailaddress3 emailaddress4 Thanks. --dawn |
#3
| |||
| |||
|
|
OK, now you get to see how little I know. I have been working on the business intelligence side of the house (data retrieval) and/or management since the mid-80's. Before that I was a COBOL CICS IMS developer. So, I've never been a DataBASIC programmer. I do have manuals and also Jon Sisk's book on BASIC, but I'm feeling lazy while watching skating on TV (prompting the husband to head to the other room to watch football) and most of you can answer this before the next down. Question: What would a BASIC statement look like that deletes a MultiValue with a specified number or the first one with a specified value (whichever is easiest) and does not leave a gap, but moves the values behind it up in the list. File: MYFILE Record: 12345 Field: EMAIL MultiValued Values: emailaddress1 emailaddress2 emailaddress3 emailaddress4 and I want to delete the second one so that the list is emailaddress1 emailaddress3 emailaddress4 Thanks. --dawn |
#4
| |||
| |||
|
|
dawn wrote: OK, now you get to see how little I know. I have been working on the business intelligence side of the house (data retrieval) and/or management since the mid-80's. Before that I was a COBOL CICS IMS developer. So, I've never been a DataBASIC programmer. I do have manuals and also Jon Sisk's book on BASIC, but I'm feeling lazy while watching skating on TV (prompting the husband to head to the other room to watch football) and most of you can answer this before the next down. Question: What would a BASIC statement look like that deletes a MultiValue with a specified number or the first one with a specified value (whichever is easiest) and does not leave a gap, but moves the values behind it up in the list. File: MYFILE Record: 12345 Field: EMAIL MultiValued Values: emailaddress1 emailaddress2 emailaddress3 emailaddress4 and I want to delete the second one so that the list is emailaddress1 emailaddress3 emailaddress4 Thanks. --dawn del rec<emailatt,emailaddrpos |
|
or del rec<9,2 |
|
or rec=delete(rec,emailatt,emailaddrpos) or locate emailaddr in rec<emailatt>,1 setting pos then del rec<emailatt,pos or ... variations ad infinitum |
#5
| |||
| |||
|
|
Mike Preece wrote: dawn wrote: OK, now you get to see how little I know. I have been working on the business intelligence side of the house (data retrieval) and/or management since the mid-80's. Before that I was a COBOL CICS IMS developer. So, I've never been a DataBASIC programmer. I do have manuals and also Jon Sisk's book on BASIC, but I'm feeling lazy while watching skating on TV (prompting the husband to head to the other room to watch football) and most of you can answer this before the next down. Question: What would a BASIC statement look like that deletes a MultiValue with a specified number or the first one with a specified value (whichever is easiest) and does not leave a gap, but moves the values behind it up in the list. File: MYFILE Record: 12345 Field: EMAIL MultiValued Values: emailaddress1 emailaddress2 emailaddress3 emailaddress4 and I want to delete the second one so that the list is emailaddress1 emailaddress3 emailaddress4 Thanks. --dawn del rec<emailatt,emailaddrpos Thanks for the quick response. In this case emailatt must be the LOC for the field EMAIL, right? or del rec<9,2 9 being the LOC for the EMAIL attribute and 2 being the MultiValue position is what I gather, which means you first need a read of some sort to assign the record to rec, if I am reading that correctly. or rec=delete(rec,emailatt,emailaddrpos) or locate emailaddr in rec<emailatt>,1 setting pos then del rec<emailatt,pos or ... variations ad infinitum Got it. It appears that each of these first requires a separate statement to read the record before you can use the operation that remove the multivalue. I think that answers my question. Thanks. --dawn |
#6
| |||
| |||
|
#7
| ||||||
| ||||||
|
|
Dawn, If you are doing research for your blog, remember that if there are other fields associated with the email (eg: email type = bus|private|blind) then you would need to also remove these related values in order to maintain referential integrity. |
|
This is one of the "gotcha's" you will have with the CDT crowd. |
|
Many tools (like Visage) will do this sort of thing automatically for you ... in Basic this must be done by the application programmer. |
|
UV has a rudimentary mechanism to at least indicate which multi-valued fields are co-related via the "Association" field |
|
- even MORE rudimentary in D3 where you have a controlling/dependent mechanism. |
|
In all cases developers are given the "flexibility" of NOT maintaining this information (and unfortunately this tends to be the case!! One of the biggest strengths of the mv paradigm is its flexibilty. One of the biggest weaknesses of the mv paradgm is its flexibility) |
#8
| |||
| |||
|
|
Dawn, If you are doing research for your blog, remember that if there are other fields associated with the email (eg: email type = bus|private|blind) then you would need to also remove these related values in order to maintain referential integrity. This is one of the "gotcha's" you will have with the CDT crowd. Many tools (like Visage) will do this sort of thing automatically for you ... in Basic this must be done by the application programmer. UV has a rudimentary mechanism to at least indicate which multi-valued fields are co-related via the "Association" field - even MORE rudimentary in D3 where you have a controlling/dependent mechanism. In all cases developers are given the "flexibility" of NOT maintaining this information (and unfortunately this tends to be the case!! One of the biggest strengths of the mv paradigm is its flexibilty. One of the biggest weaknesses of the mv paradgm is its flexibility) |
#9
| |||
| |||
|
#10
| |||
| |||
|
|
dawn wrote: OK, now you get to see how little I know. I have been working on the business intelligence side of the house (data retrieval) and/or management since the mid-80's. Before that I was a COBOL CICS IMS developer. So, I've never been a DataBASIC programmer. I do have manuals and also Jon Sisk's book on BASIC, but I'm feeling lazy while watching skating on TV (prompting the husband to head to the other room to watch football) and most of you can answer this before the next down. Question: What would a BASIC statement look like that deletes a MultiValue with a specified number or the first one with a specified value (whichever is easiest) and does not leave a gap, but moves the values behind it up in the list. File: MYFILE Record: 12345 Field: EMAIL MultiValued Values: emailaddress1 emailaddress2 emailaddress3 emailaddress4 and I want to delete the second one so that the list is emailaddress1 emailaddress3 emailaddress4 Thanks. --dawn del rec<emailatt,emailaddrpos or del rec<9,2 or rec=delete(rec,emailatt,emailaddrpos) or locate emailaddr in rec<emailatt>,1 setting pos then del rec<emailatt,pos or ... variations ad infinitum |
![]() |
| Thread Tools | |
| Display Modes | |
| |