[U2] An interesting find....
Here is an interesting tidbit I happened to run across. PROGRAM A: OPEN ,FILE1 TO F.FILE1 ELSE STOP NO FILE1 OPEN ,FILE2 TO F.FILE2 ELSE STOP NO FILE2 * F.FILETOUSE = F.FILE1 (Adding this here will get rid of the compile warning) BEGIN CASE CASE X=1 F.FILETOUSE = F.FILE1 CASE X=2 F.FILETOUSE = F.FILE2 CASE -1 F.FILETOUSE = F.FILE1 END CASE READ XDATA FROM F.FILETOUSE,TEST ELSE XDATA= The above program when compiled says F.FILETOUSE never assigned a value and when it executes, gives an improper file type error HOWEVER: PROGRAM B: OPEN ,FILE1 TO F.FILE1 ELSE STOP NO FILE1 OPEN ,FILE2 TO F.FILE2 ELSE STOP NO FILE2 F.FILETOUSE=F.FILE1 IF X=1 THEN F.FILETOUSE = F.FILE1 IF X=2 THEN F.FILETOUSE = F.FILE2 READ XDATA FROM F.FILETOUSE,TEST ELSE XDATA= Compiles and run just fine, no errors. This is using UV 10.0.2 under the Prime Information flavor George Gallen Senior Programmer/Analyst Accounting/Data Division, EDI Administrator ggal...@wyanokegroup.com ph:856.848.9005 Ext 220 The Wyanoke Group http://www.wyanokegroup.com ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] An interesting find....
Instead of CASE -1 use CASE 1 -- From: George Gallen ggal...@wyanokegroup.com Sent: Tuesday, December 15, 2009 1:23 PM To: U2 Users List u2-users@listserver.u2ug.org Subject: [U2] An interesting find Here is an interesting tidbit I happened to run across. PROGRAM A: OPEN ,FILE1 TO F.FILE1 ELSE STOP NO FILE1 OPEN ,FILE2 TO F.FILE2 ELSE STOP NO FILE2 * F.FILETOUSE = F.FILE1 (Adding this here will get rid of the compile warning) BEGIN CASE CASE X=1 F.FILETOUSE = F.FILE1 CASE X=2 F.FILETOUSE = F.FILE2 CASE -1 F.FILETOUSE = F.FILE1 END CASE READ XDATA FROM F.FILETOUSE,TEST ELSE XDATA= The above program when compiled says F.FILETOUSE never assigned a value and when it executes, gives an improper file type error HOWEVER: PROGRAM B: OPEN ,FILE1 TO F.FILE1 ELSE STOP NO FILE1 OPEN ,FILE2 TO F.FILE2 ELSE STOP NO FILE2 F.FILETOUSE=F.FILE1 IF X=1 THEN F.FILETOUSE = F.FILE1 IF X=2 THEN F.FILETOUSE = F.FILE2 READ XDATA FROM F.FILETOUSE,TEST ELSE XDATA= Compiles and run just fine, no errors. This is using UV 10.0.2 under the Prime Information flavor George Gallen Senior Programmer/Analyst Accounting/Data Division, EDI Administrator ggal...@wyanokegroup.com ph:856.848.9005 Ext 220 The Wyanoke Group http://www.wyanokegroup.com ___ 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] An interesting find....
they both function the same (1 or -1) doesn't matter, at least with UV. But, either one, still give the same improper data type. I find it interesting that when assigned within a case structure it doesn't work but when assigned within an if-then structure it does work it being able to assign a varible to an FCB variable George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of JPB-U2UG Sent: Tuesday, December 15, 2009 2:53 PM To: U2 Users List Subject: Re: [U2] An interesting find Instead of CASE -1 use CASE 1 -- ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] An interesting find....
Where does X get assigned in Program A? (Actually, in program B as well...) Just curious... Susan Lynch F . W. Davison Company, Inc. - Original Message - From: George Gallen ggal...@wyanokegroup.com To: U2 Users List u2-users@listserver.u2ug.org Sent: 12/15/2009 2:23 PM Subject: [U2] An interesting find Here is an interesting tidbit I happened to run across. PROGRAM A: OPEN ,FILE1 TO F.FILE1 ELSE STOP NO FILE1 OPEN ,FILE2 TO F.FILE2 ELSE STOP NO FILE2 * F.FILETOUSE = F.FILE1 (Adding this here will get rid of the compile warning) BEGIN CASE CASE X=1 F.FILETOUSE = F.FILE1 CASE X=2 F.FILETOUSE = F.FILE2 CASE -1 F.FILETOUSE = F.FILE1 END CASE READ XDATA FROM F.FILETOUSE,TEST ELSE XDATA= The above program when compiled says F.FILETOUSE never assigned a value and when it executes, gives an improper file type error HOWEVER: PROGRAM B: OPEN ,FILE1 TO F.FILE1 ELSE STOP NO FILE1 OPEN ,FILE2 TO F.FILE2 ELSE STOP NO FILE2 F.FILETOUSE=F.FILE1 IF X=1 THEN F.FILETOUSE = F.FILE1 IF X=2 THEN F.FILETOUSE = F.FILE2 READ XDATA FROM F.FILETOUSE,TEST ELSE XDATA= Compiles and run just fine, no errors. This is using UV 10.0.2 under the Prime Information flavor George Gallen Senior Programmer/Analyst Accounting/Data Division, EDI Administrator ggal...@wyanokegroup.com ph:856.848.9005 Ext 220 The Wyanoke Group http://www.wyanokegroup.com ___ 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] An interesting find....
Sorry, typo. I Had X=1 after the OPENS in the original program next time, I'll use cut and paste :) -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of Susan Lynch Sent: Tuesday, December 15, 2009 3:02 PM To: U2 Users List Subject: Re: [U2] An interesting find Where does X get assigned in Program A? (Actually, in program B as well...) Just curious... Susan Lynch F . W. Davison Company, Inc. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] An interesting find....
In your example, the line: CASE X=1 F.FILETOUSE = F.FILE1 should be CASE X=1; F.FILETOUSE = F.FILE1 Without the semicolon, the CASE test is something like (FMT(1,F.FILETOUSE)=F.FILE1) and possibly being considered true. On Dec 15, 2009, at 2:23 PM, George Gallen wrote: Here is an interesting tidbit I happened to run across. PROGRAM A: OPEN ,FILE1 TO F.FILE1 ELSE STOP NO FILE1 OPEN ,FILE2 TO F.FILE2 ELSE STOP NO FILE2 * F.FILETOUSE = F.FILE1 (Adding this here will get rid of the compile warning) BEGIN CASE CASE X=1 F.FILETOUSE = F.FILE1 CASE X=2 F.FILETOUSE = F.FILE2 CASE -1 F.FILETOUSE = F.FILE1 END CASE READ XDATA FROM F.FILETOUSE,TEST ELSE XDATA= The above program when compiled says F.FILETOUSE never assigned a value and when it executes, gives an improper file type error HOWEVER: PROGRAM B: OPEN ,FILE1 TO F.FILE1 ELSE STOP NO FILE1 OPEN ,FILE2 TO F.FILE2 ELSE STOP NO FILE2 F.FILETOUSE=F.FILE1 IF X=1 THEN F.FILETOUSE = F.FILE1 IF X=2 THEN F.FILETOUSE = F.FILE2 READ XDATA FROM F.FILETOUSE,TEST ELSE XDATA= Compiles and run just fine, no errors. This is using UV 10.0.2 under the Prime Information flavor George Gallen Senior Programmer/Analyst Accounting/Data Division, EDI Administrator ggal...@wyanokegroup.com ph:856.848.9005 Ext 220 The Wyanoke Group http://www.wyanokegroup.com ___ 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] An interesting find....
I'm not too familiar with the Prime Flavor, but doesn't the CASE and the setting of F.FILETOUSE need to be on separate lines or have a semi-colon (;)? CASE X=1 ; F.FILETOUSE = F.FILE1 CASE X=2 F.FILETOUSE = F.FILE2 Curt Stewart TRI-SYS Consulting -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen Sent: Tuesday, December 15, 2009 1:24 PM To: U2 Users List Subject: [U2] An interesting find Here is an interesting tidbit I happened to run across. PROGRAM A: OPEN ,FILE1 TO F.FILE1 ELSE STOP NO FILE1 OPEN ,FILE2 TO F.FILE2 ELSE STOP NO FILE2 * F.FILETOUSE = F.FILE1 (Adding this here will get rid of the compile warning) BEGIN CASE CASE X=1 F.FILETOUSE = F.FILE1 CASE X=2 F.FILETOUSE = F.FILE2 CASE -1 F.FILETOUSE = F.FILE1 END CASE READ XDATA FROM F.FILETOUSE,TEST ELSE XDATA= The above program when compiled says F.FILETOUSE never assigned a value and when it executes, gives an improper file type error HOWEVER: PROGRAM B: OPEN ,FILE1 TO F.FILE1 ELSE STOP NO FILE1 OPEN ,FILE2 TO F.FILE2 ELSE STOP NO FILE2 F.FILETOUSE=F.FILE1 IF X=1 THEN F.FILETOUSE = F.FILE1 IF X=2 THEN F.FILETOUSE = F.FILE2 READ XDATA FROM F.FILETOUSE,TEST ELSE XDATA= Compiles and run just fine, no errors. This is using UV 10.0.2 under the Prime Information flavor George Gallen Senior Programmer/Analyst Accounting/Data Division, EDI Administrator ggal...@wyanokegroup.com ph:856.848.9005 Ext 220 The Wyanoke Group http://www.wyanokegroup.com ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.716 / Virus Database: 270.14.107/2564 - Release Date: 12/15/09 01:52:00 ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] An interesting find....
AHA. You are correct. I don't usually have one line CASE's and those pesky semicolons usually trip me up there. Thanks...that was driving me nuts, because in the program I used it in, I would much rather have a CASE structure than the IF-THEN setup. George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of Ed Clark Sent: Tuesday, December 15, 2009 3:24 PM To: U2 Users List Subject: Re: [U2] An interesting find In your example, the line: CASE X=1 F.FILETOUSE = F.FILE1 should be CASE X=1; F.FILETOUSE = F.FILE1 Without the semicolon, the CASE test is something like (FMT(1,F.FILETOUSE)=F.FILE1) and possibly being considered true. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] An interesting find....
You may be better off using something like this instead: DIM F.FILETOUSE(2) OPEN FILE1 TO F.FILETOUSE(1) ELSE STOP NO FILE1 OPEN FILE2 TO F.FILETOUSE(2) ELSE STOP NO FILE2 then use F.FILETOUSE(X) - without the need for any conditional statements, just ensure X is assigned properly. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen Sent: Wednesday, 16 December 2009 4:27 AM To: U2 Users List Subject: Re: [U2] An interesting find AHA. You are correct. I don't usually have one line CASE's and those pesky semicolons usually trip me up there. Thanks...that was driving me nuts, because in the program I used it in, I would much rather have a CASE structure than the IF-THEN setup. George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of Ed Clark Sent: Tuesday, December 15, 2009 3:24 PM To: U2 Users List Subject: Re: [U2] An interesting find In your example, the line: CASE X=1 F.FILETOUSE = F.FILE1 should be CASE X=1; F.FILETOUSE = F.FILE1 Without the semicolon, the CASE test is something like (FMT(1,F.FILETOUSE)=F.FILE1) and possibly being considered true. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users DISCLAIMER: Disclaimer. This e-mail is private and confidential. If you are not the intended recipient, please advise us by return e-mail immediately, and delete the e-mail and any attachments without using or disclosing the contents in any way. The views expressed in this e-mail are those of the author, and do not represent those of this company unless this is clearly indicated. You should scan this e-mail and any attachments for viruses. This company accepts no liability for any direct or indirect damage or loss resulting from the use of any attachments to this e-mail. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users