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

how to read variable length records


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
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
Search our Forums:

Back to Top