Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
call external function and number of variables is not fixed

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Wed May 12, 2010 12:44 pm    Post subject: call external function and number of variables is not fixed
Reply with quote

I have to implement a fucntion that the PLI main program will call the external function and pass parameters to the function.

The problem is that is number of parameters is not fixed,as required it can be 1 or 2 or 3 or 4.....and the sub program will do the different process according to number of the parameters,any good way to deal with such situation?Please guide me...
Back to top
View user's profile Send private message

donateeye
Warnings : 2

New User


Joined: 01 Jun 2007
Posts: 62
Location: chennai

PostPosted: Wed May 12, 2010 12:49 pm    Post subject:
Reply with quote

Declare the function procedure as GENERIC :

DCL function-procname GENERIC ( procname_1 WHEN ( parm_descriptor_1 ) , procname_2 WHEN ( parm_descriptor_2 ) );

this way, you can just use one function reference name but invoke different procedures depending on the parm that you pass on.

Any.... please correct me if I am wrong....
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Wed May 12, 2010 1:01 pm    Post subject:
Reply with quote

Hi donateeye,
thanks for your so quick reply,actually logic processing in the function procedure is the same,the requirement is like:
in main program it will pass the table name,and different columns,the number of columns is different as I mentioned above,maybe 1 or 2 or 3......and then the subprogram will form a SQL select statement according to the parameters received from main program....
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Wed May 12, 2010 7:59 pm    Post subject: Reply to: call external function and number of variables is
Reply with quote

anyone has the idea?and in additoin the parameter type(column type) is different,e.g:
the 1st call the subprogam it may have two parameters and the types are char and decimal,the 2nd time call the subprogram it may have five parameters and the types are char,decimal,decimal,char,char,decimal,and so on...

so how to manage it in both main and sub program?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu May 13, 2010 6:33 am    Post subject:
Reply with quote

Hello,

Go back and create a different approach. . .

It is most difficult to implement when the rules say "i don'tknow how much i have to handle and i don't know what it will look like". . .

Until some rules can be established, it will most difficult. . .

What business requirement exists that provides no specifics?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Profile changed to NUMBER ON STD (fro... Martylin TSO/ISPF 1 Thu Aug 03, 2017 9:14 am
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us