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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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