View previous topic :: View next topic |
Author |
Message |
jajularamesh Beginner
Joined: 14 Apr 2006 Posts: 87 Topics: 33
|
Posted: Thu Jun 14, 2007 1:28 am Post subject: Regarding length of records of variable length files |
|
|
I have a variable length file in which four different type of records can come each type has different rec length.
Each of the four records maps to specific copy book and we have a filler in each of the copy book.
Now if i print the length of each record then length should be actual length of pariticar record without filler or A particular record type length will alway be fixed.
say record type1 has :225 charters leaving filler
will it be always 325(225+filler 100) for record type1 or it may be varying
Regards,
Ramesh(Venkata Apparao Jajula) |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Jun 14, 2007 4:20 am Post subject: |
|
|
jajularamesh,
Why do the copybooks defining the 4 types of records have FILLER's?
If you define a record structure (area) and put a filler on the end, the length of the record structure (area) will include the filler.
In the FD Section, all records defined for a file ORIGIN at (REDEFINES the) first record definition.
Quote: |
say record type1 has :225 charters leaving filler
will it be always 325(225+filler 100) for record type1 or it may be varying
|
it will never be varying, it will be 325.
The length is derived from the data description of the area. Thus, the length of can be determined at compile time.
The data description can not change during run-time, so the length will always be the same.
One use of the FUNCTION LENGTH or LENGTH OF special register in your code instead of a literal is so that you can change the area definition (object of the LENGTH Function) and recompile without having to change the code. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
jajularamesh Beginner
Joined: 14 Apr 2006 Posts: 87 Topics: 33
|
Posted: Thu Jun 14, 2007 5:20 am Post subject: |
|
|
Thanks Dick Brenholtz
Actually my reguirement is to generate millions of records by taking a set of 10 records.
As i am modifying the input file actual filler length is getting discarded and i am getting records with atleast a difference of 100 bytes (which is filler length) so i got the doubt whether we will be getting fixed lenth or not.
Actually Preserve on should be used before modifying a file.otherwise i am getting difference in lengths
Regards,
Venkata Apparao Jajula(Ramesh) |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Jun 14, 2007 6:02 am Post subject: |
|
|
jajularamesh,
Quote: |
Actually Preserve on should be used before modifying a file.otherwise i am getting difference in lengths
|
Preserve On/Off is ISPF.
you are talking copybooks, I assume the language is COBOL.
You READ files and WRITE/REWRITE records.
the definition of your record will determine the length of the record that you WRITE.
Are you trying to generate fixed or variable length records? Your first post indicated that you have a file with 4 types of records, each record type having a different length.
I still don't understand your including a FILLER in each copybook.
you might be interested in this link for generating test data that way you don't need to understand variable length files. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
jajularamesh Beginner
Joined: 14 Apr 2006 Posts: 87 Topics: 33
|
Posted: Thu Jun 14, 2007 8:55 am Post subject: |
|
|
See layout of each record type is different.
but for each record type filler is also present which of 100 bytes length.
when i edited the input data set then the actual length of the record types getting chaged.
Recordtype1:say 500 bytes
Recordtype1:say 600 bytes
Recordtype1:say 700 bytes
Recordtype1:say 800 bytes
So always for record type1 i should get as 500 bytes but i am not getting 500 bytes as i edited the dataset(i,e i deleted some of the from the input file)
when i used this file i am getting the mismatch in the length of the records.
But i could not understand the reson for getting different length for the same recordtype
Now i just copied some of the required records to another dataset using sort and when i ran the same program
Now i am getting the correct record length for a specfic recod type.
Recordtype1:say 500 bytes
Recordtype1:say 600 bytes
Recordtype1:say 700 bytes
Recordtype1:say 800 bytes
hope from this you can understand what the exact problem was |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Jun 14, 2007 9:26 am Post subject: |
|
|
jajularamesh,
What are you trying to do and how?
This is application programming forum.
Your first posts talks of copybooks with fillers.
Now you are talking about EDITing the file and having problems. With ISPEdit, Fileedit?
Please, determine what you have to do and how you want to do it.
Then post it in the proper forum. If you don't know or can't determine the problem, post it in PROBLEM DETERMINATION forum.
thx, _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
Phantom Data Mgmt Moderator
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Thu Jun 14, 2007 10:57 am Post subject: |
|
|
Jajularamesh,
Please be clear in what you are asking...If you are unable to explain your requirement, atleast tell us what you were trying to do and what happened ?
record length of any record (be it a copybook or a WS- group) depends on how it is defined. The layout could have "OCCURS DEPENDING ON <argument>" clause which may vary the length of the record at run time - depending on the count mentioned in the <argument>.
Does this answer your question ? If not, explain us clearly.
Thanks,
Phantom |
|
Back to top |
|
|
jajularamesh Beginner
Joined: 14 Apr 2006 Posts: 87 Topics: 33
|
Posted: Thu Jun 14, 2007 11:22 pm Post subject: |
|
|
Thanks Phantom
I got the solution
Ramesh |
|
Back to top |
|
|
|
|