Comparison of two files in EBCDIC format

Hi boarders..
I have a file which is there in ASCII format. I convert it to EBCDIC format using the below code
import java.io.*;
public class DcollType {
static String readInput() {
    StringBuffer buffer = new StringBuffer();
    try {
     FileInputStream fis = new FileInputStream("CLR812AX_TST5000.txt");
     InputStreamReader isr = new InputStreamReader(fis, "ASCII") ;
     Reader in = new BufferedReader(isr);
     int ch;
     while ((ch = in.read()) > -1) {
          buffer.append((char)ch);
     in.close();
     return buffer.toString();
    } catch (IOException e) {
     e.printStackTrace();
     return null;
static void writeOutput(String str) {
    try {
     FileOutputStream fos = new FileOutputStream("ascii.bin");;
     Writer out = new OutputStreamWriter(fos, "Cp1047" );
     out.write(str);
     out.close();
    } catch (IOException e) {
     e.printStackTrace();
public static void main(String[] args){
String inputstr=readInput();
writeOutput(inputstr);
  Now once i produce this file, i need to compare this file, with another EBCDIC file.
This second EBCDIC file is got by converting the original ASCII file using Mainframe emulator tool.
I want the boarders help in wrting a code which will help me in comparing tw0 EBCDIC file's content byte by byte..

Eh? Just compare them. Since you're just comparing the bytes, you don't need a java.io.Reader; you just need a java.io.InputStream. (Or two, really.)
You've already shown you can handle this...just open two input streams, one for each file, and compare each byte, byte-by-byte. As soon as two bytes are not equal, you've shown that they're not the same. If you reach the end of both the files and all the bytes are the same, then they have identical contents (regardless of encoding).
Maybe you're being thrown by the encoding? It's really not relevant if you're just checking to see if the bytes are the same.

Similar Messages

  • How to covert EBCDIC format to ASCII in JMS Adapter??????????

    Hi All,
          I am developing one JMS to File scenario, in which JMS adapter will pick file which is in EBCDIC format from WebSphere MQ and send it to receiver file system by receiver file adapter. when i am trying this, i am getting file in EBCDIC format in receiver file system, but the file system is expecting data in ASCII format.
    Is there any options to encode the EBCDIC format to ASCII in Sender JMS Adapter or Receiver File Adapter.
    Thanks,
    Madhusudhan.

    Hi,
    It was Basis / Database / OS staff that configured this aspect of the connection, and I am afraid I do not have any more details.
    A Google search gave me the following from IBM Documentation on MQ Series:
    <a href="http://publib.boulder.ibm.com/infocenter/wsphelp/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/ucli_pqcfm.html">http://publib.boulder.ibm.com/infocenter/wsphelp/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/ucli_pqcfm.html</a>
    <b>MQSeries queue connection factory settings for application clients</b>
    CCSID
    The coded character set identifier for use with the WebSphere MQ queue manager.
    This coded character set identifier (CCSID) must be one of the CCSIDs supported by WebSphere MQ.
    Data type  String 
    For more information about supported CCSIDs, and about converting between message data from one coded character set to another, see the WebSphere MQ System Administration and the WebSphere MQ Application Programming Reference books. These are available from the WebSphere MQ messaging multiplatform and platform-specific books Web pages; for example, at <a href="http://www-3.ibm.com/software/ts/mqseries/library/manualsa/manuals/platspecific.html">http://www-3.ibm.com/software/ts/mqseries/library/manualsa/manuals/platspecific.html</a> , the    IBM Publications Center , or from the WebSphere MQ collection kit, SK2T-0730.
    hope this may be of some help
    Andrew

  • Urgent : Help required for logical comparison of two 2GB files.

    Large files need to be compared depending on Business logic. No byte to byte comparison to be done. It would require reference of data written at the start of the file at some other later part of the file too while comparing two files. File needs to be stored in memory while comparison is done. Kindly suggest some way out which would give best performance. Memory limitations are 256 MB RAM.

    File needs to be stored in memory while comparison is done.
    Memory limitations are 256 MB RAM.You have 4 GB of data. You have 256 MB of RAM to put it in. Obviously one of those two assumptions has to be changed. By the way, what is the XML connection for this question?

  • File writing in EBCDIC format

    Hi all,
    Is it possible to write in EBCDIC format in a file?if so,
    Pls provide me a sample code..

    Haven't looked at it, but it's possible that
    OutputStreamWriter supports EBCDIC
    as in
    PrintWriter pw = new PrintWriter( new OutputStreamWriter( new FileOutputStream( args[0] ), "EBCDIC" ));
    or perhaps some other constant. It's also possible that it doesn't.
    If not, you should examine the source code for OutputStreamWriter and write your own class that does what it does, only for EBCDIC. I don't recall that there's anyway to extend the built in OutputStreamWriter with new encodings, which seems like a silly thing for sun to have done, if that is the case.

  • Is there a download and convert in a single step option in the flashdownloader 2.6.8. add-on? I end up with two files, one downloaded original and one converted to my chosen format.

    Files are downloaded and only then encoded, so I end up with two files in the drive.

    That has been like that since Firefox 3.0 was released in June 2008 - 7 major version releases thus far with it like that and the developers haven't changed it - so I wouldn't count on it.
    When I want to save a duplicate bookmark, I just "grab" the website image in the Location Bar and drag it into the Bookmarks Sidebar, into the folder where I want it placed. On Windows and Linux, { Ctrl + B } opens the sidebar and then just drag.

  • Need help in writing data to a flat file in .csv format

    Hi All,
    could you please show with a sample example to write data in .csv format using UTL_file.
    The result of the refcursor i want to write to a file in .csv format.
    How can i achieve this.
    Thx

    Hi,
    There are two ways to acheive this.
    First and which I prefer is creating a SQL script which will generate csv file at the specified location in CSV format. And then this SQL script can be called from your cron job similar to how you call stored procedure. Following is pseudo code that can be used -
    set linesize 500
    set echo off
    set feedback off
    set prompt off
    set pagesize 0
    spool <name of the csv file>.csv
    <Your select statement>;
    spool offPut select statement delimiting columns you want to use with ','. E.g. following query should create a CSV file named as abc.csv with one record and 2 columns delimited by comma. First column is ENO and second column is ENAME.
    set linesize 500
    set echo off
    set feedback off
    set prompt off
    set pagesize 0
    spool abc.csv
    select ENO || ',' || ENAME from employee;
    spool offSecond, you can write a PLSQL procedure and then call this procedure from cron job. There is a generic procedure shared by BluShadow some time back which is a very good example for this. Please refer to following link for this solution -
    REF Cursor creating CSV files
    I will suggest to use first method above if possible since it will be faster and less complicated in my opinion. Second method is recommended for scenarios where select statement is created dynamically and cannot be written during development.
    Hope this solves your purpose.
    Cheers,
    Anirudha

  • How do I delete files from HFS+-formatted network drive

    Relevant system components:
    Very recent iterations of a MBA and MBP both running 10.7.4
    Cisco Linksys e4200v1 wireless router, FWver1.0.04
    Seagate 1.5 Tb FA GoFlex external drive
    Full-size, single partition reformated by DiskUtility to HFS+ (Mac extended volume, Journaled)
    Connected by USB to storage port on e4200
    Storage set to share at root with either Anon r&w access or admin level user acct.
    Demonstrated read and write access
    I have set up an external drive as above.  The drive is to be used to archive large amounts of uncommonly used data (not a backup) and then is backed up to crashplan+ off-site. 
    The drive came formatted as FAT32 (I believe.) As we still have one PC and all individual files are smaller than 4Gb, I set up the archive drive as formated out of the box. 
    Data was written to the drive without issue, backed upi off-site with no issue and accessed a couple times.
    The issue came when recently upgraded some itunes albums.  These albums had been previously removed from the library and from the computer and stored in the archive drive.  These albums were upgraded and redownloaded from apple generating a copy of the album data, but in a superior format (no-drm, greater sampling rate.) This made the archived files obsolete and generated a risk of mixing versions.  I decided to delete the obsolete files from archive.
    When I attempted to do this by selecting, right-clicking and chosing "move to trash"  I was prompted that this was not a "undo-able" action, suggesting that while I was selecting "move to trash," the action would not generate a copy in the trash.  Next I was prompted to enter my user and PW.  The only user and PW combo that would not cause the dialog to "shake it's head" at me, was my computer user-specific password.  The network or drive associated user and PW combos would not take.  When I entered my computer user and PW, it was accepted, but a dialog labeled "Trash" popped up with small font, reading "The operation can't be completed because you don't have permission to access some of the items."
    Trying to delete only a random selection of one or two files would not work. 
    I checked the drive permissions and was only able to see "You have custom access."  This is not modifiable.  I attempted to alter my access permissions from the router, but made no headway.  Again, I could read and write, as the router setup suggests, but not "modify," to use a windows term.
    Assuming, with little data, that the FAT32 was perhaps at issue I unmounted the network drive, connected it by USB and reformated as above.  After formating, I tried the same procedure with no change in outcome.
    I am nearly 100% sure that when the drive was connected by usb, I could delete to my heart's content, but not when it is connected via network.
    I will note that the drive is accessed by first connecting to the router, which the mac sees as a "PC."  This access can be controlled, but can be set to anon.
    When I connect I see two identically named folders.  One is a sharepoint folder and one is a volume.  They access the same data. Deleting thorugh either route has identical outcomes.
    As I am a complete newb to Macs, I am really not sure where I should even begin to look for access.  Should I bind my router access to my user acct?  Is this even doable? Can I reset permissions to this folder through the terminal?  Is this really a Cisco or Seagate issue? 
    Any knowledgable advice is appretiated.  I can do the speculating.

    Ugh.
    This is not an Apple issue.  This is a permission issue associated directly with the router.  No settings on the mac need to be touched to solve this issue.
    In this specific case, it was required that I enter into the router storage settings (192.168.0.1,) disable all anon access, save settings, log in as admin (or just r&w) PRIOR TO deleting the files, then delete the files.
    I was trying to enter login info AFTER trying to delete the files. Obviously, that didn't work.
    Anyway.  I hope this might help someone. 

  • How can I make the comparison of two string one by one

    Hello everyone,
    I am new in labview and I am stuck with the problem.
    I have a huge text file with a different pressure values at different ports. My goal is to find the mean value of two ports and finding the dP and from that value I have to find  max value of dP.For that please see the attached VI. and see the 1st case structure from that attched VI.This I already done.
    [I first case structure I compare the port 103 and port 115 ]
    Now what I did, it was for the 2 ports and now I want to make a calculation for the comparison of two ports but labview should do it automatically , for reference I attached the text file.
    [Now I want to compare 103 & 115,104 & 116, 105 & 117 automatically one by one]
    Please refer the 2 nd structure for that.( in first case structure I put the search 1D array function for finding the location of the port column but I have to write manually there the "Port 103", now what I want that The labview read automatically the port 103 , port 104 and calculate the mean value)
    It would be grateful if you can help me. 
    Solved!
    Go to Solution.
    Attachments:
    Final - Kopie.vi ‏35 KB
    Port module.txt ‏1 KB

    I tried cleaning up your code.  The subtraction is just as simple as doing it inside of the FOR loop.  Same for the Maximum value of each.
    The Out of Memory issue can be a hard one to nail down.  Things you can do is try to avoid extra memory allocations caused by resizing of your arrays, avoid duplicate computations that aren't needed, reduce the number of front panel objects, or just use smaller arrays.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Final - Kopie.zip ‏23 KB

  • Need to setup Premiere CS6 sequence for two file types with different field orders

    I have a client who has shot video for me using two cameras, one camera was set to progressive, and the other to interlaced upper field first. I need to use both file types in the edit and have been struggling to set up the sequence to get the best look for the end product, a DVD. I have several videos to do for her that were all shot in the same way, so I need a solution!
    I would appreciate help figuring out how to set up this work flow from beginning to end.
    Should I convert one of the files from the beginning so they match field orders before going into a sequence? Or do I just need to do some adjusting of the files once they are in the sequence? Is it just as simple as changing the transcode settings to favor the upper field first? I'm definitely having issues once the video is transcoded in Encore and you can see a lot of jagged edges and lines especially during movement. My client isn't happy and I've tried several workarounds, but to no avail.
    Here are the two file types I have:
    File extension: .MOV
    H.264, 1920x1080, Linear PCM, 16 bit little-endian signed integer, 48000 Hz, stereo
    FPS 29.97
    No Fields: Progressive Scan
    File extension: .MTS (my Mac finder can't read these files, but they are read in Premiere)
    Image Size: 1920 x 1080
    Frame Rate: 29.97
    Source Audio Format: 48000 Hz - compressed - 6 channels
    Pixel Aspect Ratio: 1.0
    Upper Field First
    I am using Adobe Premiere CS 6.0.2
    Encore 6.0.1
    Media Encoder 6.0.2.81
    I am running it on an iMac 27-inch, Mid 2011
    with Mac OS X Lion 10.7.5
    Processor  3.4 GHz Intel Core i7
    Graphics  AMD Radeon HD 6970M 1024 MB
    I've just been setting the sequence to match the .MOV files since they look much better than the .MTS files. I've done the opposite as well, setting the sequence to match the .MTS files and it doesn't seem to help. I've also changed the field order of the files once they are in the sequence by changing the field options and have tried converting the .MTS files in the Media Encoder, but nothing I've done has worked.
    Any help would be so appreciated! The client I have is a photographer, so she wasn't aware of this issue when she first shot these videos. So I have 10 videos with these issues I need to get back to her, hopefully issue free! I'm struggling as an editor because my last job I was using FCP and was working with videographers who knew what they were doing, so I've never faced such problems before. Plus I'm new to the Adobe software. Not a good combination. Please forgive me if I didn't give all the information you need. I will happily respond with whatever more information you may need to help me out!
    ~KTrouper

    I wonder if you could do your edit ignoring any visual issues of the interlaced footage but keeping the different sources separate ( checkerboard edit Vid 1/ Vid 2 )
    Lock it down then export the interlaced part of the edit as a Digital Intermediate.
    Maybe Export the other source as well to the same codec. DI
    Bring them back together in a New Sequence. You wold have to deal with the black spacing.

  • How to produce an XML file in OAGIS format ( for Vendor Master & Invoices)

    Hi Guys,
    I've requirement to produce an XML file in OAGIS format ( for Vendor Master & Invoices) under Oracle AP and PO.
    Any inputs?
    thanks.

    Not sure,you are looking for inbuild product to produce the OAG XML format, or trying to build custom one.
    If options is Inbuild Product, Oracle Exchange is yeh another product has such kind of capability. Refer this
    http://download-west.oracle.com/docs/cd/A97329_03/web.902/a88894/adx16orx.htm#1007387
    FOr second , check out these two document in metalink
    150083.1 XML Utilities
    123491.1 How To Insert XML Documents Into The Database And Validate Them Using PL/SQL ?
    Hope this will be help

  • Converting files into pdf format in java

    Hi all,
    How can we convert a file into PDF format in java?My application does the
    file upload, and I need the files to be converted into PDF format.
    The uploaded file can be of any type. How can I do this?
    Please give me some help.
    Thanks and regards,
    Sandeep.

    >
    How can we convert a file into PDF format in java?My application does the
    file upload, and I need the files to be converted into PDF format.
    The uploaded file can be of any type. ...>1) Write a class that will intelligently render a file of any type..
    2) ... (well, do '1' first, then after getting your Nobel prize for AI, come back and we'll talk)
    >
    Please give me some help.>Please review your requirement.
    BTW
    - PDF sucks. It is designed for printing, and I (for one) don't want to kill more trees, and have no printer.
    - This subject (convert file to PDF) has been discussed on the forums a bazillion times. Did you search the forums before asking your two (very closely related) questions?

  • Two Files merging using File adapter in Bpel 2.0

    Hi All,
    I have two different files (File 1 and 2) of same format(Two columns each)  , now i want to merge these two files using their data and form a consolidated file (File 3 with four columns).
    Please advise on how to make it possible using file adapter.
    Example:
    File 1 Format: A1 and A2 - are two columns of number and sring type
    File 2 Format : B1 and B2 - are two columns of number and string type
    Consolidated File 3 Format : A1 B1 A2 B2 - forming a single row if A1=B1 and also populating A2 and B2.
    Thanks
    Karthick.

    Hi Karthick,
    I would say read both files completely. Then create a transform and select both messages as an input creating one output. With XSLT it should not be too hard to combine the two inputs. You could loop on one file and then select each row from the other file. That output can be written to file.
    I don't know what triggers the process, but you could either let bpel be triggered by the polling on one file and read the other synchronously. Or read both files synchronously.
    Regards,
    Martien

  • Compare files in different formats but same order

    Java Developers,
    I have a serious problem here "Comparing two files"... in Java.
    We recieve 2 emails which talk about the same thing but not in the same format. one comes from my company and the other email comes from partner company. These 2 companies have their own standards and their own codes. so their emails do not match exactly.
    I should check whether the contents of these 2 files are same or not. Line by Line they r not at all same, entirely different formats as I mentioned earlier. but somewhere in between there will be same headers for eg: "Service Details" section . once u see that word in both the files then compare the fields under that section, check whether they r same or not. here also the fields are not the same, one says AB and another says '12' , I shud check whether they mean the same thing or not. We have a dictionary and a table which says AB ='12', Everyday we get around 200 sets of such matching emails. how to read them, how to process them and how to see whether they match or not.

    Also look at the java.util.regex package.
    Beyond that, "How do I write a program that does <complex requirements statement>?" is not an appropriate question for these forums. If you're totally stuck and don't know where to begin on that, then you're probably not qualified to do it. That's not intended as an insult, just a reality check.

  • IDVD: Files exported from iMovie 11, one works, one "Unsupported File Type : Unknown format"

    I used footage from the same camera (taken on the same weekend using the same settings) in several different iMovie "projects". All were shared from iMovie 11 as "File" using the quality setting "SD 480p".
    In Quicktime Player, all ".mp4" files will play and they show the following info in its inspector:
    Format: H.264, 854 x 480
                  AAC, 48000 Hz, Stereo (L R)
    FPS: 29.97
    One exported file will drag, drop, and burn in iDVD just fine. The other two files show the error "Unsupported File Type : Unknown format" as soon as I try and drag them into iDVD.
    The only difference I can find is that the one file that works is about 803MB, while the files that don't work are 1.87GB and 3.98GB.
    All files and the iDVD project are in the same folder on my startup volume. I've tried deleting com.apple.idvd but that didn't help. I've tried rebooting and starting the iDVD project from scratch but I get the same results.
    Mac OS 10.9.1
    iMovie 10.0.1
    iDVD 7.1.2
    Any ideas?

    Hello Bengt and thank you again for the replies.
    As I mentioned in my previous posts, I'm using iMovie 10.0.1 which has very limited quality adjustments. In every case I chose the smallest size, which iMovie 10.0.1 calls "SD 480p (854 x 480)". I used this same setting on all exports.
    I still have iMovie HD (6.0.4) and iMovie '11 (9.0.9) on my iMac so I tried both of them. In both cases, they could import only the file that works in iDVD. Both older versions of iMovie choked on the longer movies shared from iMovie 10.0.1.
    I have many many hours into the editing of these clips and I do not want to have to go back and redo everything in an older version of iMovie. Might I be better off going with a different DVD creation software? Or am I out of luck? Because I can't really change iMovie 10.0.1's export settings, I'm afraid there's nothing I can do to get it to export it as something that iDVD can use (really, I can't even tell why it's different and why iDVD doesn't like it).
    The software "WonderShare DVD Creator" has no issue with any of the files I've exported from iMovie 10.0.1.    

  • How to convert cXML dtd files into xsd format and use them into BPEL application

    Hi,
    In my BPEL application I have to use cXML dtd files by converting them into xsd format.
    I have used 'Microsoft Visual Studio' for converting cXML.dtd file into xsd format, for this 1 dtd file I am getting three xsd files (cXML.xsd, cXML1.xsd and cXML2.xsd).
    Please check this once and let me know
    1. why I am getting three xsd files for one dtd file,
    2. how can I use cXML.xsd file in my application, do I ll have to use all the three files in my BPEL app and
    3. what should I include in main xsd file (cXML.xsd) to import other two xsd files.
    kindly check this once and let me know your suggestions .
    Thanks

    Hi,
    While downloading the cXML dtd there will be example xml files. Using this xml's we can generate xsd.
    Regards,
    KANN.

Maybe you are looking for