View previous topic :: View next topic
|
Author |
Message |
jawadshaik Warnings : 1 New User
Joined: 27 Sep 2005 Posts: 16
|
|
|
|
hi every one,
I need details about how to create packages and how to use the created packages in other programs .
hoping responce with good example
with regards,
jawadshaik |
|
Back to top |
|
|
Sridevi_C
Active User
Joined: 22 Sep 2005 Posts: 104 Location: Concord, New Hampshire, USA.
|
|
|
|
Hi,
Packages in PL/I? I know we have in DB2...
Regards,
Sridevi. |
|
Back to top |
|
|
jawadshaik Warnings : 1 New User
Joined: 27 Sep 2005 Posts: 16
|
|
|
|
Hi,
while refeing through some site i got this code referring to package concept
*Process S A(F) LANGLVL(SAA2) LIMITS(EXTNAME(31)) NUMBER;
Package_Demo: Package exports (Factorial);
/***********************************************/
/* Common Data */
/***********************************************/
dcl N fixed bin(15);
dcl Message char(*) value('The factorial of ');
/***********************************************/
/* Main Program */
/***********************************************/
Factorial: proc options (main);
dcl Result fixed bin(31);
put skip list('Please enter a number whose factorial ' ||
'must be computed ');
get list(N);
Result = Compute_factorial(n);
put list(Message || trim(N) || ' is ' || trim(Result));
end Factorial;
/***********************************************/
/* Subroutine */
/***********************************************/
Compute_factorial: proc (Input) recursive returns (fixed bin(31));
dcl Input fixed bin(15);
if Input <= 1 then
return(1);
else
return( Input*Compute_factorial(Input-1) );
end Compute_factorial;
end Package_Demo;
here i didnt get how this package is created and used
I mean there is some thing called packeges in pl/i and my query is how to create and use them
regards,
Jawadshaik |
|
Back to top |
|
|
|