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
 
Query on cobol

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

Active User


Joined: 14 Sep 2009
Posts: 166
Location: Coimbatore

PostPosted: Tue Jul 27, 2010 11:08 pm    Post subject: Query on cobol
Reply with quote

Hi,

I have 2 records like,

Code:
record1: Abdul       rafi            went to      madras

record2: Cts  tcs         csc  Accenture


In both the records, I need to append a data soon after the final word ends. So the output should look like this, Note that the space between each word is not equal.

Code:
record1: Abdul       rafi            went to      madrasAmerica

record2: Cts  tcs         csc  AccentureAmerica

Could anybody help me how I can resolve this.
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: Tue Jul 27, 2010 11:23 pm    Post subject:
Reply with quote

Hello,

The "Code" tag is your friend icon_smile.gif

To do what you want determine the last data position with a non-blank value in the record. Then, using Reference Modification, move the additional data to that position+1.
Back to top
View user's profile Send private message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 166
Location: Coimbatore

PostPosted: Tue Jul 27, 2010 11:36 pm    Post subject:
Reply with quote

It is to append that data and use it as files in jcl. there is a program which processes after that. but if i use reference modification i need the entire record in a working storage and then use it as a(1),a(2)....etc. Wont it be more complex?
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: Tue Jul 27, 2010 11:51 pm    Post subject:
Reply with quote

Hello,

Quote:
Wont it be more complex?
It shouldn't be. . .

No matter how you do this, you will need the entire record in your COBOL code.

You can "reverse" the data and look for the first non-blank or you can write a loop that looks at bytes from the back end until the first non-blank is found.

There is no reason to code (1) and (2) and (n). . .

Now is probably a good time to become familiar with our forum SEARCH feature (in the blue line above). There are multiple topics in the COBOL part of the forum that deal with determining the first/last non-blank.
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
This topic is locked: you cannot edit posts or make replies. Issue in suppressing leading zeros &a... Vijay_Sirisha COBOL Programming 21 Thu Jun 07, 2018 8:01 pm
No new posts VBS to VB in COBOL and JCL srajendran2 COBOL Programming 12 Fri Jun 01, 2018 3:04 am
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts How to convert 2 bytes into single by... pkmurali DB2 6 Fri May 25, 2018 1:41 pm
No new posts SYSADATA - COBOL - Structure displace... ganasrinivasan COBOL Programming 3 Thu May 24, 2018 9:45 pm

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