• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

reading variable block file

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Bartender
Posts: 2662
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
today's feeble attempt to support the empire
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic