<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Verdana">
<DIV>Dave,</DIV>
<DIV> </DIV>
<DIV>That was the problem. Too much time in perl I guess. I didn't even remember that you don't return a variable in UniBasic subroutines.</DIV>
<DIV> </DIV>
<DIV>Thanks</DIV>
<DIV> </DIV>
<DIV>--<BR>Don Prezioso<BR>Director of Administrative Systems<BR>Ashland University<BR>Ashland, Ohio<BR><BR>>>> rotmand@cedarville.edu 11/04/05 10:13 AM >>><BR></DIV>
<DIV style="COLOR: #000000">Don--<BR><BR>On our system, running DOWNLOAD using your subroutine<BR>abends but not with a segmentation fault.  I was able to get<BR>it to run by changing the line:<BR>    RETURN RESULT<BR>to<BR>    RETURN<BR><BR>I'm suspecting UniBASIC (being called by DOWNLOAD<BR>invoking ITYPE) was confused about a subroutine returning<BR>a function value.<BR><BR>Let me know if this change doesn't fix the problem.<BR><BR><BR><BR>Dave Rotman<BR>Director of Computer Services<BR>Cedarville University<BR>251 N. Main Street<BR>Cedarville, OH 45314<BR>rotmand@cedarville.edu<BR>voice 937-766-7905<BR>fax 937-766-8819<BR><BR>>>> dprez@ashland.edu 11/3/2005 11:34:29 am >>><BR>O.K., I'm really puzzled on this one. <BR><BR>I have a virtual field that calls a subroutine. In LIST statements it works fine, but DOWNLOAD gives a segmentation fault.<BR><BR>First the error:<BR><BR>:GET.LIST TEST.DVP<BR>10 records retrieved to list 0.<BR>>DOWNLOAD STUDENTS STU.DMD.CREDITS FORMAT FIXED<BR>DOWNLOAD version 7.12<BR>Using input file STUDENTS<BR>Output to screen<BR><BR>Segmentation fault<BR>ibmp630:/datatel/live/collive $<BR><BR>The virtual field code is:<BR><BR>SUBR("DELTA.MU.DELTA.CREDITS",STUDENTS.ID)<BR><BR>And the DELTA.MU.DELTA.CREDITS subroutine code is:<BR><BR>SUBROUTINE DELTA.MU.DELTA.CREDITS(RESULT,ID.NO)<BR>*  TAKES AN ID NUMBER AND RETURNS A TOTAL NUMBER CREDITS EARNED FOR<BR>*  DELTA MU DELTA REPORT<BR>COMMON /DMDCRED/ OPENED, F.TRANS.GROUP, F.STUD.ACAD.CRED, F.STU.ACAD.LEVEL, ACAD.LEVELS<BR>IF NOT(OPENED) THEN<BR>  OPEN '','TRANSCRIPT.GROUPINGS' TO F.TRANS.GROUP<BR>     ELSE STOP "UNABLE TO OPEN TRANSCRIPT GROUPING FILE"<BR>  OPEN '','STUDENT.ACAD.CRED' TO F.STUD.ACAD.CRED<BR>     ELSE STOP "UNABLE TO OPEN STUDENT.ACAD.CRED FILE"<BR>  OPEN '','STUDENT.ACAD.LEVELS' TO F.STU.ACAD.LEVEL<BR>     ELSE STOP "UNABLE TO OPEN STUDENT.ACAD.LEVELS FILE"<BR>  READ TG.REC FROM F.TRANS.GROUP, 'MB'<BR>    ELSE TG.REC = ''<BR>  ACAD.LEVELS = TG.REC<2><BR>  OPENED = 1<BR>END<BR>*<BR>X.TOTAL = 0<BR>RESULT = 0<BR>ACAD.LEVEL.COUNT = DCOUNT(ACAD.LEVELS,@VM)<BR>FOR LEVEL = 1 TO ACAD.LEVEL.COUNT<BR>  READ STA.REC FROM F.STU.ACAD.LEVEL,ID.NO:'*':ACAD.LEVELS<1,LEVEL> THEN<BR>    STUDENT.ACAD.CRED = STA.REC<10><BR>    CRED.COUNT = DCOUNT(STUDENT.ACAD.CRED,@VM)<BR>    FOR I = 1 TO CRED.COUNT<BR>      READ STC.REC FROM F.STUD.ACAD.CRED,STUDENT.ACAD.CRED<1,I> THEN <BR>        IF STC.REC<13> GT 0 THEN<BR>          X.TOTAL += STC.REC<13><BR>        END<BR>      END<BR>    NEXT I<BR>  END<BR>NEXT LEVEL<BR>*<BR>IF X.TOTAL THEN <BR>  RESULT = OCONV(X.TOTAL,"MD05") <BR>END<BR>*<BR>RETURN RESULT<BR>END<BR><BR>If I try to do a DOWNLOAD using an EVAL, instead of the virtual field, I get:<BR><BR>:GET.LIST TEST.DVP<BR>10 records retrieved to list 0.<BR>>DOWNLOAD STUDENTS EVAL 'SUBR("DELTA.MU.DELTA.CREDITS",STUDENTS.ID)'<BR>DOWNLOAD version 7.12<BR>Creating temporary list DLDPREZ40567<BR>10 key(s) saved to 1 record(s).<BR>10 records retrieved to list 1.<BR>Overwriting existing select list.<BR>10 records retrieved to list 1.<BR>Using input file STUDENTS<BR>Output to screen<BR><BR>""<BR>""<BR>""<BR>""<BR>""<BR>""<BR>""<BR>""<BR>""<BR>""<BR><BR>10 records processed.<BR>Deleting temporary list DLDPREZ40567<BR>'DLDPREZ40567' deleted.<BR>:<BR><BR>It should be returning some number (if only 0) instead of the null strings.  If I do a LIST statement I get:<BR><BR>:GET.LIST TEST.DVP<BR>10 records retrieved to list 0.<BR>>LIST STUDENTS STU.DMD.CREDITS<BR><BR>LIST STUDENTS STU.DMD.CREDITS 11:31:21 Nov 03 2005 1<BR>STUDENTS.. STU.D<BR><BR>0936711       27<BR>0816629       16<BR>0896532       18<BR>0936713       12<BR>0936719       18<BR>0736451       18<BR>0976714        6<BR>0616439       28<BR>0896540       17<BR>0556488       12<BR>10 records listed<BR><BR>I have messed around with the subroutine code (there didn't used to be common, and it didn't used to verify the presence of data) to no avail. Any ideas?<BR><BR>Thanks<BR><BR>Don<BR><BR><BR>--<BR>Don Prezioso<BR>Director of Administrative Systems<BR>Ashland University<BR>Ashland, Ohio<BR><BR><BR><BR>_______________________________________________<BR>download-list mailing list<BR>download-list@cedarville.edu<BR><A href="http://mail.cedarville.edu/mailman/listinfo/download-list">http://mail.cedarville.edu/mailman/listinfo/download-list</A><BR></DIV></BODY></HTML>