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 

Regarding length of records of variable length files

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


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Thu Jun 14, 2007 1:28 am    Post subject: Regarding length of records of variable length files Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Jun 14, 2007 4:20 am    Post subject: Reply with quote

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
View user's profile Send private message
jajularamesh
Beginner


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Thu Jun 14, 2007 5:20 am    Post subject: Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Jun 14, 2007 6:02 am    Post subject: Reply with quote

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
View user's profile Send private message
jajularamesh
Beginner


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Thu Jun 14, 2007 8:55 am    Post subject: Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Jun 14, 2007 9:26 am    Post subject: Reply with quote

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
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Jun 14, 2007 10:57 am    Post subject: Reply with quote

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
View user's profile Send private message
jajularamesh
Beginner


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Thu Jun 14, 2007 11:22 pm    Post subject: Reply with quote

Thanks Phantom

I got the solution


Ramesh
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