copybook ebcdic with files ascii cobol

One Star ase
One Star

copybook ebcdic with files ascii cobol

I must insert in oracle differents elements from files cobol.
The problem is that files are ascii with a big copy book !
I had imported the copy book into the copybook ebcdic in metada but the files cobol are ascii.
Thank you for your help.

Re: copybook ebcdic with files ascii cobol

If i really understand your need, you have your ebcdic file is in ascii format and you want to read this file.
If you know the line delimiteur in the file, use the tFileInputFilePositonal and extract fields as byte[]
If you don't know the line delimiter, to translate the ascii into ebcdic, you can use the tJavaFlex like this :
Begin part of tJavaFlex :
String fileNewName_tFileInputPositional_1= context.path_dir+"ebcdic2ascii.txt"; createFiletFileInputPositional_1 = new; is = new;

// Get the size of the file
long length = createFiletFileInputPositional_1.length();

// You cannot create an array using a long type.
// It needs to be an int type.
// Before converting to an int type, check
// to ensure that file is not larger than Integer.MAX_VALUE.
if (length > Integer.MAX_VALUE) {
// File is too large

// Create the byte array to hold the data
//byte[] bytes = new byte;
byte[] filler_1 = new byte;
byte[] password = new byte;
byte[] filler_2 = new byte;
byte[] retour_chariot=new byte;
// Read in the bytes
int offset = 0;
int numRead_1 = 0;
int numRead_2 = 0;
int numRead_3 = 0;
int numRead_n = 0;

/*while (offset < bytes.length
&& (, offset, bytes.length-offset)) >= 0) {*/

while (offset < length
&& (>= 0&& (>= 0&& ( >= 0 && ( >= 0){

main part of tJavaFlex :
//If you have for example the fields filler,password_e,filler_2
offset += numRead_1+numRead_2+numRead_3+numRead_n;
ascii2ebcdic.filler=new String(filler_1);
ascii2ebcdic.filler_2=new String(filler_2);

end part of tJavaFlex :

// Ensure all the bytes have been read in
if (offset < length) {
throw new IOException("Could not completely read file "+createFiletFileInputPositional_1.getName());

// Close the input stream and return bytes

Link the tJavaFlex out put to your output component.
Perhaps is not you are wanted. If so, please try to describe more your need with sample file and screenshots for examples etc