Calling ConvertMonth from within routine.

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
gsherry1
Charter Member
Charter Member
Posts: 173
Joined: Fri Jun 17, 2005 8:31 am
Location: Canada

Calling ConvertMonth from within routine.

Post 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.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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:
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
gsherry1
Charter Member
Charter Member
Posts: 173
Joined: Fri Jun 17, 2005 8:31 am
Location: Canada

Post 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'
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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?
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
gsherry1
Charter Member
Charter Member
Posts: 173
Joined: Fri Jun 17, 2005 8:31 am
Location: Canada

Post by gsherry1 »

It is working now. I must have screwed it up first time I tested.

Thanks.
Post Reply