Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subprocedure

Status
Not open for further replies.

thelearner

Programmer
Jan 10, 2004
153
US
Hi,

What's wrong with my module? It won't compile.

Here is my pgm:

H NOMAIN
FCUMAST IF E K DISK USROPN

D GETCUST PR N
D CUSTNO 6
D ZDS LIKEDS(CUSTD

P GETCUST B EXPORT

D GETCUST PI N
D CUSTNO 6
D ZDS LIKEDS(CUSTD

D CUADR2 S 35 VARYING
D CUADR3 S 35 VARYING

/FREE

OPEN CUMAST;

CHAIN CUST# CUMAST;
IF %FOUND;
ZDS.CUST# = CUCODE;
ZDS.NAME = CUNAME;
ZDS.ADDR = CUADR2 + CUADR3;
ZDS.ZIP = CUSTAR + CUZIP5;
ZDS.BAL = CUCRUP;
ENDIF;

CLOSE CUMAST;
RETURN %FOUND;

/END-Free

P E

Here are the errors msg:
The name or indicator ADDR is not defined.
The name or indicator BAL is not defined.
The name or indicator CUMAST is not defined.
Record-Format CUREC not used for input or output
The name or indicator CUST# is not defined.
The name or indicator CUSTAR is not defined.
The name or indicator CUSTDS is not defined.
The name or indicator CUSTDS is not defined.
The name or indicator NAME is not defined.
The name or indicator ZDS is not defined.
The name or indicator ZDS is not defined.
The name or indicator ZIP is not defined.
































































 
When you compile a program with a subprocedure, make sure you're setting the default activation group to no.

DFTACTGRP(*NO)

RedMage1967
IBM Certifed - RPG IV Progammer
 
Hi,

DFTACTGRP(*NO) is in opt 14. Don't I suppose to compile with opt 15 then use command CRTPGM to bind them together?
Below is my other module, XMOD2C. I compiled with opt 15 and no problem with it. I want to use XMOD2C to call XMOD2S (above) and return with some parm. Do I have to include /COPY in XMOD2S? I tried to insert it after the F-spec. The error msg above were gone but I got another msg said "The operation entry is not allowed in the main
source section when NOMAIN is specified." The message pointed to each line of XMOD2C.

Thank.


D CUSTDS DS QUALIFIED
D CUST# 6
D NAME 40
D ADDR 70
D ZIP 40
D BAL 10 2

D XMOD2S PR N
D CUSTNO 6 VALUE
D ZDS LIKEDS(CUSTDS)

D FOUND S N
D CUSTNO S 6

/FREE

FOUND = XMOD2S (CUSTNO:CUSTDS);
DSPLY FOUND;
DSPLY CUSTNO;

*INLR = '1';

/END-FREE















 
I recon, you don´t have file CUMAST in library list while you compiling.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top