![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Hi What I'm looking for is a way to build a new table based on the output generated by a UniQuery LIST command. What I'd like is for the output generated by the LIST comand to be of infinite width and depth, and then be able to parse that output, generating records to write to a file. I'd like to be able to issue a LIST command with any and all of the selection criteria, sort criteria, formatting options - BY-EXPs, BREAK-ONs, the lot - and get back a new table. I have a partially completed subroutine. The arguments passed to it are :- 1) The LIST command 2) The name of a destination file 3) The "Form", or normalisation, option 4) An Overwrite/Don't overwrite switch and the arguments returned are :- 5) Error codes 6) Error messages If the "Form" option is passed as "1NF", then each line generated by the LIST statement will become a new record in the destination file, and will be keyed on a sequential number beginning with 1. Each row, or record, will derive from a line generated by the LIST statement, with an attribute for each column, and each and every attribute will be populated. Where the LIST statement produced lines with blanks in columns for single attributes with multiple associated multivalues - or for multivalues with multiple associated subvalues - then, when I'm parsing the output to create the new records, I'll be using the last non-blank value in a column to populate the attribute for that column in subsequent records. The other option for "Form" will be "NNF". In that case, repeated values will be removed, and up to 126 levels of nesting can occur, with each attribute being delimited by char(253), and within that by char(252)... and so on down to char(128). In this case, where a column contains a repeat occurrence, and all columns to the left of it were either blank or the same as the last non-blank value in that column in previous lines, the value will be removed (that is to say - it will me interpreted as being redundant). Key to being able to do this is to allow the LIST statement to generate the widest possible "page" of output, and also to be able to efficiently handle the output. Have you any advice on how I could go beyond setting the printer page width to 256 characters and the page depth to infinity (TERM ,,256,0)? Or maybe you can suggest a better way than PERFORM...CAPTURING... to get hold of the LIST output so as to begin parsing it. TIA, Mike. |
#2
| |||
| |||
|
|
Please - someone tell me this is possible. I have seen something similar to what I'm after with D3's Access Query Language. Is D3 - as I have come to believe - just that much more developer-friendly and advanced than IBM's UniData? Mike. |
#3
| |||
| |||
|
|
I posted this to u2users (google) group without getting a response - so I'll try here... michael (AT) preece (DOT) net wrote: Hi What I'm looking for is a way to build a new table based on the output generated by a UniQuery LIST command. What I'd like is for the output generated by the LIST comand to be of infinite width and depth, and then be able to parse that output, generating records to write to a file. I'd like to be able to issue a LIST command with any and all of the selection criteria, sort criteria, formatting options - BY-EXPs, BREAK-ONs, the lot - and get back a new table. I have a partially completed subroutine. The arguments passed to it are :- 1) The LIST command 2) The name of a destination file 3) The "Form", or normalisation, option 4) An Overwrite/Don't overwrite switch and the arguments returned are :- 5) Error codes 6) Error messages If the "Form" option is passed as "1NF", then each line generated by the LIST statement will become a new record in the destination file, and will be keyed on a sequential number beginning with 1. Each row, or record, will derive from a line generated by the LIST statement, with an attribute for each column, and each and every attribute will be populated. Where the LIST statement produced lines with blanks in columns for single attributes with multiple associated multivalues - or for multivalues with multiple associated subvalues - then, when I'm parsing the output to create the new records, I'll be using the last non-blank value in a column to populate the attribute for that column in subsequent records. The other option for "Form" will be "NNF". In that case, repeated values will be removed, and up to 126 levels of nesting can occur, with each attribute being delimited by char(253), and within that by char(252)... and so on down to char(128). In this case, where a column contains a repeat occurrence, and all columns to the left of it were either blank or the same as the last non-blank value in that column in previous lines, the value will be removed (that is to say - it will me interpreted as being redundant). Key to being able to do this is to allow the LIST statement to generate the widest possible "page" of output, and also to be able to efficiently handle the output. Have you any advice on how I could go beyond setting the printer page width to 256 characters and the page depth to infinity (TERM ,,256,0)? Or maybe you can suggest a better way than PERFORM...CAPTURING... to get hold of the LIST output so as to begin parsing it. TIA, Mike. The silence in here is deafening. This (u2users google group) really could be a useful group you know - all it takes is active participation. Don't be shy... As you can probably tell, I am not "at home" with UniData yet - apart from UniBasic - having spent most of my time with the Pick/Reality side of the MV family. I got a bit further with what I was attempting. I worked out that I needed to set the TERMinal width to 1024 (the maximum width allowed) and depth to 0 (infinity) - nothing to do with the printer. Before EXECUTEing the SORT.COMMAND I executed a "COMO ON myfilename HUSH" - and a "COMO myfilename OFF" afterwards. So now I have the SORT.COMMAND that was used to generate the intermediate stage data - which I have in the _PH_ O_myfilename ASCII sequential file. The problem I'm up against now is that I'd like to be able to map the SORT.COMMAND to the output it generated - in order to begin parsing the data. It's weighing on my mind that I'm having to reinvent a wheel here - and one that I've just turned at that. The UniQuery processor must have constructed exactly what I'm after somewhere along the way. What would be excellent is if there was some option or something that will get UniQuery to cough up its internals, so to speak, and show its internal metadata for what the columns are, what their widths are, whether they're left or right justified, what output conversion was applied to each column - and anything else I might be able to use. Please - someone tell me this is possible. I have seen something similar to what I'm after with D3's Access Query Language. Is D3 - as I have come to believe - just that much more developer-friendly and advanced than IBM's UniData? Mike. |
#4
| |||
| |||
|
|
I posted this to u2users (google) group without getting a response - so I'll try here... michael (AT) preece (DOT) net wrote: Hi What I'm looking for is a way to build a new table based on the output generated by a UniQuery LIST command. What I'd like is for the output generated by the LIST comand to be of infinite width and depth, and then be able to parse that output, generating records to write to a file. |
|
I'd like to be able to issue a LIST command with any and all of the selection criteria, sort criteria, formatting options - BY-EXPs, BREAK-ONs, the lot - and get back a new table. I have a partially completed subroutine. The arguments passed to it are :- 1) The LIST command 2) The name of a destination file 3) The "Form", or normalisation, option 4) An Overwrite/Don't overwrite switch and the arguments returned are :- 5) Error codes 6) Error messages If the "Form" option is passed as "1NF", then each line generated by the LIST statement will become a new record in the destination file, and will be keyed on a sequential number beginning with 1. Each row, or record, will derive from a line generated by the LIST statement, with an attribute for each column, and each and every attribute will be populated. Where the LIST statement produced lines with blanks in columns for single attributes with multiple associated multivalues - or for multivalues with multiple associated subvalues - then, when I'm parsing the output to create the new records, I'll be using the last non-blank value in a column to populate the attribute for that column in subsequent records. The other option for "Form" will be "NNF". In that case, repeated values will be removed, and up to 126 levels of nesting can occur, with each attribute being delimited by char(253), and within that by char(252)... and so on down to char(128). In this case, where a column contains a repeat occurrence, and all columns to the left of it were either blank or the same as the last non-blank value in that column in previous lines, the value will be removed (that is to say - it will me interpreted as being redundant). Key to being able to do this is to allow the LIST statement to generate the widest possible "page" of output, and also to be able to efficiently handle the output. Have you any advice on how I could go beyond setting the printer page width to 256 characters and the page depth to infinity (TERM ,,256,0)? Or maybe you can suggest a better way than PERFORM...CAPTURING... to get hold of the LIST output so as to begin parsing it. TIA, Mike. The silence in here is deafening. This (u2users google group) really could be a useful group you know - all it takes is active participation. Don't be shy... |
#5
| |||
| |||
|
|
I posted this to u2users (google) group without getting a response - so I'll try here... |
Do yourself a favor, delete the group and
#6
| |||
| |||
|
|
Mike Preece wrote: I posted this to u2users (google) group without getting a response - so I'll try here... michael preece net wrote: Hi What I'm looking for is a way to build a new table based on the output generated by a UniQuery LIST command. What I'd like is for the output generated by the LIST comand to be of infinite width and depth, and then be able to parse that output, generating records to write to a file. I'd like to be able to issue a LIST command with any and all of the selection criteria, sort criteria, formatting options - BY-EXPs, BREAK-ONs, the lot - and get back a new table. I have a partially completed subroutine. The arguments passed to it are :- 1) The LIST command 2) The name of a destination file 3) The "Form", or normalisation, option 4) An Overwrite/Don't overwrite switch and the arguments returned are :- 5) Error codes 6) Error messages If the "Form" option is passed as "1NF", then each line generated by the LIST statement will become a new record in the destination file, and will be keyed on a sequential number beginning with 1. Each row, or record, will derive from a line generated by the LIST statement, with an attribute for each column, and each and every attribute will be populated. Where the LIST statement produced lines with blanks in columns for single attributes with multiple associated multivalues - or for multivalues with multiple associated subvalues - then, when I'm parsing the output to create the new records, I'll be using the last non-blank value in a column to populate the attribute for that column in subsequent records. The other option for "Form" will be "NNF". In that case, repeated values will be removed, and up to 126 levels of nesting can occur, with each attribute being delimited by char(253), and within that by char(252)... and so on down to char(128). In this case, where a column contains a repeat occurrence, and all columns to the left of it were either blank or the same as the last non-blank value in that column in previous lines, the value will be removed (that is to say - it will me interpreted as being redundant). Key to being able to do this is to allow the LIST statement to generate the widest possible "page" of output, and also to be able to efficiently handle the output. Have you any advice on how I could go beyond setting the printer page width to 256 characters and the page depth to infinity (TERM ,,256,0)? Or maybe you can suggest a better way than PERFORM...CAPTURING... to get hold of the LIST output so as to begin parsing it. TIA, Mike. The silence in here is deafening. This (u2users google group) really could be a useful group you know - all it takes is active participation. Don't be shy... As you can probably tell, I am not "at home" with UniData yet - apart from UniBasic - having spent most of my time with the Pick/Reality side of the MV family. I got a bit further with what I was attempting. I worked out that I needed to set the TERMinal width to 1024 (the maximum width allowed) and depth to 0 (infinity) - nothing to do with the printer. Before EXECUTEing the SORT.COMMAND I executed a "COMO ON myfilename HUSH" - and a "COMO myfilename OFF" afterwards. So now I have the SORT.COMMAND that was used to generate the intermediate stage data - which I have in the _PH_ O_myfilename ASCII sequential file. The problem I'm up against now is that I'd like to be able to map the SORT.COMMAND to the output it generated - in order to begin parsing the data. It's weighing on my mind that I'm having to reinvent a wheel here - and one that I've just turned at that. The UniQuery processor must have constructed exactly what I'm after somewhere along the way. What would be excellent is if there was some option or something that will get UniQuery to cough up its internals, so to speak, and show its internal metadata for what the columns are, what their widths are, whether they're left or right justified, what output conversion was applied to each column - and anything else I might be able to use. Please - someone tell me this is possible. I have seen something similar to what I'm after with D3's Access Query Language. Is D3 - as I have come to believe - just that much more developer-friendly and advanced than IBM's UniData? Mike. It would be nice to know if there's anything available re: the above - but meanwhile, in case anyone's interested, I'm heading down the SORT...TOXML route, as in :- SORT TMS.TASK CREATE.DATE MINUTES.SPENT TOXML Validate XML name changed name from '@ID' to '_ID' ?xml version="1.0"? ROOT TMS.TASK_record _ID = "1" CREATE.DATE = "01 DEC 2005" TIME.INFO_MV MINUTES.SPENT = "20"/ TIME.INFO_MV MINUTES.SPENT = "120"/ TIME.INFO_MV MINUTES.SPENT = "45"/ /TMS.TASK_record TMS.TASK_record _ID = "2" CREATE.DATE = "11 DEC 2005" TIME.INFO_MV MINUTES.SPENT = "120"/ TIME.INFO_MV MINUTES.SPENT = "120"/ TIME.INFO_MV MINUTES.SPENT = "120"/ /TMS.TASK_record /ROOT SORT TMS.TASK CREATE.DATE MINUTES.SPENT TOXML ELEMENTS Validate XML name changed name from '@ID' to '_ID' ?xml version="1.0"? ROOT TMS.TASK_record _ID>1</_ID CREATE.DATE>01 DEC 2005</CREATE.DATE TIME.INFO_MV MINUTES.SPENT>20</MINUTES.SPENT /TIME.INFO_MV TIME.INFO_MV MINUTES.SPENT>120</MINUTES.SPENT /TIME.INFO_MV TIME.INFO_MV MINUTES.SPENT>45</MINUTES.SPENT /TIME.INFO_MV /TMS.TASK_record TMS.TASK_record _ID>2</_ID CREATE.DATE>11 DEC 2005</CREATE.DATE TIME.INFO_MV MINUTES.SPENT>120</MINUTES.SPENT /TIME.INFO_MV TIME.INFO_MV MINUTES.SPENT>120</MINUTES.SPENT /TIME.INFO_MV TIME.INFO_MV MINUTES.SPENT>120</MINUTES.SPENT /TIME.INFO_MV /TMS.TASK_record /ROOT ...which is easier to work with than the output from a normal UniQuery listing. Mike. |
#7
| |||
| |||
|
|
...What I'd like is for the output generated by the LIST comand [sic] to be of infinite width and depth... ________________________^^^^^^^^ |
#8
| |||
| |||
|
|
Regarding your post to the Google group: Respectfully my friend, the only Google group that exists for U2/MV users is the one you created. There are only 36 members there and you're mostly talking to yourself in the few messages that have been posted - trees are falling and no one is around to hear them. Hey, I understand the feeling from my own unused website forums. Do yourself a favor, delete the group andtake your requests to the u2users forum supported by U2UG.org. I'm sure you'll get considered responses from a large and dedicated community. HTH T |
#9
| |||
| |||
|
|
Tony Gravagno wrote: [snip] Regarding your post to the Google group: Respectfully my friend, the only Google group that exists for U2/MV users is the one you created. There are only 36 members there and you're mostly talking to yourself in the few messages that have been posted - trees are falling and no one is around to hear them. Hey, I understand the feeling from my own unused website forums. Do yourself a favor, delete the group andtake your requests to the u2users forum supported by U2UG.org. I'm sure you'll get considered responses from a large and dedicated community. HTH T There's one thing and one thing only wrong with the u2users google group : no one participates. There's one thing and one thing only that the Oliver list has to its advantage : many people participate. |
|
The u2ug forums are somewhere between the two. If you want to dig your heels in and refuse to go there - then that's up to you. Stay away if you want to. I really don't see what useful purpose you're serving though by advising me to shut it down, or implying it's a waste of time and that, therefore, others should also not participate. It's unhelpful and unconstructive criticism. Bud. Mike. Regards, |
#10
| |||
| |||
|
|
On 4 Jan 2006 18:11:42 -0800, "Mike Preece" <michael (AT) preece (DOT) net wrote: Tony Gravagno wrote: [snip] Regarding your post to the Google group: Respectfully my friend, the only Google group that exists for U2/MV users is the one you created. There are only 36 members there and you're mostly talking to yourself in the few messages that have been posted - trees are falling and no one is around to hear them. Hey, I understand the feeling from my own unused website forums. Do yourself a favor, delete the group andtake your requests to the u2users forum supported by U2UG.org. I'm sure you'll get considered responses from a large and dedicated community. HTH T There's one thing and one thing only wrong with the u2users google group : no one participates. There's one thing and one thing only that the Oliver list has to its advantage : many people participate. Errrr..... Bit hard getting any response from "the Oliver list" these days... It's dead.... NOBODY participates any more. Been replaced by u2ug.org..... |
|
BTW, have you tried to garner any interest in u2users.google by mentioning its presence on u2ug? I can't find any mention of it there..... Polite aside> the "ug" in "u2ug" probably stands for "users group" - why do we need another such "user group"?<Polite aside/ The u2ug forums are somewhere between the two. If you want to dig your heels in and refuse to go there - then that's up to you. Stay away if you want to. I really don't see what useful purpose you're serving though by advising me to shut it down, or implying it's a waste of time and that, therefore, others should also not participate. It's unhelpful and unconstructive criticism. Bud. Mike. Regards, Bruce Nichol Talon Computer Services ALBURY NSW Australia http://www.taloncs.com.au If it ain't broke, fix it until it is.... |
![]() |
| Thread Tools | |
| Display Modes | |
| |