DEFFUN error

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
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

DEFFUN error

Post by Nagac »

Hi

I have created the Server routine
code:
Call DSSetUserStatus(Arg1)

Ans = Arg1
when i test it it is working fine.

But when i call this from transfromer and it is giving compilation error.

here Run_Number is the input column.

nything else in Routine. I am calling theis routine from Server job onlyu.
Last edited by Nagac on Mon May 30, 2011 5:16 am, edited 1 time in total.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This really belongs in a different thread.

DEFFUN declarations must precede any executable statement in the code.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Post by Nagac »

Thanks Ray,

Can you please suggest me how do we define and what to define?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ray.wurlod wrote:This really belongs in a different thread.
Done. Nagac, please start threads properly rather than jumping on things you stumble across while searching.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I don't see what the error you posted has to do with the code you posted before that. Post the entire code for this 'RunNumber' routine.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Post by Nagac »

I want to pass the value from file to Job parameter. I have created the routine as below (only 2 lines) and tried to assign the value to Stage variable.

My intention is to pass the value to Userstatus. then i can assign this value to job parameter
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Have you successfully compiled your routine?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Post by Nagac »

I have successfully compiled and able to test the routine as well. But problem is in Transfromer. Job is not getting compiled. showing the mentioned error message
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Take a look at the file RT_BP38/JOB.1510815895.DT.1582836700.TRANS1 in your project. The error may not actually be in the DEFFUN statement - it may be one or two lines prior. Line 0028 is merely the point at which the compiler gave up.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Post by Nagac »

Thanks Ray,

can you please tell where i can find the this log entries in Unix Server. we have many projects and had created many folder manually in our server. so i could not find any relevant folder for these files.

Just for your information I had selected routine type as Transform Function. Is that ok?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As he noted, in the job's project folder. Unless you've overridden the default, it is typically at the same level as the DSEngine directory, so at worst case you can go there and then:

Code: Select all

cd ../Projects/<ProjectName>
Under that folder you'll find the "RT_BP38" folder and the TRANS1 file inside it. And yes, it needs to be a Transform Function routine.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Post by Nagac »

Hi

I got it.

Below are log entries i found

Code: Select all

* Tokens were replaced below as follows:
* V0S1.Stagevar%%1 <= USERSTATUS
* Pin%%V0S1P1.Column%%1 <= DSLink3.Run_Number
* GET.Pin%%V0S1P1 <= GET.DSLink3
* Pin%%V0S1P1.REJECTEDCODE <= DSLink3.REJECTEDCODE
* Pin%%V0S1P2.Column%%1 <= DSLink4.Run_Number
* PUT.Pin%%V0S1P2 <= PUT.DSLink4
* Pin%%V0S1P2.REJECTED <= DSLink4.REJECTED
* Pin%%V0S1P2.REJECTEDCODE <= DSLink4.REJECTEDCODE
*
* Subroutine for active stage Runnumber_Job2.Transformer_1 generated at 14:01:30 03 MAY 2011
*
SUBROUTINE DSTransformerStage(HANDLES,ERROR)

$INCLUDE DSINCLUDE DSD_RTCONFIG.H
$INCLUDE DSINCLUDE DSD_STAGE.H
$INCLUDE DSINCLUDE DSD_BCI.H

$INCLUDE DSINCLUDE JOBCONTROL.H
DEFFUN DSRLoadString(Num,Text,Args) CALLING '*DataStage*DSR_LOADSTRING'
$DEFINE V0S1.Stagevar%%1 STAGECOM.ARR(1)
$DEFINE Pin%%V0S1P1.Column%%1 STAGECOM.ARR(2)
$DEFINE GET.Pin%%V0S1P1 CALL $DS.SEQGETNEXT(1,Pin%%V0S1P1.REJECTEDCODE)
IF STAGECOM.TRACE.STATS THEN CALL $PERF.NAME(-2,'StageVars.Derivation')
IF STAGECOM.TRACE.STATS THEN CALL $PERF.NAME(-3,'DSLink4.Derivation')
$DEFINE Pin%%V0S1P2.Column%%1 STAGECOM.ARR(2)
$DEFINE PUT.Pin%%V0S1P2 CALL $DS.SEQPUT(2, Pin%%V0S1P2.REJECTEDCODE)
DEFFUN RunNumber( ARG1) CALLING "DSU.RunNumber"

UPDATE.COUNT = STAGECOM.RATE

* Stage Variable initialization
IF NOT(STAGECOM.STAGE<STAGE.VAR.INITED,1>) THEN
        STAGECOM.STAGE<STAGE.VAR.INITED,1> = @TRUE
        V0S1.Stagevar%%1 = 0
END


LOOP
        REJECTED = @TRUE
        * Get next row from primary input pin DSLink3
        STAGECOM.PINNO = 1
        GET.Pin%%V0S1P1
        ERROR = Pin%%V0S1P1.REJECTEDCODE
WHILE NOT(ERROR)
        * Stage variable evaluation
IF STAGECOM.TRACE.STATS THEN CALL $PERF.BEGIN(-2)
        V0S1.Stagevar%%1 = RunNumber(Pin%%V0S1P1.Column%%1)
IF STAGECOM.TRACE.STATS THEN CALL $PERF.END(-2)

        STAGECOM.PINNO = 2
            IF STAGECOM.TRACE.STATS THEN CALL $PERF.BEGIN(-3)
            IF @TRUE THEN
                * Column derivation code for pin DSLink4
                Pin%%V0S1P2.REJECTED = @FALSE
            IF STAGECOM.TRACE.STATS THEN CALL $PERF.END(-3)

                PUT.Pin%%V0S1P2
                IF NOT(Pin%%V0S1P2.REJECTEDCODE) THEN
                    REJECTED = @FALSE
                END ELSE
                    Pin%%V0S1P2.REJECTED = @TRUE
                END
            END
            ELSE
                Pin%%V0S1P2.REJECTED = @TRUE
                Pin%%V0S1P2.REJECTEDCODE = 0
            END


  UPDATE.COUNT -= 1
  IF UPDATE.COUNT LE 0 THEN CALL DSD.Update(HANDLES);UPDATE.COUNT = STAGECOM.RATE
REPEAT
RETURN
END
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That's not a log, that's the source code of your Transformer stage.

There's nothing obvious there. What does your support provider advise?
Have you tried building a second copy of the job (or a simplified version) to see whether the problem is reproducible?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Post by Nagac »

Yes ray,

I have created new job and used the same routine. I got the same compilation error.

We haven't contacted the service provider yet.

Process i have followed.

1. Created Server routine with the given code
Call DSSetUserStatus(Arg1)

Ans = Arg1
2. Created the server job and created Stage variable by calling this routine RunNumber(column name) in transfromer stage. just straight moved the input column to sequential file.

3. Saved

4. compiled. here it is giving the compilation error

Is there any thing else i need to follow?
Post Reply