View previous topic :: View next topic
|
Author |
Message |
tkirankumar
New User
Joined: 21 Nov 2007 Posts: 3 Location: chennai
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you do it properly, it won't be a problem. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Peter cobolskolan
Active User
Joined: 06 Feb 2012 Posts: 104 Location: Sweden
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
"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 |
|
|
tkirankumar
New User
Joined: 21 Nov 2007 Posts: 3 Location: chennai
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
|