View previous topic :: View next topic
|
Author |
Message |
sateeshk
New User
Joined: 06 Mar 2005 Posts: 5
|
|
|
|
I want to read a variable length record file and write into another variable length record file.But before going to write into a target variable length record file i want to find the lengh of record which i am going to write is there any way to find it if so suggest me.(I know that the length of record will be stored in some register PSW but i am not sure about that) |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi sateeshk,
In both the I/P and O/P FDs code the following:
Code: |
RECORD VARYING FROM x TO y
DEPENDING ON REC-LEN
where, x = the length of the smallest record possible in the file
y = the length of the largest record possible in the file
|
Remember that the LRECLs you use in your JCL must be 4 bytes greater than the "y" specified in the "RECORD VARYING" clauses of your COBOL pgm.
In WS code:
Code: |
05 REC-LEN PIC 9(008) COMP.
|
When you read the I/P rec in your pgm the length of the rec you just read is put into REC-LEN: when you write the rec to your O/P file REC-LEN is used to determine how many bytes to write to O/P.
If you wanted to change the length of a rec just read you'd make the changes and recalculate the value of REC-LEN and repopulate it before you write the O/P rec. |
|
Back to top |
|
|
sateeshk
New User
Joined: 06 Mar 2005 Posts: 5
|
|
|
|
I have a copy book and i want to know all the users who all acessing. Is there any way to find it. |
|
Back to top |
|
|
mcmillan
Site Admin
Joined: 18 May 2003 Posts: 1210 Location: India
|
|
|
|
Dear Sateeshk,
Please CREATE a NEW TOPIC TO POST YOUR QUERIES or read the FORUM RULES. Here is the link:
www.ibmmainframes.com/viewtopic.php?t=12
The Three Rules you must Follow here to protect your membership:
1. START A NEW TOPIC TO POST YOUR QUERIES.
2. POSTS ARE TO BE MADE IN RELEVANT FORUM.
3. USE MEANINGFUL NAME FOR YOUR TOPICS. |
|
Back to top |
|
|
sateeshk
New User
Joined: 06 Mar 2005 Posts: 5
|
|
|
|
Thanks for ur suggestion but another doubt where to declare that REC-LEN variable in FD section of file or separatly. |
|
Back to top |
|
|
sateeshk
New User
Joined: 06 Mar 2005 Posts: 5
|
|
|
|
Thanks for ur suggestion but another doubt where to declare that REC-LEN variable in FD section of file or separatly. |
|
Back to top |
|
|
brahmanandareddy
New User
Joined: 16 Dec 2004 Posts: 44 Location: Hyderabad
|
|
|
|
Hi,
U have to declare it in working-storage section. |
|
Back to top |
|
|
|