Warnings compiling a 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
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Warnings compiling a routine

Post by gpbarsky »

Hi forumers....

I have a problem and I don't know what's going on.

When I compile this code (this is a routine called TraeConstante), I get the following messages:

WARNING: Variable-> 'FileConstante' is substituted for-> 'xPath' on line-> '17' If an input link column variable is used for this argument DataStage runtime may fail.
WARNING: Variable-> 'FileConstante' is substituted for-> 'xFile' on line-> '17' If an input link column variable is used for this argument DataStage runtime may fail.
WARNING: Variable-> 'Reg1' is substituted for-> 'xPath' on line-> '21' If an input link column variable is used for this argument DataStage runtime may fail.
WARNING: Variable-> 'Reg1' is substituted for-> 'xFile' on line-> '21' If an input link column variable is used for this argument DataStage runtime may fail.
WARNING: Variable-> 'Reg1' is substituted for-> 'xPath' on line-> '65' If an input link column variable is used for this argument DataStage runtime may fail.
WARNING: Variable-> 'Reg1' is substituted for-> 'xFile' on line-> '65' If an input link column variable is used for this argument DataStage runtime may fail.
WARNING: Variable-> 'Const1' is substituted for-> 'xDrive' on line-> '75' If an input link column variable is used for this argument DataStage runtime may fail.
WARNING: Variable-> 'Const1' is substituted for-> 'xBanco' on line-> '75' If an input link column variable is used for this argument DataStage runtime may fail.
Compiled with no errors

What does this mean ? The routine is not running very well, and I got some weird behaviours running it.

Here is the code:

job = "TraeConstante"

CALL DSLogInfo(">> xDrive":xDrive:".",job)
CALL DSLogInfo(">> xPath":xPath:".",job)
CALL DSLogInfo(">> xFile":xFile:".",job)
CALL DSLogInfo(">> xSociedad":xSociedad:".",job)
CALL DSLogInfo(">> xFilial":xFilial:".",job)
CALL DSLogInfo(">> xViadepago":xViadepago:".",job)
CALL DSLogInfo(">> xClasedetarjeta":xClasedetarjeta:".",job)
CALL DSLogInfo(">> xBanco":xBanco:".",job)
CALL DSLogInfo(">> xExtension":xExtension:".",job)
CALL DSLogInfo(">> xK1":xK1:".",job)

Ans = ""
FileConstante = xDrive:xPath:xFile
OpenSeq FileConstante TO Const1
THEN
*
CALL DSLogInfo(">> Va a leer el primer registro del archivo ":FileConstante:".",job)
READSEQ Reg1 FROM Const1
THEN
*
s1 = Status()
HayQueContinuar = @TRUE
LOOP WHILE s1 = 0 AND HayQueContinuar
*
* Obtiene los campos del registro segun el formato del archivo pasado como parametro
*
zSociedad = Trim(Reg1[1,4])
zFilial = Trim(Reg1[5,4])
IF xFile[1,6] = "DACONS"
THEN
zViaDePago = Trim(Reg1[9,1])
zClaseTarjeta = Trim(Reg1[10,4])
zClaseBanco = Trim(Reg1[14,3])
zCampo = Trim(Reg1[22,15])
zValor = Trim(Reg1[37,30])
zExtension = ""
CALL DSLogInfo(">> **zExtension-":zExtension:". **zCampo-":zCampo:". **zValor-":zValor:". **zViaDePago-":zViaDePago:". **zClaseTarjeta-":zClaseTarjeta:". **zClaseBanco-":zClaseBanco:".",job)
END
*
IF xFile[1,7] = "GBLCONS"
THEN
zExtension = Trim(Reg1[9,3])
zCampo = Trim(Reg1[12,15])
zValor = Trim(Reg1[27,30])
zViaDePago = ""
zClaseTarjeta = ""
zClaseBanco = ""
END
*
* Veo si ya alcance el valor que queria leer
*
IF zSociedad = xSociedad AND zFilial = xFilial AND zViaDePago = xViadepago AND zClaseTarjeta = xClasedetarjeta AND zClaseBanco = xBanco AND zExtension = xExtension AND zCampo = Trim(xK1)
THEN
Ans = zValor
HayQueContinuar = @FALSE
END
*
* Lee el siguiente registro
*
IF HayQueContinuar
THEN
READSEQ Reg1 FROM Const1
ELSE
IF Status() <> 1
THEN
CALL DSLogWarn(">> Error al leer el siguiente reg.del archivo ":FileConstante:" ":xExtension:". Status-":Status():".",job)
END
END
END
*
REPEAT;
CloseSeq Const1
END
ELSE
CALL DSLogWarn(">> Error al leer el primer registro del archivo ":FileConstante:" ":xExtension:". Status-":Status():".",job)
END
*
END
ELSE
CALL DSLogWarn(">> Error al abrir el archivo ":FileConstante:". Status-":Status():".",job)
END
*
IF Trim(Ans) = ""
THEN
CALL DSLogWarn(">> No se pudo hallar la constante ":xK1:" en el archivo ":FileConstante:".",job);
END

Thanks in advance.
Guillermo P. Barsky
Buenos Aires - Argentina
datastage
Participant
Posts: 229
Joined: Wed Oct 23, 2002 10:10 am
Location: Omaha

Post by datastage »

What are your routines arguments? xDrive, xPath, xFile, etc.... ?

I just want to make sure that is a correct assumption.
Byron Paul
WARNING: DO NOT OPERATE DATASTAGE WITHOUT ADULT SUPERVISION.

"Strange things are afoot in the reject links" - from Bill & Ted's DataStage Adventure
datastage
Participant
Posts: 229
Joined: Wed Oct 23, 2002 10:10 am
Location: Omaha

Post by datastage »

Also, is this defined as a transform function, before/after subroutine, or custom uniVerse function?

I pasted the code into a transform function and created the arguments and it compiles with no errors (DataStage 7.1)
Byron Paul
WARNING: DO NOT OPERATE DATASTAGE WITHOUT ADULT SUPERVISION.

"Strange things are afoot in the reject links" - from Bill & Ted's DataStage Adventure
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's hard to say. A couple of things would help:

Posting a summary of what the routine is supposed to be doing.
Editing your post and added 'code' tags so the code it is more readable and maintains your indent levels.

That being said, I believe that message usually means you are manipulating the arguments you passed in inside the routine. This is generally considered to be a Bad Thing and it is warning you that it could have unforseen consequences to your data when used in a job. Could that be the case? I don't really see it happening, but... :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
datastage
Participant
Posts: 229
Joined: Wed Oct 23, 2002 10:10 am
Location: Omaha

Post by datastage »

Since Guillermo had compile errors, but I didn't get compile errors when doing a copy/past of the code, I'm wondering if maybe there is a compliancy issue with NLS?

Guillermo, can you confirm is your server has NLS turned on?

Can some others with and without NLS copy/paste the code and see if they get compile errors?
Byron Paul
WARNING: DO NOT OPERATE DATASTAGE WITHOUT ADULT SUPERVISION.

"Strange things are afoot in the reject links" - from Bill & Ted's DataStage Adventure
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

I think he's getting compile errors in version 5.x that we might not see in version 7.x. Back in version 5 passing an input linked record into a routine and then manipulating it in that routine was a good way to get your job to spontaneously abort. Looks like the compiler is trying to warn about commands in your routine that may being doing this.

Your commands look harmless and you can either ignore the warnings or copy all your input paremeters to local parameters at the start of your routine. Where the compiler gives "FileConstante = xDrive:xPath:xFile" a warning it should not have a problem with "localxDrive = xDrive" and "FileConstante = localxDrive:localxPath:localxFile".
Post Reply