IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Mismatch between input file and output file record length


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
tkirankumar

New User


Joined: 21 Nov 2007
Posts: 3
Location: chennai

PostPosted: Sun Apr 01, 2012 12:21 am
Reply with quote

Hi Friends,

I have a flat input file length 200 bytes. This file I am writing it to output file of length 230 bytes will I get any error.

Regards
Kiran
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Apr 01, 2012 1:01 am
Reply with quote

If you do it properly, it won't be a problem.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Apr 01, 2012 3:01 am
Reply with quote

Hello,

Once you have this running, suggest that the "extra" 30 bytes do not contain "junk". These bytes should contain the same value (i.e. spaces).
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Sun Apr 01, 2012 2:28 pm
Reply with quote

If your output file is 230 bytes (LRECL=230), you have also specified this lenght in your FD in your COBOL program. This is the reford-length you always write to this file. If you "use" only 200 of the 230 bytes, thats a program logic issue.
If you have an mismatch in the size between the program and the file, you will have a U4038 abend and File Status 39.
Assuming this is a RECFM=FB-file.
Why dont you just test this in your own environment!
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sun Apr 01, 2012 2:52 pm
Reply with quote

It does really depend upon what is hapenning between the read of a record and the write of that record. And file definitions. What happened when you tried? Giving this information will help us analyse your problem.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Apr 01, 2012 3:35 pm
Reply with quote

"will I get any error?" is a question for Beginners and Students.

It comes down to a Yes/No guess. Given that such a question was asked here, I'd "guess" the answer to the question is "Very Yes"*.

* With due apologies to Bootsy Collins and Bootsy's Rubber Band
Back to top
View user's profile Send private message
tkirankumar

New User


Joined: 21 Nov 2007
Posts: 3
Location: chennai

PostPosted: Mon Apr 02, 2012 8:51 pm
Reply with quote

Hi Friends,

Its an interview question asked in one of the interview. I wanted to know the different views and opnions. Thank you for your responses.

Regards
Kiran
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Apr 03, 2012 6:02 pm
Reply with quote

tkirankumar wrote:
I have a flat input file length 200 bytes. This file I am writing it to output file of length 230 bytes will I get any error.
As worded - there should not be any problem; provided everything else, such as FD definition (as Peter and Nic also indicate), is precisely correct.

And if this was the only question from the interviewer, you should have investigated a bit more.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top