Page 1 of 1

Calling ConvertMonth from within routine.

Posted: Mon Oct 24, 2005 9:35 am
by gsherry1
Is there a way to call the example routine ConvertMonth without having to make a copy and compile.

If there is, please provide the DEFFUN statement.

Thanks.

Posted: Mon Oct 24, 2005 9:54 am
by kcbland
Check out the excellent search facilities on the forum. Here's one I found in about 15 seconds:

viewtopic.php?t=94003&highlight=dsu

Posted: Mon Oct 24, 2005 10:21 am
by ArndW
Ken & gsherry1,

in this case the routine is not catalogued as a user-routine with a DSU prefix. I took a look and the appropriate DEFFUN for this is:

Code: Select all

DEFFUN ConvertMonth(a,b) CALLING 'DSX.CONVERT.MONTH'
I haven't found that documented anywhere yet, though.

Posted: Mon Oct 24, 2005 10:34 am
by kcbland
Yeah, but if you look here:
viewtopic.php?t=89861&highlight=convertmonth

It's exactly what was needed. I don't like to give the easy answer or spoon feed people. Why post at all, why not give out phone numbers and voice answers? The history is here to be used. Our first answer to most questions that can solved via the Search facility should be to use the Search facility. Giving the first perfect answer means nothing was learned.

EDIT:

Okay, I re-read the original post, and yes they could have made a copy to compile as a user and then it would have worked. But, the issue here is that the catalogued verb name is different than the compiled code. Strange, but I guess the only way around it was to search and figure it out. :oops:

Posted: Mon Oct 24, 2005 11:45 am
by gsherry1
For the record, this poster did read history before starting this topic. This is why the original post was qualified with a 'without having to make a copy and compile'.

I also could not get the following to work:

DEFFUN ConvertMonth(a,b) CALLING 'DSX.CONVERT.MONTH'

Posted: Mon Oct 24, 2005 12:10 pm
by kcbland
gsherry1 wrote:For the record, this poster did read history before starting this topic. This is why the original post was qualified with a 'without having to make a copy and compile'.
Yep, for which I publicly showed I went back to my most recent reply, corrected myself (see EDIT), and even did the redfaced emoticon to indicate I was in error. However, in the "conversation" we're having, I was responding to Arnd that searching would have shown the answer for 99.99% of the times someone asks the question for how to call a function from a function. Your problem actually is a tantalizing and intriguing issue.

Posted: Mon Oct 24, 2005 12:16 pm
by ArndW
gsherry1,

I wrote a test job on my UNIX 7.1 installation and it worked. What error message do you get when you try this?

Posted: Mon Oct 24, 2005 12:16 pm
by kcbland
I created a test function with two arguments, put this in it:

Code: Select all

DEFFUN ConvertMonth(a,b) CALLING 'DSX.CONVERT.MONTH' 
Ans = ConvertMonth(Arg1,Arg2)
I ran the Test button, for Arg1 entered 2005-07 and for Arg2 put an L. I hit Run and got the answer 13727.

Give it a try.

Posted: Mon Oct 24, 2005 12:51 pm
by gsherry1
It is working now. I must have screwed it up first time I tested.

Thanks.