Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Read and Write in Variable length Record Files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sateeshk

New User


Joined: 06 Mar 2005
Posts: 5

PostPosted: Sun Mar 06, 2005 4:08 pm    Post subject: Read and Write in Variable length Record Files
Reply with quote

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

mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Mar 07, 2005 12:11 am    Post subject:
Reply with quote

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

New User


Joined: 06 Mar 2005
Posts: 5

PostPosted: Mon Mar 07, 2005 8:17 pm    Post subject: About copy books
Reply with quote

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

Site Admin


Joined: 18 May 2003
Posts: 1199
Location: India

PostPosted: Tue Mar 08, 2005 12:23 am    Post subject: Re
Reply with quote

Dear Sateeshk,

Please CREATE a NEW TOPIC TO POST YOUR QUERIES or read the FORUM RULES. Here is the link:

http://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
View user's profile Send private message
sateeshk

New User


Joined: 06 Mar 2005
Posts: 5

PostPosted: Tue Mar 08, 2005 10:16 am    Post subject: Re: Read and Write in Variable length Record Files
Reply with quote

Thanks for ur suggestion but another doubt where to declare that REC-LEN variable in FD section of file or separatly.
Back to top
View user's profile Send private message
sateeshk

New User


Joined: 06 Mar 2005
Posts: 5

PostPosted: Tue Mar 08, 2005 10:16 am    Post subject: Re: Read and Write in Variable length Record Files
Reply with quote

Thanks for ur suggestion but another doubt where to declare that REC-LEN variable in FD section of file or separatly.
Back to top
View user's profile Send private message
brahmanandareddy

New User


Joined: 16 Dec 2004
Posts: 44
Location: Hyderabad

PostPosted: Tue Mar 08, 2005 12:47 pm    Post subject:
Reply with quote

Hi,

U have to declare it in working-storage section.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 10 Fri Aug 18, 2017 10:50 am
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us