I am connecting to a mainframe file using a ftp stage and reading the
source file as "binary" as below settings
Data Representation Type : Binary
Check data against Metadata : Yes
Line Termination : No
Then I am reading the whole file as varchar(90) which is the total lenght of record in mainframe and then using conversion as below
FOR PIC X (01) :-
DataTypeEbcdicToAscii(FTP_MF_Data.VarRec[2,1])
FOR PIC S9(9) USAGE COMP:-Fmt(DataTypePicComp(FTP_MF_Data.VarRec[35,4]),"9'0'R")
This conversion is not working...any ideas what might be happening wrong?
Unable to Convert from Mainframe Binary to ASCII Type
Moderators: chulett, rschirm, roy
Re: Unable to Convert from Mainframe Binary to ASCII Type
What is the result you are getting? What was the result you were expecting? Or does the job not compile/execute?
When you view the file in a text editor, can you read the text portions? Or are they also in EBCDIC?
When you view the file in a text editor, can you read the text portions? Or are they also in EBCDIC?
Re: Unable to Convert from Mainframe Binary to ASCII Type
Sorry. missed the BINARY spec. So the entire file should be EBCDIC.
Don't convert the field (or any COMP / COMP-3 fields) from EBCDIC to binary. Do that ONLY to the text fields or display numeric fields.
The datatype for a binary numeric (PIC S9 COMP) field should be INTEGER (length could be 1 to 3). And Datastage shoud interpret this number correctly.
Don't convert the field (or any COMP / COMP-3 fields) from EBCDIC to binary. Do that ONLY to the text fields or display numeric fields.
The datatype for a binary numeric (PIC S9 COMP) field should be INTEGER (length could be 1 to 3). And Datastage shoud interpret this number correctly.