Re: [U2] Unibasic: Sample program - to extract data from Table
Many Thanks all of you Now final code is: ==start code OPEN 'CUSTOMER' TO FIL ELSE STOP 201 'CUSTOMER' OPENSEQ 'OUTPUT.CSV' TO CSVFIL ELSE NULL WEOFSEQ CSVFIL SELECT FIL LOOP WHILE READNEXT ID DO READ REC FROM FIL,ID THEN * Count how many multivalues are in each attribute MV.COUNT = NUM.ATTRS = DCOUNT(REC,@AM) FOR A = 1 TO NUM.ATTRS MV.COUNT1,A = DCOUNT(RECA,@VM) NEXT A * And find the highest number MAX.MVS = MAXIMUM(MV.COUNT) * Convert specific attributes to date format. * Note the OCONVS handles multivalued data - it converts each value separately. REC9 = OCONVS(REC9,D2/) * Now output a line for each multivalue FOR A = 1 TO MAX.MVS OUT.LINE = FOR B = 1 TO NUM.ATTRS IF MV.COUNT1,A EQ 1 THEN OUT.LINE1,B = RECB ELSE OUT.LINE1,B = RECB,A NEXT B * Turn multivalues in the output line to commas *OUT.LINE = CHANGE(OUT.LINE,@VM,,) OUT.LINE = '' : CHANGE(CHANGE(OUT.LINE,@AM,','),@VM,',') : ',':ID * And write the line to the output file WRITESEQ OUT.LINE ON CSVFIL ELSE CRT 'CAN NOT EWRITE TO CSV FILE' * WRITESEQ OUT.LINE ... NEXT A END REPEAT ==End code :BASIC BP outfile Compiling Unibasic: BP/outfile in mode 'u'. compilation finished :RUN BP outfile In BP/_outfile at line 10 WARNING: UNINITIALIZED VARIABLE USED! Zero ssumed! : And output is :- ( Missing C,R in multivalve, date also not converted) Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, October 16, 2009 12:39 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Yes, and I've just spotted the first mistake - the last line should have been a couple of lines higher... * Count how many multivalues are in each attribute MV.COUNT = NUM.ATTRS = DCOUNT(REC,@AM) FOR A = 1 TO NUM.ATTRS MV.COUNT1,A = DCOUNT(RECA,@VM) NEXT A * And find the highest number MAX.MVS = MAXIMUM(MV.COUNT) * Convert specific attributes to date format. * Note the OCONVS handles multivalued data - it converts each value separately. REC9 = OCONVS(REC9,D2/) * Now output a line for each multivalue FOR A = 1 TO MAX.MVS OUT.LINE = FOR B = 1 TO NUM.ATTRS IF MV.COUNT1,A EQ 1 THEN OUT.LINE1,B = RECB ELSE OUT.LINE1,B = RECB,A NEXT B * Turn multivalues in the output line to commas OUT.LINE = CHANGE(OUT.LINE,@VM,,) * And write the line to the output file WRITESEQ OUT.LINE ... NEXT A * -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: 16 October 2009 08:06 To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Dattatraya - in unibasic almost any string handling task is possible! Hmm - funny how the original topic of this thread and the subsequent discussion of specifications, or lack of, seems to have come full circle. Starting with REC - as read from disk. Presume REC has one or more multivalued fields. REC is to be written to the output file multiple times, subsequent lines taking the 1st, 2nd etc multivalue where the attribute is multivalued and taking the entire attribute otherwise. * Count how many multivalues are in each attribute MV.COUNT = NUM.ATTRS = DCOUNT(REC,@AM) FOR A = 1 TO NUM.ATTRS MV.COUNT1,A = DCOUNT(RECA,@VM) NEXT A * And find the highest number MAX.MVS = MAXIMUM(MV.COUNT) * Convert specific attributes to date format. * Note the OCONVS handles multivalued data - it converts each value separately. REC9 = OCONVS(REC9,D2/) * Now output a line for each multivalue FOR A = 1 TO MAX.MVS OUT.LINE = FOR B = 1 TO NUM.ATTRS IF MV.COUNT1,A EQ 1 THEN OUT.LINE1,B = RECB ELSE OUT.LINE1,B = RECB,A NEXT B WRITESEQ OUT.LINE ... NEXT A OUT.LINE = CHANGE(OUT.LINE,@VM,,) * Hope this helps - I've not compiled it so it might need a bit of tweaking to get it working. Ed -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: 16 October 2009 05:20 To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Many Thanks George Now output is giving following way Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D C R,7,6 Frobisher, Kamal,P.O. Box 9845 ,Denver,CO,80209-,3037780880,,,K O,33,204 But I want following way ( D,C,R are multivalue ) , date output also showing 9611 which is (04/24/94) is it possible? Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,C,7,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,R,7,6 Thanks Regards
Re: [U2] Unibasic: Sample program - to extract data from Table
Thanks Ed, Will debug code, as you asked. Thanks Regards, Dattatraya Walgude DBA Team Rsystems International Ltd, Pune, ( : +91-20-22909212 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, October 16, 2009 3:29 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Dattatraya, (Possible) correction added. You really need to take the time to understand the example code we're giving you. There will still be problems in the code below - for example, I can't see why the date conversion is failing or why (despite the uninit var) the C and R are missing. Really at this point you are in the best position to debug the program as you have the source data, which I'm having to guess the format of. Debugging - there's a proper debugger built into unidata but for quick and dirty checking, use CRT variable to display the contents of a variable to screen, and INPUT X,1 to have the program wait until you press a key - useful if you're displaying a lot of values and want to add a pause - for example after each record has been processed. Ed OPEN 'CUSTOMER' TO FIL ELSE STOP 201 'CUSTOMER' OPENSEQ 'OUTPUT.CSV' TO CSVFIL ELSE NULL WEOFSEQ CSVFIL SELECT FIL LOOP WHILE READNEXT ID DO READ REC FROM FIL,ID THEN * Count how many multivalues are in each attribute MV.COUNT = NUM.ATTRS = DCOUNT(REC,@AM) MV.COUNT = FOR A = 1 TO NUM.ATTRS MV.COUNT1,A = DCOUNT(RECA,@VM) NEXT A * And find the highest number MAX.MVS = MAXIMUM(MV.COUNT) * Convert specific attributes to date format. * Note the OCONVS handles multivalued data - it converts each value separately. REC9 = OCONVS(REC9,D2/) * Now output a line for each multivalue FOR A = 1 TO MAX.MVS OUT.LINE = FOR B = 1 TO NUM.ATTRS IF MV.COUNT1,A EQ 1 THEN OUT.LINE1,B = RECB ELSE OUT.LINE1,B = RECB,A NEXT B * Turn multivalues in the output line to commas *OUT.LINE = CHANGE(OUT.LINE,@VM,,) OUT.LINE = '' : CHANGE(CHANGE(OUT.LINE,@AM,','),@VM,',') : ',':ID * And write the line to the output file WRITESEQ OUT.LINE ON CSVFIL ELSE CRT 'CAN NOT EWRITE TO CSV FILE' * WRITESEQ OUT.LINE ... NEXT A END REPEAT ==End code :BASIC BP outfile Compiling Unibasic: BP/outfile in mode 'u'. compilation finished :RUN BP outfile In BP/_outfile at line 10 WARNING: UNINITIALIZED VARIABLE USED! Zero ssumed! : And output is :- ( Missing C,R in multivalve, date also not converted) Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, October 16, 2009 12:39 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Yes, and I've just spotted the first mistake - the last line should have been a couple of lines higher... * Count how many multivalues are in each attribute MV.COUNT = NUM.ATTRS = DCOUNT(REC,@AM) FOR A = 1 TO NUM.ATTRS MV.COUNT1,A = DCOUNT(RECA,@VM) NEXT A * And find the highest number MAX.MVS = MAXIMUM(MV.COUNT) * Convert specific attributes to date format. * Note the OCONVS handles multivalued data - it converts each value separately. REC9 = OCONVS(REC9,D2/) * Now output a line for each multivalue FOR A = 1 TO MAX.MVS OUT.LINE = FOR B = 1 TO NUM.ATTRS IF MV.COUNT1,A EQ 1 THEN OUT.LINE1,B = RECB ELSE OUT.LINE1,B = RECB,A NEXT B * Turn multivalues in the output line to commas OUT.LINE = CHANGE(OUT.LINE,@VM,,) * And write the line to the output file WRITESEQ OUT.LINE ... NEXT A * -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: 16 October 2009 08:06 To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Dattatraya - in unibasic almost any string handling task is possible! Hmm - funny how the original topic of this thread and the subsequent discussion of specifications, or lack of, seems to have come full circle. Starting with REC - as read from disk. Presume REC has one or more multivalued fields. REC is to be written to the output file multiple times, subsequent lines taking the 1st, 2nd etc multivalue where the attribute is multivalued and taking the entire attribute otherwise. * Count how many multivalues are in each attribute MV.COUNT = NUM.ATTRS = DCOUNT(REC,@AM) FOR A = 1 TO NUM.ATTRS MV.COUNT1,A = DCOUNT(RECA,@VM) NEXT A * And find the highest number MAX.MVS = MAXIMUM(MV.COUNT) * Convert specific attributes to date format. * Note the OCONVS handles multivalued data - it converts each value separately. REC9 = OCONVS(REC9,D2/) * Now output a line
Re: [U2] Unibasic: Sample program - to extract data from Table
Now Date is converted, but multivalue ( C , R ) still missing. ,Jones, Bob,123 E. 23rdst.,Arvada,CO,80276,3037768854,V4341,04/24/94,D,7,R,6 ,Jones, Bob,123 E. 23rdSt.,Arvada,CO,80276,3037768854,V4341,04/24/94,D,7,R,6 ,Jones, Bob,123 E. 23rdSt.,Arvada,CO,80276,3037768854,V4341,04/24/94,D,7,R,6 Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, October 16, 2009 3:29 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Dattatraya, (Possible) correction added. You really need to take the time to understand the example code we're giving you. There will still be problems in the code below - for example, I can't see why the date conversion is failing or why (despite the uninit var) the C and R are missing. Really at this point you are in the best position to debug the program as you have the source data, which I'm having to guess the format of. Debugging - there's a proper debugger built into unidata but for quick and dirty checking, use CRT variable to display the contents of a variable to screen, and INPUT X,1 to have the program wait until you press a key - useful if you're displaying a lot of values and want to add a pause - for example after each record has been processed. Ed OPEN 'CUSTOMER' TO FIL ELSE STOP 201 'CUSTOMER' OPENSEQ 'OUTPUT.CSV' TO CSVFIL ELSE NULL WEOFSEQ CSVFIL SELECT FIL LOOP WHILE READNEXT ID DO READ REC FROM FIL,ID THEN * Count how many multivalues are in each attribute MV.COUNT = NUM.ATTRS = DCOUNT(REC,@AM) MV.COUNT = FOR A = 1 TO NUM.ATTRS MV.COUNT1,A = DCOUNT(RECA,@VM) NEXT A * And find the highest number MAX.MVS = MAXIMUM(MV.COUNT) * Convert specific attributes to date format. * Note the OCONVS handles multivalued data - it converts each value separately. REC9 = OCONVS(REC9,D2/) * Now output a line for each multivalue FOR A = 1 TO MAX.MVS OUT.LINE = FOR B = 1 TO NUM.ATTRS IF MV.COUNT1,A EQ 1 THEN OUT.LINE1,B = RECB ELSE OUT.LINE1,B = RECB,A NEXT B * Turn multivalues in the output line to commas *OUT.LINE = CHANGE(OUT.LINE,@VM,,) OUT.LINE = '' : CHANGE(CHANGE(OUT.LINE,@AM,','),@VM,',') : ',':ID * And write the line to the output file WRITESEQ OUT.LINE ON CSVFIL ELSE CRT 'CAN NOT EWRITE TO CSV FILE' * WRITESEQ OUT.LINE ... NEXT A END REPEAT ==End code :BASIC BP outfile Compiling Unibasic: BP/outfile in mode 'u'. compilation finished :RUN BP outfile In BP/_outfile at line 10 WARNING: UNINITIALIZED VARIABLE USED! Zero ssumed! : And output is :- ( Missing C,R in multivalve, date also not converted) Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, October 16, 2009 12:39 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Yes, and I've just spotted the first mistake - the last line should have been a couple of lines higher... * Count how many multivalues are in each attribute MV.COUNT = NUM.ATTRS = DCOUNT(REC,@AM) FOR A = 1 TO NUM.ATTRS MV.COUNT1,A = DCOUNT(RECA,@VM) NEXT A * And find the highest number MAX.MVS = MAXIMUM(MV.COUNT) * Convert specific attributes to date format. * Note the OCONVS handles multivalued data - it converts each value separately. REC9 = OCONVS(REC9,D2/) * Now output a line for each multivalue FOR A = 1 TO MAX.MVS OUT.LINE = FOR B = 1 TO NUM.ATTRS IF MV.COUNT1,A EQ 1 THEN OUT.LINE1,B = RECB ELSE OUT.LINE1,B = RECB,A NEXT B * Turn multivalues in the output line to commas OUT.LINE = CHANGE(OUT.LINE,@VM,,) * And write the line to the output file WRITESEQ OUT.LINE ... NEXT A * -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: 16 October 2009 08:06 To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Dattatraya - in unibasic almost any string handling task is possible! Hmm - funny how the original topic of this thread and the subsequent discussion of specifications, or lack of, seems to have come full circle. Starting with REC - as read from disk. Presume REC has one or more multivalued fields. REC is to be written to the output file multiple times, subsequent lines taking the 1st, 2nd etc multivalue where the attribute is multivalued and taking the entire attribute otherwise. * Count how many multivalues are in each attribute MV.COUNT = NUM.ATTRS = DCOUNT(REC,@AM) FOR A = 1 TO NUM.ATTRS MV.COUNT1,A = DCOUNT(RECA,@VM) NEXT A * And find the highest number MAX.MVS
Re: [U2] Unibasic: Sample program - to extract data from Table
Thanks Ed, It comes correct (only two records), missing another rows:- Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,04/24/94,D,7,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,04/24/94,C,7,6 Thanks Regards, Dattatraya Walgude DBA Team Rsystems International Ltd, Pune, ( : +91-20-22909212 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, October 16, 2009 4:49 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Try changing IF MV.COUNT1,A EQ 1 THEN OUT.LINE1,B = RECB ELSE OUT.LINE1,B = RECB,A To IF MV.COUNT1,B EQ 1 THEN OUT.LINE1,B = RECB ELSE OUT.LINE1,B = RECB,A -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: 16 October 2009 12:17 To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Now Date is converted, but multivalue ( C , R ) still missing. ,Jones, Bob,123 E. 23rdst.,Arvada,CO,80276,3037768854,V4341,04/24/94,D,7,R,6 ,Jones, Bob,123 E. 23rdSt.,Arvada,CO,80276,3037768854,V4341,04/24/94,D,7,R,6 ,Jones, Bob,123 E. 23rdSt.,Arvada,CO,80276,3037768854,V4341,04/24/94,D,7,R,6 Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, October 16, 2009 3:29 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Dattatraya, (Possible) correction added. You really need to take the time to understand the example code we're giving you. There will still be problems in the code below - for example, I can't see why the date conversion is failing or why (despite the uninit var) the C and R are missing. Really at this point you are in the best position to debug the program as you have the source data, which I'm having to guess the format of. Debugging - there's a proper debugger built into unidata but for quick and dirty checking, use CRT variable to display the contents of a variable to screen, and INPUT X,1 to have the program wait until you press a key - useful if you're displaying a lot of values and want to add a pause - for example after each record has been processed. Ed OPEN 'CUSTOMER' TO FIL ELSE STOP 201 'CUSTOMER' OPENSEQ 'OUTPUT.CSV' TO CSVFIL ELSE NULL WEOFSEQ CSVFIL SELECT FIL LOOP WHILE READNEXT ID DO READ REC FROM FIL,ID THEN * Count how many multivalues are in each attribute MV.COUNT = NUM.ATTRS = DCOUNT(REC,@AM) MV.COUNT = FOR A = 1 TO NUM.ATTRS MV.COUNT1,A = DCOUNT(RECA,@VM) NEXT A * And find the highest number MAX.MVS = MAXIMUM(MV.COUNT) * Convert specific attributes to date format. * Note the OCONVS handles multivalued data - it converts each value separately. REC9 = OCONVS(REC9,D2/) * Now output a line for each multivalue FOR A = 1 TO MAX.MVS OUT.LINE = FOR B = 1 TO NUM.ATTRS IF MV.COUNT1,A EQ 1 THEN OUT.LINE1,B = RECB ELSE OUT.LINE1,B = RECB,A NEXT B * Turn multivalues in the output line to commas *OUT.LINE = CHANGE(OUT.LINE,@VM,,) OUT.LINE = '' : CHANGE(CHANGE(OUT.LINE,@AM,','),@VM,',') : ',':ID * And write the line to the output file WRITESEQ OUT.LINE ON CSVFIL ELSE CRT 'CAN NOT EWRITE TO CSV FILE' * WRITESEQ OUT.LINE ... NEXT A END REPEAT ==End code :BASIC BP outfile Compiling Unibasic: BP/outfile in mode 'u'. compilation finished :RUN BP outfile In BP/_outfile at line 10 WARNING: UNINITIALIZED VARIABLE USED! Zero ssumed! : And output is :- ( Missing C,R in multivalve, date also not converted) Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, October 16, 2009 12:39 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Yes, and I've just spotted the first mistake - the last line should have been a couple of lines higher... * Count how many multivalues are in each attribute MV.COUNT = NUM.ATTRS = DCOUNT(REC,@AM) FOR A = 1 TO NUM.ATTRS MV.COUNT1,A = DCOUNT(RECA,@VM) NEXT A * And find the highest number MAX.MVS = MAXIMUM(MV.COUNT) * Convert specific attributes to date format. * Note the OCONVS handles multivalued data - it converts each value separately. REC9 = OCONVS(REC9,D2/) * Now output a line for each multivalue FOR A = 1 TO MAX.MVS OUT.LINE = FOR B = 1 TO NUM.ATTRS IF MV.COUNT1,A EQ 1 THEN OUT.LINE1,B = RECB ELSE OUT.LINE1,B = RECB,A NEXT B * Turn multivalues in the output line to commas OUT.LINE = CHANGE
Re: [U2] Unibasic: Sample program - to extract data from Table
Thousand thanks to you ED, Now output is:- Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,04/24/94,D,7,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,04/24/94,C,7,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,04/24/94,R,7,6 Frobisher, Kamal,P.O. Box 9845,Denver,CO,80209-,3037780880,,,K,33,204 Frobisher, Kamal,,Denver,CO,80209-,3037780880,,,O,33,204 Steven Spender,1212 W. 44th,Denver,CO,80401,30344578783,90 Jamieson, Dale,999 Independence Way,Seattle,WI,98733,,V6670,04/24/94,,8,12 Chase, Carl,12 W. Main,Kenosha,WI,53142,414666,V8481,04/20/94,,11,9 Chase, Carl,Suite 1414,Kenosha,WI,53142,414666,V1254,04/20/94,,11,9 Chase, Carl,,Kenosha,WI,53142,414666,V4951,04/21/94,,11,9 Wagner, Pat,403 S. Pennsylvania,Denver,CO,80209,3037222680,,,R,4,201 Wagner, Pat,First Floor,Denver,CO,80209,3037222680,,,S,4,201 Wagner, Pat,Deliveries to rear door,Denver,CO,80209,3037222680,,,H,4,201 Wagner, Esther,1455 30th Avenue,Kenosha,WI,53140,4145527433,,,M,5,210 Wagner, Esther,Woodcreek Condos,Kenosha,WI,53140,4145527433,,,T,5,210 Wagner, Esther,,Kenosha,WI,53140,4145527433,,,P,5,210 Wagner, Esther,,Kenosha,WI,53140,4145527433,,,K,5,210 Wagner, Esther,,Kenosha,WI,53140,4145527433,,,B,5,210 Thanks Regards, Dattatraya Walgude DBA Team Rsystems International Ltd, Pune, ( : +91-20-22909212 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, October 16, 2009 4:49 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Try changing IF MV.COUNT1,A EQ 1 THEN OUT.LINE1,B = RECB ELSE OUT.LINE1,B = RECB,A To IF MV.COUNT1,B EQ 1 THEN OUT.LINE1,B = RECB ELSE OUT.LINE1,B = RECB,A -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: 16 October 2009 12:17 To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Now Date is converted, but multivalue ( C , R ) still missing. ,Jones, Bob,123 E. 23rdst.,Arvada,CO,80276,3037768854,V4341,04/24/94,D,7,R,6 ,Jones, Bob,123 E. 23rdSt.,Arvada,CO,80276,3037768854,V4341,04/24/94,D,7,R,6 ,Jones, Bob,123 E. 23rdSt.,Arvada,CO,80276,3037768854,V4341,04/24/94,D,7,R,6 Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, October 16, 2009 3:29 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Dattatraya, (Possible) correction added. You really need to take the time to understand the example code we're giving you. There will still be problems in the code below - for example, I can't see why the date conversion is failing or why (despite the uninit var) the C and R are missing. Really at this point you are in the best position to debug the program as you have the source data, which I'm having to guess the format of. Debugging - there's a proper debugger built into unidata but for quick and dirty checking, use CRT variable to display the contents of a variable to screen, and INPUT X,1 to have the program wait until you press a key - useful if you're displaying a lot of values and want to add a pause - for example after each record has been processed. Ed OPEN 'CUSTOMER' TO FIL ELSE STOP 201 'CUSTOMER' OPENSEQ 'OUTPUT.CSV' TO CSVFIL ELSE NULL WEOFSEQ CSVFIL SELECT FIL LOOP WHILE READNEXT ID DO READ REC FROM FIL,ID THEN * Count how many multivalues are in each attribute MV.COUNT = NUM.ATTRS = DCOUNT(REC,@AM) MV.COUNT = FOR A = 1 TO NUM.ATTRS MV.COUNT1,A = DCOUNT(RECA,@VM) NEXT A * And find the highest number MAX.MVS = MAXIMUM(MV.COUNT) * Convert specific attributes to date format. * Note the OCONVS handles multivalued data - it converts each value separately. REC9 = OCONVS(REC9,D2/) * Now output a line for each multivalue FOR A = 1 TO MAX.MVS OUT.LINE = FOR B = 1 TO NUM.ATTRS IF MV.COUNT1,A EQ 1 THEN OUT.LINE1,B = RECB ELSE OUT.LINE1,B = RECB,A NEXT B * Turn multivalues in the output line to commas *OUT.LINE = CHANGE(OUT.LINE,@VM,,) OUT.LINE = '' : CHANGE(CHANGE(OUT.LINE,@AM,','),@VM,',') : ',':ID * And write the line to the output file WRITESEQ OUT.LINE ON CSVFIL ELSE CRT 'CAN NOT EWRITE TO CSV FILE' * WRITESEQ OUT.LINE ... NEXT A END REPEAT ==End code :BASIC BP outfile Compiling Unibasic: BP/outfile in mode 'u'. compilation finished :RUN BP outfile In BP/_outfile at line 10 WARNING: UNINITIALIZED VARIABLE USED! Zero ssumed! : And output is :- ( Missing C,R in multivalve, date also not converted) Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,R,6 Thanks Regards
Re: [U2] Unibasic: Sample program - to extract data from Table
Sorry Symeon and all for asking such silly question. I manage @ID column in output.csv in following way, now I want multivalue columns in new lines with all columns (now its comes in one row/line) LINE = '' : CHANGE(CHANGE(REC,@AM,','),@VM,',') : ',':ID Thanks Regards, Dattatraya Walgude DBA Team -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Doug Sent: Tuesday, October 13, 2009 1:12 AM To: 'U2 Users List' Subject: Re: [U2] Unibasic: Sample program - to extract data from Table This data is obviously from an company that deals with a Colorado data or is based in Colorado. And you are from outsource product develop company in India that has been tasked to work on this U2 system. So...We have some programmers that know U2 that need more work... So...Why are we teaching the competition?... So...They are probably only charging 10 to 20 per hour... So...We are charging a lot more per hour which is why we are not doing the work... A discussion for a different time, so maybe my next blog. Regards, Doug www.u2logic.com -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: Monday, October 12, 2009 7:24 AM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Thanks for your support. We get output of multivalve columns. Only things is we can not get out of DATE column is date format. So please give your suggestions. JonesBob123 E. 23rd St. Arvada CO 80276 3037768854 V4341 9611D C R 7 FrobisherKamal P.O. Box 9845 Denver CO 80209- 3037780880 K O 33 Steven Spender 1212 W. 44thDenver CO 80401 3034457878 3 Jamieson Dale 999 Independence WaySeattle WI 98733 V6670 96118 One more query @ID column is missing in output.csv, please suggest how to get that @ID column in output.csv. Regards Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: 12 October 2009 12:58 To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Output is not readable:- 14334ýITOý0ýAýý16811,14334ýCHAý CHA to Risk Rate: Mass_Aýýý16811 14369ýITOý0ýAýý61491,14369ýCHAý CHA to Risk Rate: Ten7_Aýýý61491 13977ýITAýýAýý60625 15030ýITOý0ýAýý70410,15030ýMEMý1ýPayment Responsibility ChangedýýFrom To N On 23-02-09ýýAýý70410,15030ýITAýýAýý70410 13973ýITAýýAýý38781,13973ýCHAý CHA to Risk Rate: MASS_Aýýý38781 15142ýITOý0ýAýý40128,15142ýMEMý1ýPayment Responsibility ChangedýýFrom To Y On 15-06-09ýýAýý40129 14369ýITOý0ýAýý64849,15263ýWKLýDC 040ýQueue 888Aýý47136 13910ýWKLýDC 040ýQueue 6AEAýý2898,13910ýSAPý13910ý6RE1ý1ý60+DAY EA ROUTE 1ýQ6AEýAýý7858,13910ýSUSýFailed ValidationýýýWITH SIXTYD.ABOVE.AMT.OVRD GE 10.00 ý6RE1ýAýý14692,13911ýAOWýFrom BF01G013ýTo BF01G162ý6EQ.01ýQUEUE-SPLITTERýýAýý15360,13911ýWKLýDC 040ýQueue 6EQ.03ýýQUEUE-SPLITTERýýAýý15360,13942ý WKLýDC 040ýQueue 6AEAýý5421,13942ýSAPý13942ý6RE1ý1ý60+DAY EA ROUTE 1ýQ6AEýAýý9757,13942ýSUSýFailed ValidationýýýWITH SIXTYD.ABOVE.AMT.OVRD GE 10.00 ý Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: Monday, October 12, 2009 5:02 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Many Many Thanks Edward and Symeon Its work... Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Monday, October 12, 2009 4:55 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table ELSE NULL Will work. Syntax for all these commands is in BASR.PDF, downloadable from web for free... Edward -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: 12 October 2009 12:22 To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Thanks Symeon I have created one program file (outfile ) with followinf contents Facing compilation error OPEN 'CUSTOMER' TO FIL ELSE STOP 201 'CUSTOMER' OPENSEQ 'OUTPUT.CSV' TO CSVFIL WEOFSEQ CSVFIL SELECT FIL LOOP WHILE READNEXT ID DO READ REC FROM FIL,ID THEN LINE = '' : CHANGE(CHANGE(REC,@AM,','),@SVM,',') : '' WRITESEQ LINE ON CSVFIL ELSE CRT 'CAN NOT EWRITE TO CSV FILE' END REPEAT
Re: [U2] Unibasic: Sample program - to extract data from Table
Thanks Jeff Sure, but right now preparing some basics concepts. Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Jeff Powell Sent: Thursday, October 15, 2009 5:42 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Dattatraya, Are you interested in getting training in UniData and SBClient? If so there are people (not me) on this list who have online training courses. If you are interested please let us know and I'm sure you'll get some recommendations. Jeff On 10/15/2009 12:59 AM, Dattatraya Walgude wrote: Sorry Symeon and all for asking such silly question. I manage @ID column in output.csv in following way, now I want multivalue columns in new lines with all columns (now its comes in one row/line) LINE = '' : CHANGE(CHANGE(REC,@AM,','),@VM,',') : ',':ID Thanks Regards, Dattatraya Walgude DBA Team -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Doug Sent: Tuesday, October 13, 2009 1:12 AM To: 'U2 Users List' Subject: Re: [U2] Unibasic: Sample program - to extract data from Table This data is obviously from an company that deals with a Colorado data or is based in Colorado. And you are from outsource product develop company in India that has been tasked to work on this U2 system. So...We have some programmers that know U2 that need more work... So...Why are we teaching the competition?... So...They are probably only charging 10 to 20 per hour... So...We are charging a lot more per hour which is why we are not doing the work... A discussion for a different time, so maybe my next blog. Regards, Doug www.u2logic.com -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: Monday, October 12, 2009 7:24 AM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Thanks for your support. We get output of multivalve columns. Only things is we can not get out of DATE column is date format. So please give your suggestions. Jones Bob123 E. 23rd St. Arvada CO 80276 3037768854 V4341 9611D C R 7 Frobisher Kamal P.O. Box 9845 Denver CO 80209- 3037780880K O 33 Steven Spender1212 W. 44thDenver CO 80401 3034457878 3 Jamieson Dale 999 Independence WaySeattle WI 98733 V6670 96118 One more query @ID column is missing in output.csv, please suggest how to get that @ID column in output.csv. Regards Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: 12 October 2009 12:58 To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Output is not readable:- 14334ýITOý0ýAýý16811,14334ýCHAý CHA to Risk Rate: Mass_Aýýý16811 14369ýITOý0ýAýý61491,14369ýCHAý CHA to Risk Rate: Ten7_Aýýý61491 13977ýITAýýAýý60625 15030ýITOý0ýAýý70410,15030ýMEMý1ýPayment Responsibility ChangedýýFrom To N On 23-02-09ýýAýý70410,15030ýITAýýAýý70410 13973ýITAýýAýý38781,13973ýCHAý CHA to Risk Rate: MASS_Aýýý38781 15142ýITOý0ýAýý40128,15142ýMEMý1ýPayment Responsibility ChangedýýFrom To Y On 15-06-09ýýAýý40129 14369ýITOý0ýAýý64849,15263ýWKLýDC 040ýQueue 888Aýý47136 13910ýWKLýDC 040ýQueue 6AEAýý2898,13910ýSAPý13910ý6RE1ý1ý60+DAY EA ROUTE 1ýQ6AEýAýý7858,13910ýSUSýFailed ValidationýýýWITH SIXTYD.ABOVE.AMT.OVRD GE 10.00 ý6RE1ýAýý14692,13911ýAOWýFrom BF01G013ýTo BF01G162ý6EQ.01ýQUEUE-SPLITTERýýAýý15360,13911ýWKLýDC 040ýQueue 6EQ.03ýýQUEUE-SPLITTERýýAýý15360,13942ý WKLýDC 040ýQueue 6AEAýý5421,13942ýSAPý13942ý6RE1ý1ý60+DAY EA ROUTE 1ýQ6AEýAýý9757,13942ýSUSýFailed ValidationýýýWITH SIXTYD.ABOVE.AMT.OVRD GE 10.00 ý Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: Monday, October 12, 2009 5:02 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Many Many Thanks Edward and Symeon Its work... Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Monday, October 12, 2009 4:55 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table ELSE NULL
Re: [U2] Unibasic: Sample program - to extract data from Table
Many Thanks George Now output is giving following way Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D C R,7,6 Frobisher, Kamal,P.O. Box 9845 ,Denver,CO,80209-,3037780880,,,K O,33,204 But I want following way ( D,C,R are multivalue ) , date output also showing 9611 which is (04/24/94) is it possible? Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,D,7,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,C,7,6 Jones, Bob,123 E. 23rd St.,Arvada,CO,80276,3037768854,V4341,9611,R,7,6 Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen Sent: Thursday, October 15, 2009 6:54 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Try first starting with: LINE = '' : CHANGE(CHANGE(REC,@AM,','),@VM,CHAR(10)) : ',':ID I think that the LF character might give you want you want George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: Thursday, October 15, 2009 1:59 AM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Sorry Symeon and all for asking such silly question. I manage @ID column in output.csv in following way, now I want multivalue columns in new lines with all columns (now its comes in one row/line) LINE = '' : CHANGE(CHANGE(REC,@AM,','),@VM,',') : ',':ID Thanks Regards, Dattatraya Walgude DBA Team ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users Disclaimer * This mail, including any attachments contains confidential and privileged information for the sole use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and are unlawful. This e-mail may contain viruses. R Systems International Limited has taken every reasonable precaution to minimize this risk. R Systems International Limited is not liable for any damage you may sustain as a result of any virus in this e-mail. Before opening the e-mail or attachment, You should carry out your own virus checks. R Systems International Limited reserves the right to record, monitor, and inspect all email communications through its internal and external networks. R Systems International Ltd prohibits its information systems from being used to view, store or forward offensive or discriminatory material. End of Disclaimer ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Unibasic: Sample program - to extract data from Table
Thanks Symeon I have created one program file (outfile ) with followinf contents Facing compilation error OPEN 'CUSTOMER' TO FIL ELSE STOP 201 'CUSTOMER' OPENSEQ 'OUTPUT.CSV' TO CSVFIL WEOFSEQ CSVFIL SELECT FIL LOOP WHILE READNEXT ID DO READ REC FROM FIL,ID THEN LINE = '' : CHANGE(CHANGE(REC,@AM,','),@SVM,',') : '' WRITESEQ LINE ON CSVFIL ELSE CRT 'CAN NOT EWRITE TO CSV FILE' END REPEAT Facing compilation error :BASIC BP outfile Compiling Unibasic: BP/outfile in mode 'u'. main program: syntax error at or before line 2 OPENSEQ 'OUTPUT.CSV' TO CSVFIL --^ Expecting: ELSE compilation failed Thanks Regards, Dattatraya Walgude DBA Team Rsystems International Ltd, Pune, ( : +91-20-22909212 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Symeon Breen Sent: Monday, October 12, 2009 4:28 PM To: 'U2 Users List' Subject: Re: [U2] Unibasic: Sample program - to extract data from Table The big question is extract to what ? csv ? xml ? another data table ? Here is a very quick simple extract to a csv - this is just off the top of my head so i have not compiled it or tested it. OPEN 'FILE' TO FIL ESLE STOP 201,'FILE' OPENSEQ 'OUTPUT.CSV' TO CSVFIL WEOFSEQ CSVFIL SELECT FIL LOOP WHILE READNEXT ID DO READ REC FROM FIL,ID THEN LINE = '' : CHANGE(CHANGE(REC,@AM,','),@SVM,',') : '' WRITESEQ LINE ON CSVFIL ELSE CRT 'CAN NOT EWRITE TO CSV FILE' END REPEAT Rgds Symeon. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: 12 October 2009 06:14 To: u2-users@listserver.u2ug.org Subject: [U2] Unibasic: Sample program - to extract data from Table Dear All I am new in Unidata/Unibasic, I want a sample program to extract data from one of our big history table. Kindly give me any link/ suggestion. Thanks Regards, Dattatraya Walgude Disclaimer * This mail, including any attachments contains confidential and privileged information for the sole use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and are unlawful. This e-mail may contain viruses. R Systems International Limited has taken every reasonable precaution to minimize this risk. R Systems International Limited is not liable for any damage you may sustain as a result of any virus in this e-mail. Before opening the e-mail or attachment, You should carry out your own virus checks. R Systems International Limited reserves the right to record, monitor, and inspect all email communications through its internal and external networks. R Systems International Ltd prohibits its information systems from being used to view, store or forward offensive or discriminatory material. End of Disclaimer ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Unibasic: Sample program - to extract data from Table
Many Many Thanks Edward and Symeon Its work... Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Monday, October 12, 2009 4:55 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table ELSE NULL Will work. Syntax for all these commands is in BASR.PDF, downloadable from web for free... Edward -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: 12 October 2009 12:22 To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Thanks Symeon I have created one program file (outfile ) with followinf contents Facing compilation error OPEN 'CUSTOMER' TO FIL ELSE STOP 201 'CUSTOMER' OPENSEQ 'OUTPUT.CSV' TO CSVFIL WEOFSEQ CSVFIL SELECT FIL LOOP WHILE READNEXT ID DO READ REC FROM FIL,ID THEN LINE = '' : CHANGE(CHANGE(REC,@AM,','),@SVM,',') : '' WRITESEQ LINE ON CSVFIL ELSE CRT 'CAN NOT EWRITE TO CSV FILE' END REPEAT Facing compilation error :BASIC BP outfile Compiling Unibasic: BP/outfile in mode 'u'. main program: syntax error at or before line 2 OPENSEQ 'OUTPUT.CSV' TO CSVFIL --^ Expecting: ELSE compilation failed Thanks Regards, Dattatraya Walgude DBA Team Rsystems International Ltd, Pune, ( : +91-20-22909212 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Symeon Breen Sent: Monday, October 12, 2009 4:28 PM To: 'U2 Users List' Subject: Re: [U2] Unibasic: Sample program - to extract data from Table The big question is extract to what ? csv ? xml ? another data table ? Here is a very quick simple extract to a csv - this is just off the top of my head so i have not compiled it or tested it. OPEN 'FILE' TO FIL ESLE STOP 201,'FILE' OPENSEQ 'OUTPUT.CSV' TO CSVFIL WEOFSEQ CSVFIL SELECT FIL LOOP WHILE READNEXT ID DO READ REC FROM FIL,ID THEN LINE = '' : CHANGE(CHANGE(REC,@AM,','),@SVM,',') : '' WRITESEQ LINE ON CSVFIL ELSE CRT 'CAN NOT EWRITE TO CSV FILE' END REPEAT Rgds Symeon. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: 12 October 2009 06:14 To: u2-users@listserver.u2ug.org Subject: [U2] Unibasic: Sample program - to extract data from Table Dear All I am new in Unidata/Unibasic, I want a sample program to extract data from one of our big history table. Kindly give me any link/ suggestion. Thanks Regards, Dattatraya Walgude Disclaimer * This mail, including any attachments contains confidential and privileged information for the sole use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and are unlawful. This e-mail may contain viruses. R Systems International Limited has taken every reasonable precaution to minimize this risk. R Systems International Limited is not liable for any damage you may sustain as a result of any virus in this e-mail. Before opening the e-mail or attachment, You should carry out your own virus checks. R Systems International Limited reserves the right to record, monitor, and inspect all email communications through its internal and external networks. R Systems International Ltd prohibits its information systems from being used to view, store or forward offensive or discriminatory material. End of Disclaimer ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users --- Please remember to recycle wherever possible. Reduce, reuse, recycle, think do you need to print this e-mail? --- This e-mail and any attachment(s), is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the addressee, dissemination
Re: [U2] Unibasic: Sample program - to extract data from Table
Output is not readable:- 14334ýITOý0ýAýý16811,14334ýCHAý CHA to Risk Rate: Mass_Aýýý16811 14369ýITOý0ýAýý61491,14369ýCHAý CHA to Risk Rate: Ten7_Aýýý61491 13977ýITAýýAýý60625 15030ýITOý0ýAýý70410,15030ýMEMý1ýPayment Responsibility ChangedýýFrom To N On 23-02-09ýýAýý70410,15030ýITAýýAýý70410 13973ýITAýýAýý38781,13973ýCHAý CHA to Risk Rate: MASS_Aýýý38781 15142ýITOý0ýAýý40128,15142ýMEMý1ýPayment Responsibility ChangedýýFrom To Y On 15-06-09ýýAýý40129 14369ýITOý0ýAýý64849,15263ýWKLýDC 040ýQueue 888Aýý47136 13910ýWKLýDC 040ýQueue 6AEAýý2898,13910ýSAPý13910ý6RE1ý1ý60+DAY EA ROUTE 1ýQ6AEýAýý7858,13910ýSUSýFailed ValidationýýýWITH SIXTYD.ABOVE.AMT.OVRD GE 10.00 ý6RE1ýAýý14692,13911ýAOWýFrom BF01G013ýTo BF01G162ý6EQ.01ýQUEUE-SPLITTERýýAýý15360,13911ýWKLýDC 040ýQueue 6EQ.03ýýQUEUE-SPLITTERýýAýý15360,13942ý WKLýDC 040ýQueue 6AEAýý5421,13942ýSAPý13942ý6RE1ý1ý60+DAY EA ROUTE 1ýQ6AEýAýý9757,13942ýSUSýFailed ValidationýýýWITH SIXTYD.ABOVE.AMT.OVRD GE 10.00 ý Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: Monday, October 12, 2009 5:02 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Many Many Thanks Edward and Symeon Its work... Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Monday, October 12, 2009 4:55 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table ELSE NULL Will work. Syntax for all these commands is in BASR.PDF, downloadable from web for free... Edward -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: 12 October 2009 12:22 To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Thanks Symeon I have created one program file (outfile ) with followinf contents Facing compilation error OPEN 'CUSTOMER' TO FIL ELSE STOP 201 'CUSTOMER' OPENSEQ 'OUTPUT.CSV' TO CSVFIL WEOFSEQ CSVFIL SELECT FIL LOOP WHILE READNEXT ID DO READ REC FROM FIL,ID THEN LINE = '' : CHANGE(CHANGE(REC,@AM,','),@SVM,',') : '' WRITESEQ LINE ON CSVFIL ELSE CRT 'CAN NOT EWRITE TO CSV FILE' END REPEAT Facing compilation error :BASIC BP outfile Compiling Unibasic: BP/outfile in mode 'u'. main program: syntax error at or before line 2 OPENSEQ 'OUTPUT.CSV' TO CSVFIL --^ Expecting: ELSE compilation failed Thanks Regards, Dattatraya Walgude DBA Team Rsystems International Ltd, Pune, ( : +91-20-22909212 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Symeon Breen Sent: Monday, October 12, 2009 4:28 PM To: 'U2 Users List' Subject: Re: [U2] Unibasic: Sample program - to extract data from Table The big question is extract to what ? csv ? xml ? another data table ? Here is a very quick simple extract to a csv - this is just off the top of my head so i have not compiled it or tested it. OPEN 'FILE' TO FIL ESLE STOP 201,'FILE' OPENSEQ 'OUTPUT.CSV' TO CSVFIL WEOFSEQ CSVFIL SELECT FIL LOOP WHILE READNEXT ID DO READ REC FROM FIL,ID THEN LINE = '' : CHANGE(CHANGE(REC,@AM,','),@SVM,',') : '' WRITESEQ LINE ON CSVFIL ELSE CRT 'CAN NOT EWRITE TO CSV FILE' END REPEAT Rgds Symeon. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: 12 October 2009 06:14 To: u2-users@listserver.u2ug.org Subject: [U2] Unibasic: Sample program - to extract data from Table Dear All I am new in Unidata/Unibasic, I want a sample program to extract data from one of our big history table. Kindly give me any link/ suggestion. Thanks Regards, Dattatraya Walgude Disclaimer * This mail, including any attachments contains confidential and privileged information for the sole use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and are unlawful. This e-mail may contain viruses. R Systems International Limited has taken every reasonable precaution to minimize this risk. R Systems International Limited is not liable for any damage you may sustain as a result of any virus in this e-mail. Before opening the e-mail
Re: [U2] Unibasic: Sample program - to extract data from Table
Thanks for your support. We get output of multivalve columns. Only things is we can not get out of DATE column is date format. So please give your suggestions. JonesBob123 E. 23rd St. Arvada CO 80276 3037768854 V4341 9611D C R 7 FrobisherKamal P.O. Box 9845 Denver CO 80209- 3037780880 K O 33 Steven Spender 1212 W. 44thDenver CO 80401 3034457878 3 Jamieson Dale 999 Independence WaySeattle WI 98733 V6670 96118 One more query @ID column is missing in output.csv, please suggest how to get that @ID column in output.csv. Regards Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Symeon Breen Sent: Monday, October 12, 2009 6:13 PM To: 'U2 Users List' Subject: Re: [U2] Unibasic: Sample program - to extract data from Table The code is just an example to get you started - i suggest you read the manual or get on a course etc to understand better the data model and language. There are numerous things you can do to extend this program, you will need to ensure there are no in the data, the example is changing sub values to be comma delimited lists, again you will need to ensure there are no commas in the data - or you may want to normalise and produce a row in the csv per multi value, or perhaps if the multivalues are not an array of associated data but individual pieces of data you could split them to multiple columns, This very much depends on the structure of the data and what you are trying to achieve with it. To fix the below funny characters replace @SVM with @VM If you do have sub values in your data you may need to do some further conversions etc Rgds Symeon -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: 12 October 2009 12:58 To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Output is not readable:- 14334ýITOý0ýAýý16811,14334ýCHAý CHA to Risk Rate: Mass_Aýýý16811 14369ýITOý0ýAýý61491,14369ýCHAý CHA to Risk Rate: Ten7_Aýýý61491 13977ýITAýýAýý60625 15030ýITOý0ýAýý70410,15030ýMEMý1ýPayment Responsibility ChangedýýFrom To N On 23-02-09ýýAýý70410,15030ýITAýýAýý70410 13973ýITAýýAýý38781,13973ýCHAý CHA to Risk Rate: MASS_Aýýý38781 15142ýITOý0ýAýý40128,15142ýMEMý1ýPayment Responsibility ChangedýýFrom To Y On 15-06-09ýýAýý40129 14369ýITOý0ýAýý64849,15263ýWKLýDC 040ýQueue 888Aýý47136 13910ýWKLýDC 040ýQueue 6AEAýý2898,13910ýSAPý13910ý6RE1ý1ý60+DAY EA ROUTE 1ýQ6AEýAýý7858,13910ýSUSýFailed ValidationýýýWITH SIXTYD.ABOVE.AMT.OVRD GE 10.00 ý6RE1ýAýý14692,13911ýAOWýFrom BF01G013ýTo BF01G162ý6EQ.01ýQUEUE-SPLITTERýýAýý15360,13911ýWKLýDC 040ýQueue 6EQ.03ýýQUEUE-SPLITTERýýAýý15360,13942ý WKLýDC 040ýQueue 6AEAýý5421,13942ýSAPý13942ý6RE1ý1ý60+DAY EA ROUTE 1ýQ6AEýAýý9757,13942ýSUSýFailed ValidationýýýWITH SIXTYD.ABOVE.AMT.OVRD GE 10.00 ý Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: Monday, October 12, 2009 5:02 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Many Many Thanks Edward and Symeon Its work... Thanks Regards, Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Monday, October 12, 2009 4:55 PM To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table ELSE NULL Will work. Syntax for all these commands is in BASR.PDF, downloadable from web for free... Edward -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dattatraya Walgude Sent: 12 October 2009 12:22 To: U2 Users List Subject: Re: [U2] Unibasic: Sample program - to extract data from Table Thanks Symeon I have created one program file (outfile ) with followinf contents Facing compilation error OPEN 'CUSTOMER' TO FIL ELSE STOP 201 'CUSTOMER' OPENSEQ 'OUTPUT.CSV' TO CSVFIL WEOFSEQ CSVFIL SELECT FIL LOOP WHILE READNEXT ID DO READ REC FROM FIL,ID THEN LINE = '' : CHANGE(CHANGE(REC,@AM,','),@SVM,',') : '' WRITESEQ LINE ON CSVFIL ELSE CRT 'CAN NOT EWRITE TO CSV FILE' END REPEAT Facing compilation error :BASIC BP outfile Compiling Unibasic: BP/outfile in mode 'u'. main program: syntax error at or before line 2 OPENSEQ 'OUTPUT.CSV' TO CSVFIL
[U2] Unibasic: Sample program - to extract data from Table
Dear All I am new in Unidata/Unibasic, I want a sample program to extract data from one of our big history table. Kindly give me any link/ suggestion. Thanks Regards, Dattatraya Walgude Disclaimer * This mail, including any attachments contains confidential and privileged information for the sole use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and are unlawful. This e-mail may contain viruses. R Systems International Limited has taken every reasonable precaution to minimize this risk. R Systems International Limited is not liable for any damage you may sustain as a result of any virus in this e-mail. Before opening the e-mail or attachment, You should carry out your own virus checks. R Systems International Limited reserves the right to record, monitor, and inspect all email communications through its internal and external networks. R Systems International Ltd prohibits its information systems from being used to view, store or forward offensive or discriminatory material. End of Disclaimer ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
[U2] How to check data dictionary?
Dear ALL We are working on UNIDATA version 6 and we need your guide line. One of the table is having many multivalve columns but by LISTDICT I can not see. These columns have data but vendor program is showing all columns data. As I do not know column name then let me know how to see the other columns? May I need to update dictionary to table to see column name or suggest any other ways By LISTDICT I can not see all column names. My questions are:- 1) How to check data dictionary? 2) How to select / extract data form this tables ( for all columns like oracle select * from )? 3) How to remove extra space from column ( like oracle Trim() ) Your suggestions are most well-come and waiting for your positive reply. Regards Dattatraya Thanks Regards, Dattatraya Walgude DBA Team Rsystems International Ltd, Pune, * : +91-20-22909212 Disclaimer * This mail, including any attachments contains confidential and privileged information for the sole use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and are unlawful. This e-mail may contain viruses. R Systems International Limited has taken every reasonable precaution to minimize this risk. R Systems International Limited is not liable for any damage you may sustain as a result of any virus in this e-mail. Before opening the e-mail or attachment, You should carry out your own virus checks. R Systems International Limited reserves the right to record, monitor, and inspect all email communications through its internal and external networks. R Systems International Ltd prohibits its information systems from being used to view, store or forward offensive or discriminatory material. End of Disclaimer ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] How to check data dictionary?
The following command is not showing all data columns. LIST filename ALL The LISTDICT filename - Not showing all column names Now, from one of the filename, I have to extract data from hidden 3 columns which I can not see the names of column. Requesting you to suggest me in such cases how to extract/see data. I will be thankful to you, if you provide me all steps in details. This is urgent matter my work is stuck. Thanks in advance. Dattatraya Walgude -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen Sent: Tuesday, October 06, 2009 10:47 PM To: U2 Users List Subject: Re: [U2] How to check data dictionary? I think he is getting caught with a file that doesn't have a very well defined DICT file, whereas with SQL You can't really add anything to a table without being able to see a description of it. Life in UV is not like life in SQL. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of Norman Bauer Sent: Tuesday, October 06, 2009 12:41 PM To: U2 Users List Subject: Re: [U2] How to check data dictionary? Along the lines of what David suggested, I would also recoment reading the System Description PDF that is provided in the documentation as well as the Guide to Retrieve. I am not sure exactly what you are asking, but the only way that I know of to check the dictionary (in UniVerse, not sure about UniData) is: LIST.DICT filename Which will give you all the information on what data is stored in the file as well as information of I-Descriptors, which are virtual fields and I suspect that is what has you hung up. The Systems Description guide goes into detail about I-Descriptors as well. Norm On Tue, Oct 6, 2009 at 3:42 AM, Dattatraya Walgude dattatraya.walg...@rsystems.com wrote: Dear ALL We are working on UNIDATA version 6 and we need your guide line. One of the table is having many multivalve columns but by LISTDICT I can not see. These columns have data but vendor program is showing all columns data. As I do not know column name then let me know how to see the other columns? May I need to update dictionary to table to see column name or suggest any other ways By LISTDICT I can not see all column names. My questions are:- 1) How to check data dictionary? 2) How to select / extract data form this tables ( for all columns like oracle select * from )? 3) How to remove extra space from column ( like oracle Trim() ) Your suggestions are most well-come and waiting for your positive reply. Regards Dattatraya Thanks Regards, Dattatraya Walgude DBA Team Rsystems International Ltd, Pune, * : +91-20-22909212 Disclaimer * This mail, including any attachments contains confidential and privileged information for the sole use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and are unlawful. This e-mail may contain viruses. R Systems International Limited has taken every reasonable precaution to minimize this risk. R Systems International Limited is not liable for any damage you may sustain as a result of any virus in this e-mail. Before opening the e-mail or attachment, You should carry out your own virus checks. R Systems International Limited reserves the right to record, monitor, and inspect all email communications through its internal and external networks. R Systems International Ltd prohibits its information systems from being used to view, store or forward offensive or discriminatory material. End of Disclaimer ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users