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 - reference modificaion

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

New User


Joined: 23 Oct 2010
Posts: 5
Location: bangalore

PostPosted: Sun Oct 31, 2010 8:28 pm    Post subject: COBOL - reference modificaion
Reply with quote

any body can explain with simple examples of refernce modification[/b]
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: Sun Oct 31, 2010 9:57 pm    Post subject:
Reply with quote

Hello and welcome to the forum,

When posting a question it is rather important to post in the correct part of the forum. . .

I suspect the question has nothing to do with db2, so it has been moved to the COBOL part of the forum.

A subject of "COBOL" will get few replies. One needs to use a proper subject. . .

At the top of the page is a link to "IBM Manuals". The first of these is for COBOL. Read about reference modification in one of the Language Reference manuals and if you find something that is not clear, post what you found and your doubt. Someone will be able to clarify.

You might also consider the forum SEARCH (in the blue bar above) as there have been several topics about reference modification.
Back to top
View user's profile Send private message
HectorSam101

New User


Joined: 04 Nov 2010
Posts: 3
Location: IN

PostPosted: Sat Nov 06, 2010 2:22 pm    Post subject:
Reply with quote

01 WS-FIRST PIC X(05) VALUE 'FIRST'.
01 WS-SECOND PIC X(06) VALUE 'SECOND'.
01 WS-RESULT PIC X(11) VALUE SPACES.


MOVE WS-FIRST TO WS-RESULT
MOVE WS-SECOND TO WS-RESULT(6:6)

WS-RESULT --> FIRSTSECOND.

I used reference modification to place WS-SECOND at 6th position of WS-RESULT.

(6:6) --> (start-pos:length) ; length can be ignored if you are not concerned about it.. (start-pos : ).

This can be done otherway as well....
eg;
assuming WS-RESULT --> FIRSTSECOND

INITIALIZE WS-SECOND.
WS-SECOND --> ''

MOVE WS-RESULT(6:6) TO WS-SECOND
WS-SECOND --> SECOND

The same can be done with a numeric (9) field also.

hope this helps...
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm

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