Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 710
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: 8280
Location: Dubuque, Iowa, USA

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 Linkage editor is part of COBOL, z/OS... ankit.jain COBOL Programming 4 Fri Apr 20, 2018 4:17 pm
This topic is locked: you cannot edit posts or make replies. Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am
No new posts Call COBOL or PLI with a click from w... vaibhav gs All Other Mainframe Topics 1 Mon Apr 16, 2018 7:29 pm
No new posts VSAM - Accessing beyond record size Benchwarmer JCL & VSAM 6 Wed Apr 11, 2018 9:20 pm
No new posts COBOL MVS options BiswajitDG COBOL Programming 8 Fri Apr 06, 2018 12:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us