Hi

You need to pass  REC as a parameter to the subroutine see below:
-- mats

Sanjeebkumar Sarangi skrev:
> Hi
> I tried to generate a report by writing a small program. But I got an error
> as below.
>
> ERROR:
>
>   
>> RUN TEST.BP MAIN
>>     
> MAIN
>
> 45 record(s) selected to SELECT list #0.
> Program "SUB": Line 3, Variable "REC" previously undefined.  Empty string
> used.
> Program "SUB": Line 3, Printer name UVDEFAULT is not recognized by the
> system.
>
> CODE:
>
>   
>> ED TEST.BP
>>     
> Record name = MAIN
> 15 lines long.
>
> ----: P
> 0001: CRT 'MAIN'
> 0002: OPEN 'INVENTORY.T' TO INEVNTORY ELSE STOP
> 0003: SENT = 'SSELECT INVENTORY.T BY ITEM_CODE'
> 0004: EXECUTE SENT
> 0005: EOF = 0
> 0006: LOOP
> 0007: READNEXT ITEM_CODE ELSE
> 0008: EOF = 1
> 0009: END
> 0010: UNTIL EOF DO
> 0011: READ  REC FROM INEVNTORY ,ITEM_CODE THEN
> 0012: CALL SUB(REC)    ;!!
>   
> 0013: END
> 0014: REPEAT
> 0015: STOP
> Bottom at line 15.
> ----: Q
>
> File name        = TEST.BP
> Record name = SUB
> 6 lines long.
>
> ----: P
>   
               SUBROUTINE SUB(REC)     ;!!!
> 0001:CRT 'SUB'
> 0002: PRINTER ON
> 0003: PRINT "ITEM_CODE"  "L#16":REC<1>
> 0004: PRINT "DESCRIPTION"  "L#16": REC<2>
> 0005: PRINT "TYPE"  "L#16":REC<3>
> 0006: PRINTER OFF
> 0007: RETURN
> Bottom at line 7.
> ----:
> How do I resolve this?
>
>
> Thanks
> Sanjeeb
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain 
> confidential or privileged information. If you are 
> not the intended recipient, any dissemination, use, 
> review, distribution, printing or copying of the 
> information contained in this e-mail message 
> and/or attachments to it are strictly prohibited. If 
> you have received this communication in error, 
> please notify us by reply e-mail or telephone and 
> immediately and permanently delete the message 
> and any attachments. Thank you
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to