having problem in transform EBCDIC to ASCII

38 views
Skip to first unread message

Chethan h.s

unread,
Feb 14, 2015, 6:46:47 PM2/14/15
to legsta...@googlegroups.com
Hi I am new to legstar 
my copy book layout is this 

 03   RECORD-KEY.
               05   CLIENT-NO           PIC  X(3).
               05   CLIENT-SUFFIX       PIC  X.
               05   LOAN-NO.
                   07   OUR-NO          PIC  X(6).
                   07   CK-DIG          PIC  X.
               05   REC-CODE            PIC  X.
               05   REC-NUMBER          PIC  999.

I have created the Java Beans and legstar RecordKey.java and RecordKeyHostToJavaTransformer.java 

When I am am trying to transform the host data into java beans by passing 4000 bytes 

I am unable to get the loan number I mean loan numbers are still in Host Format 

InputStream inputstream = new FileInputStream(path);
byte[] data  = new byte[4000];
int  bytesRead = inputstream.read(data);
System.out.println("bytesRead :: "+bytesRead);
while(bytesRead != -1) {
bytesRead = inputstream.read(data);
RecordKeyHostToJavaTransformer recordKeyHostToJavaTransformer = new RecordKeyHostToJavaTransformer();
RecordKey recordKey = (RecordKey)recordKeyHostToJavaTransformer.transform(data, "IBM037");
LoanNo loanNum = (LoanNo) (new LoanNoHostToJavaTransformer().transform(data, "IBM037"));
if(recordKey.getRecCode().equalsIgnoreCase("P")){
System.out.println(recordKey.toString());
System.out.println("loanNum-OurDigit"+ loanNum.getOurNo());
System.out.println("loanNum-ChkDigit"+ loanNum.getCkDig());
}
}
inputstream.close();




Saurabh Vora

unread,
Jun 17, 2015, 3:23:04 PM6/17/15
to legsta...@googlegroups.com
Hi Chetan,

Are you able to solve your issue? I am also new to legstar and not able to start anything. Can you please guide if you had resolve your query.

regards
Saurabh
Reply all
Reply to author
Forward
0 new messages