IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Read and Write in Variable length Record Files


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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: 1210
Location: India

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

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

New User


Joined: 06 Mar 2005
Posts: 5

PostPosted: Tue Mar 08, 2005 10:16 am
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top