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
 

 

COBOL record question

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

New User


Joined: 06 Jul 2010
Posts: 12
Location: hyderabad

PostPosted: Wed Mar 09, 2011 10:38 pm    Post subject: Need to display the data in format
Reply with quote

Hi,

I have data in a file in the below format which does not have any specific record length. And I dont know the record length.

xx yyyyyy
xx yyyyyy
xx yyyyyyyy


spaces are present between xx and yyyyyyy

Need to logic in cobol to write the output in the below format:

xxyyyyyy
xxyyyyyy
xxyyyyyy

Could anyone pls let me know the exact logic in cobol.
Back to top
View user's profile Send private message

daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 646
Location: Pennsylvania

PostPosted: Wed Mar 09, 2011 10:48 pm    Post subject:
Reply with quote

I recognize this...

It is the hijack and piggyback maneuver
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Wed Mar 09, 2011 11:14 pm    Post subject:
Reply with quote

Do not post irrelevant questions to the end of a topic -- that's why you start new ones. I've split yours off.

You need to spend some time reading the COBOL manuals (link at the top of the page). If you do this reading, you will find that it is not possible in COBOL to access a file unless you know the record length. This is an absolute. Since you do not know the record length, what you want to do cannot be done. If you had a record length, you could read the entire record into a varaible and split it based on the space (using UNSTRING or reference modification or arrays).
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Mar 10, 2011 12:36 am    Post subject:
Reply with quote

I am not even sure if the beginner's section would be the appropriate place for this qustion.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Mar 10, 2011 1:59 am    Post subject:
Reply with quote

Hello,

Quote:
I have data in a file in the below format which does not have any specific record length.
I suspect not. . .

For the file you are reading i'll bet that every record does have a specific length. . .

What created this file?

Once you take out the blank(s) what length should be used for the output data. The space-removed data is to be written into a file is it not?
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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm


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