Compilation error(‘$INCLUDE’ does not name a ty) for routine

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Welcome.

For the record, routines that are used in the Before/After Job areas or in Sequence jobs are written in BASIC not C++ so there's no need to throw that compiler at it. Where are you planning on using this?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sudheerkumar541
Participant
Posts: 11
Joined: Tue Jul 05, 2016 11:04 pm

Post by sudheerkumar541 »

Hi,

Thanks for you prompt reply,

My intension is to develop a parallel routine to get link count,i got information like we have to write code(without main) in C++ and compile it in unix then object file will create, and we have to use that object in routine, I tried sample code like

int sample(n)
{
return n+1
}

I am able to call and execute this in transformer,but when I try for datastage functionality means like linkcount,jobinfo, I am unable to complie the code,Please help me
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

It is much easier to do it after the job is complete using

DSGetLinkInfo(hJob1,StageName,LinkName,DSJ.LINKROWCOUNT)

This will give you link count for any link in the job. You need to pass the Job Handle, Stage Name and Link name.

You can either call this in After Job subroutine or write a small BASIC routine and call it.

You can probably find dozens of threads if you search for DSGetLinkInfo...

Usually the only reason to write C programs is to build things that need to run in parallel (custom stages / custom parallel routines). I'm not really understanding the need to go the C route here. Can you explain what you are trying to accomplish that requires this to run in parallel?
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
sudheerkumar541
Participant
Posts: 11
Joined: Tue Jul 05, 2016 11:04 pm

Post by sudheerkumar541 »

Hi,
I have tried following code in server routine and I am able to get the output,
but the same code not working in parallel routine, can you please guide me for parallel routine,since we have restriction from client we should not go for server jobs/routines

$INCLUDE DSINCLUDE JOBCONTROL.H

iReadInputRecCount = DSGetLinkInfo(DSJ.ME,"Transformer_8","DSLink9",DSJ.LINKROWCOUNT)

Ans =(iReadInputRecCount);

Call DSLogInfo('Checking Records in Job': iReadInputRecCount,RtnStgRecCnt)

and also can you please tell me Ans =(iReadInputRecCount); stores record count in Ans variable, but how to display output of variable and how to use that variable outside of routine
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

sudheerkumar541 wrote:can you please guide me for parallel routine,since we have restriction from client we should not go for server jobs/routines
:!: Your client need to be... re-educated. [sigh]

I believe you use the right tool for the right job. Just because PX is an awesome hammer, that doesn't make every problem you have some kind of nail. Leaving Server jobs and their bs stigma off the table, not allowing Server routines is just... dumb. They are be used in the Before/After Job area in any job and also in the Routine Activity stage in Sequence jobs, places where a "parallel routine" cannot be used - those are restricted to use inside parallel jobs. Only. And what you are trying to do, as people have already tried to point out, really has no need to be done as a parallel routine in a parallel job. :?

Push. Back. Or as our friend Ray would say - "Resist stupid requirements!".

ps. The value of "Ans" is what the routine returns to whatever called it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sudheerkumar541
Participant
Posts: 11
Joined: Tue Jul 05, 2016 11:04 pm

Post by sudheerkumar541 »

Hi,

Yeah, I too thought the same, I will inform to my technical leads,mean while can you please tell the way or any links to write for parallel routienes, for my learning purpose
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

From what I recall, documentation is included with the product on that very subject. Also note that you can search here as it has been discussed many many times, for example an exact search for parallel routine returns 487 matches... a lot to wade thru, yes, but start with the ones that look basic, like "How to create shared C++ object and use them in datastage" which also happens to include a documentation link. As noted it has lots of company here. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
sudheerkumar541
Participant
Posts: 11
Joined: Tue Jul 05, 2016 11:04 pm

Post by sudheerkumar541 »

Thank u so much,i will go through it.. the thing is I am unable to invoke datastage functionalities in my parallel routines
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There are lots of resources out there, for example a two second Google search turned up this technote as one example, perhaps it will help.

Your biggest problem, I believe, is that you are trying to compile BASIC code as if it were C++ code. Now, my C++ skillz are non-existent so others will need to help on this topic and I'm not even sure there are equivalent C++ callable versions of the "DSGet*" functions you are trying to leverage - which is what I assume you mean by "DataStage functionalities". As noted multiple times, those are meant to be and are typically used either at the command line as dsjob options or from a BASIC routine or "Job Control" code.

Can anyone jump in here and clarify this for us, please?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There exists a C-callable version of the DataStage API, fully documented in the Programmer's Guide.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply