Server routine compile error in Version 8

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
lane0001
Premium Member
Premium Member
Posts: 4
Joined: Fri Sep 15, 2006 1:24 pm

Server routine compile error in Version 8

Post by lane0001 »

We are in the process of moving from 7.5.2 to 8.1. One of our server routines that compiles fine in 7.5.2 is receiving a compile error in 8.1.

Any help would be appreciated.

Code: Select all

FUNCTION dukWriteFile(fileName,dynArray,delim)
DEFFUN dukOpenFile(fileName, OpenMode, WriteMode, Logging) CALLING "DSU.dukOpenFile"

LF=char(10)
myName="dukWriteFile"

$INCLUDE UNIVERSE.INCLUDE FILEINFO.H
$UNDEFINE TESTING

ErrorCode = 0
ReadCount = 0
LineCount = 0
SeparatorCount = 0
if delim = "" then del=@FM else del=delim

Call DSLogInfo("file=":fileName, myName)
hTarget = dukOpenFile(fileName, "W", "O", "Y")

numlin=DCOUNT(dynArray, del)
For LinePtr = 1 to numlin
   Line = dynArray<LinePtr> : LF
   WriteSeq Line To hTarget else stop
Next LinePtr

CloseSeq hTarget

$IFDEF TESTING
   Message = "Rows read by routine = " : RowCount
   Message<-1> = "Separators found = " : SeparatorCount
   Message<-1> = "Lines written by routine = " : LineCount
   Message<-1> = "Number of output files = " : Counter
   Call DSLogInfo(Message, "Testing ManyOutputFiles routine")
$ENDIF

Ans=ErrorCode
Error received:
Compiling: Source = 'DSU_BP/DSU.dukWriteFile', Object = 'DSU_BP.O/DSU.dukWriteFile'
**************
0022 WriteSeq Line To hTarget else stop

^
' ' unexpected, Was expecting: FOR control (WHILE/UNTIL/NEXT) or statement,
"GETX", "PRINTERRX", "TRANSACTION", "SETIT", "SEND", "UPRINT",
"AUXMAP"
WARNING: Variable 'Line' never assigned a value.

1 Errors detected, No Object Code Produced.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

There is something more involved here, since I cut-and-pasted your code to my machine and it compiled without warnings or errors.

If you delete your includes and conditional compile code does the error persist?
lane0001
Premium Member
Premium Member
Posts: 4
Joined: Fri Sep 15, 2006 1:24 pm

Post by lane0001 »

Thanks for the reply.

I deleted the includes, recompiled, and received the same error.
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

Just include Line = '' in the begining of your routine
Arun
lane0001
Premium Member
Premium Member
Posts: 4
Joined: Fri Sep 15, 2006 1:24 pm

Post by lane0001 »

Arun, the "Line" warning is not the problem. The error is keeping it from compiling. But thanks anyway.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The code compiles perfectly well on my machine too (I changed dukOpenFile references to OpenSequentialFile, since that's obviously what it's based on - I do trust that you kept my copyright notice intact as instructed in the original code!).
Try copying and pasting the code from this thread into a new routine and compiling that. Maybe you've introduced a non-printing character into your original 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

By conditional compile I mean the code between the $IFDEF and $ENDIF as well as the $UNDEFINE TESTING line. It shouldn't make a difference, but will make the test routine smaller. Did Ray's suggestion of cut-and-paste to a new routine make a difference?
lane0001
Premium Member
Premium Member
Posts: 4
Joined: Fri Sep 15, 2006 1:24 pm

Post by lane0001 »

Ray,

Your suggestion of copying the code from this thread worked! Apparently the export/import from 7.5.2 to 8.1 corrupted the code as we are having the same compile issue with this same routine in other projects.

Your copyright notice is intact in our code.

Thanks for your help! Thank you too ArndW.
Post Reply