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
 

 

how to read variable length records

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

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Fri Jan 20, 2006 9:35 am    Post subject: how to read variable length records
Reply with quote

i want to read variable length records in cobol pleasse help me with small example.

e.g
i/p
1111laxmi20000
2222rahulgupta15000
3333kumarrohan25000

want o/p like
1111 laxmi 20000
2222 rahulgupta 15000
3333 kumarrohan 25000

thanx in advance..
regard..
manjinder
Back to top
View user's profile Send private message

gowtham_1982
Warnings : 1

Active User


Joined: 02 Dec 2005
Posts: 109

PostPosted: Fri Jan 20, 2006 10:43 am    Post subject: Re: how to read variable length records
Reply with quote

manjinder wrote:
i want to read variable length records in cobol pleasse help me with small example.

e.g
i/p
1111laxmi20000
2222rahulgupta15000
3333kumarrohan25000

want o/p like
1111 laxmi 20000
2222 rahulgupta 15000
3333 kumarrohan 25000

thanx in advance..
regard..
manjinder



hai Manjinder,

from your example above what i conclude is the first four bytes are going to be numeric.

you can move the first four bytes into the output file through reference modification. then you can insert a blank in the next position.

finally you can move the name.

then you check the character type for numeric.

if numeric, insert once again a blank space and move the remaining to the output file.

hope that this psuedo code helps you,

corrections welcomed..

gowtham
Back to top
View user's profile Send private message
nagendrat

New User


Joined: 18 Jan 2006
Posts: 5

PostPosted: Fri Jan 20, 2006 11:46 am    Post subject:
Reply with quote

Hi,

Please declare in the FD section as following:

FD inflie-name.
BLOCK CONTAINS n1 TO n2 RECORDS
RECORD CONTAINS m CHARACTERS
RECORDING MODE IS V.
File Section.

01 Variable.

02 Varaible1 Occurs X times depending on variable2......

Manjinder, Once try to code like this with ur data and let me know if I am anything gone wrong.

Hope this will work for u...........
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 Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm


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