This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes reading variable block file    Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "reading variable block file    " Watch "reading variable block file    " New topic
Author

reading variable block file

Amar Naik
Ranch Hand

Joined: Sep 26, 2003
Posts: 43
Hi,

I have a variable block file which was transmitted from mainframe side.
When i browse the variable block file in mainframe i can see it as

!Line 1
!Line 2
!Line 3

but once we transmit the file in Unix box, the file contents appear as
!Line1!Line2!Line3

does java differentiate between variable block and fixed block files..
does java has separate API to read Variable block file
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24081
    
  15

I don't have the mainframe experience to know what a "variable block file" is, but if it's a random-access file with fixed-size records, then the class java.io.RandomAccessFile is what you want. If, on the other hand, those "!" marks divide lines or records, then you're just going to have to read the raw data and break the file into records by looking for "!" characters yourself.


[Jess in Action][AskingGoodQuestions]
bart zagers
Ranch Hand

Joined: Feb 05, 2003
Posts: 234
What does the mainframe use as line separator (carriage return, linefeed) and make sure it is the same as you expect (just linefeed I guess).
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2350

Originally posted by Amar Naik:
Hi,



but once we transmit the file in Unix box, the file contents appear as
!Line1!Line2!Line3



Do you ftp the files from mainframe to unix?

Regards, Jan


OCUP UML fundamental
ITIL foundation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reading variable block file
 
Similar Threads
scope problem
is it possible in java?
how to read lines from a file
Using a JDBC driver to read VSAM
Mainframe client