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: 695
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: 8214
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 How to select record x+7 or x+2 based... JoAnn Kulcyk SYNCSORT 6 Tue Jan 16, 2018 10:49 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm

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