Compilation error(‘$INCLUDE’ does not name a ty) for routine
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 11
- Joined: Tue Jul 05, 2016 11:04 pm
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
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
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?
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?
-
- Participant
- Posts: 11
- Joined: Tue Jul 05, 2016 11:04 pm
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
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
Your client need to be... re-educated. [sigh]sudheerkumar541 wrote:can you please guide me for parallel routine,since we have restriction from client we should not go for server jobs/routines
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
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 11
- Joined: Tue Jul 05, 2016 11:04 pm
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.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 11
- Joined: Tue Jul 05, 2016 11:04 pm
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?
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
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: