Currently I'm in the process of migrating the datastage codes from DS9.1 (mounted in AIX) to DS11.3 (mounted in Red Hat 4.4.7-16).
Below universal code is written for scrubbing/converting particular position of characters of incoming EBCIDIC file into spaces.
It is working fine in Datastage9.1 in AIX & the downstream is able to process the files without any issues.
But when i try to run the same code against the same input EBCIDIC file in Datastage11.3 in LINUX, I could find the output file size is getting increased by 2.5 times & the downstream processing of the output file genertaed by this code is getting impacted.
I also tried commenting out the conversion piece of code & re-directing the input data directly to the output file, but still the output file size is getting increased 2.5 times.
Any help/suggestions on this regard could be really helpful.
Code: Select all
FILE_NAME = SOURCE_DIR:"/":SOURCE_NAME:".new"
GOSUB INIT
*
OPENSEQ SOURCE_DIR:"/":SOURCE_NAME:".src" TO F.SRC ELSE
Call DSLogInfo('Unable to open ':SOURCE_DIR:'/':SOURCE_NAME:'.src',"Output")
ErrorCode = 1
GOTO 10000
END
*
OPENSEQ SOURCE_DIR:"/":SOURCE_NAME:".new" TO F.NEW ELSE
Call DSLogInfo('Unable to open ':SOURCE_DIR:'/':SOURCE_NAME:'.new',"Output")
ErrorCode = 1
GOTO 10000
END
*
CNT = 1
EOF = 0
LOOP UNTIL EOF DO
READBLK RECORD FROM F.SRC,LENGTH THEN
RECORD[76,6] = STR(CHAR(32),6);
WRITEBLK RECORD ON F.NEW ELSE
Call DSLogInfo('Unable to write to ':SOURCE_DIR:'/':SOURCE_NAME:'.new',"Output")
ErrorCode = 1
GOTO 10000
END
CNT = CNT + 1
IF CNT/100000 = INT(CNT/100000) THEN
Call DSLogInfo(CNT:' records processed...',"Output")
END
END ELSE
EOF = 1
END
*
REPEAT
*
Call DSLogInfo(CNT:' records processed...',"Output")
CLOSESEQ F.SRC
CLOSESEQ F.NEW
*
GOTO 10000
*
INIT: * - - Initialize Unix Flat File - - *
*
Command = "rm ":FILE_NAME
Call DSLogInfo("Command = ":Command,"Command")
CMD = 'sh -c "':Command:'"'
Call DSExecute("UV", CMD, Output, SystemReturnCode)
Call DSLogInfo("Output ":Output, "Output")
Call DSLogInfo("System Returncode ":SystemReturnCode, "SysCode")
*
Command = "touch ":FILE_NAME
Call DSLogInfo("Command = ":Command,"Command")
CMD = 'sh -c "':Command:'"'
Call DSExecute("UV", CMD, Output, SystemReturnCode)
Call DSLogInfo("Output ":Output, "Output")
Call DSLogInfo("System Returncode ":SystemReturnCode, "SysCode")
*
Command = "chmod 660 ":FILE_NAME
Call DSLogInfo("Command = ":Command,"Command")
CMD = 'sh -c "':Command:'"'
Call DSExecute("UV", CMD, Output, SystemReturnCode)
Call DSLogInfo("Output ":Output, "Output")
Call DSLogInfo("System Returncode ":SystemReturnCode, "SysCode")
*
RETURN
10000