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
 
Reference modification for one dimentional table

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

New User


Joined: 06 May 2007
Posts: 16
Location: pune

PostPosted: Fri May 25, 2007 2:48 pm    Post subject: Reference modification for one dimentional table
Reply with quote

Hi,
i have one table defined as
WS-DEBITOR-TABLE PIC X(150) OCCURS 1000 TIMES INDEXED BY DEBITOR-IDX

In this case can I use a reference modification to select the perticular string like

WS-DEBITOR-TABLE(DEBITOR-IDX)(20:24)

Please tell me its very urgent

thanks
Back to top
View user's profile Send private message

agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Fri May 25, 2007 3:10 pm    Post subject: Re: Reference modification for one dimentional table
Reply with quote

Quote:
Please tell me its very urgent

It is strange when people say it is urgent and WASTE a lot of their time by expecting answers from others.
Even I had not used such reference modification before but it took me just 2 minutes to test it with simple program.
Code:
 
  01 TEXT-VAR PIC X(10).
  01 TEMP1.                       
      05 V1 PIC X(10) OCCURS 10 TIMES.
 PROCEDURE DIVISION.               
      MOVE 'ABHIJIT' TO V1(1).     
      MOVE 'K' TO V1(2).           
      MOVE V1(1)(1:7) TO TEXT-VAR
      DISPLAY TEXT-VAR.           
      STOP RUN.   

I got it running so answer to your question should be YES.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri May 25, 2007 4:13 pm    Post subject: Re: Reference modification for one dimentional table
Reply with quote

adarsh.bhalke wrote:
can I use a reference modification to select the perticular string
Why would you think you couldn't?
Personally, I keep forgetting what must come first, the RM or the subscript....when I get wrong, the compiler corrects me.... icon_redface.gif
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 965
Location: Richmond, Virginia

PostPosted: Fri May 25, 2007 5:28 pm    Post subject:
Reply with quote

Here's how to remember: the refmod acts on a character string. A table name sans subscript or index is not a character string, and by itself elicits a compiler error, hence the refmod follows the sub/idx.
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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts PC (UTF-8) -> z/OS (EBCDIC) -> ... prino All Other Mainframe Topics 4 Fri Sep 01, 2017 1:47 am

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