MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Converting a Wrapped file to Unwrapped

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
svhgk
Beginner


Joined: 14 Feb 2006
Posts: 12
Topics: 5

PostPosted: Thu Sep 28, 2006 9:16 pm    Post subject: Converting a Wrapped file to Unwrapped Reply with quote

Hello,

I have a file with the following format.

Header - 50 bytes
Detail - 100 bytes
Trailer - 50 bytes.

This file is a sequential file with file type as FB 100 bytes record length. This file is wrapped using an assembler program into 80 byte record length file FB. This wrapping is typical to what happens when we switch the word wrap feature on in notepad. The 100 byte record will be split into 80+20 into 2 lines.

I need to unwrap this file.

I am planning to write a cobol program which will unwrap this. It will read the records from this wrapped file & then write it to a fixed byte file.

What I want to know is if the below logic will work:-

1. perform a READ on the input unwrapped file
2. write the READ record into an output FB 100 byte file.

Can I assume that when I perform a READ on the wrapped file it will return in the following way:-

1st READ - return the Header record
2nd READ - returns the Detail record
3rd READ - returns the Trailer record.

Please correct me if I am wrong.

Thanks,
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Fri Sep 29, 2006 1:31 pm    Post subject: Reply with quote

Your step 1 says "read unwrapped file". Are you reading the wrapped file or an unwrapped copy?

If reading the wrapped file of 80 bytes records, thats what you'll get on each read. It would take two reads to piece together a 100 byte record.
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Fri Sep 29, 2006 1:38 pm    Post subject: Reply with quote

Such questions could be better illustrated with an example:

Say if

Code:


RECORD1AAAAAAAAAAAAAA  < spaces for renaming bytes until 80>
RECORD2



Do you want RECORD2 to be appended starting from the 81st byte (or) do you want it to be appended at the end of the last non-blank character in the text.
________
volcano vaporizer
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group