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
 
Moving INDEX Variable to working stotage variable.

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

New User


Joined: 21 Sep 2005
Posts: 79
Location: India

PostPosted: Tue Jan 17, 2006 3:08 pm    Post subject: Moving INDEX Variable to working stotage variable.
Reply with quote

Hi,

Is there a way to MOVE the value of Index Variable (on used in index by clause) to a working storage variable having PIC S9(4) COMP?
Back to top
View user's profile Send private message

umeshkmrsh

New User


Joined: 21 Sep 2005
Posts: 79
Location: India

PostPosted: Tue Jan 17, 2006 4:39 pm    Post subject:
Reply with quote

Hey guys.

One way is:

Code:
01 A OCCURS 10 TIMES INDEXED BY IDX-A
    05 AA PIC X(10).
01 WS-AREA.
    05 WS-IDX-GRP-1.
         10 WS-IDX-TEMP       PIC INDEX
    05 WS-IDX-GRP-2.
         10 WS-IDX                PIC S9(06) COMP.

----
PROCEDURE DIVISION.

SET WS-IDX-TEMP TO IDX-A.
MOVE WS-IDX-GRP-1 TO WS-IDX-GRP-2.
DISPLAY WS-IDX.


OR

Code:
01 A OCCURS 10 TIMES INDEXED BY IDX-A
    05 AA PIC X(10).
01 WS-AREA.
    05 WS-IDX-GRP-1.
         10 WS-IDX-TEMP       PIC INDEX
    05 WS-IDX-GRP-2 REDEFINES WS-IDX-GRP-1.
         10 WS-IDX                PIC S9(06) COMP.

----
PROCEDURE DIVISION.

SET WS-IDX-TEMP TO IDX-A.
DISPLAY WS-IDX.


OR

Code:
01 A OCCURS 10 TIMES INDEXED BY IDX-A
    05 AA PIC X(10).
01 WS-AREA.
    05 WS-IDX-GRP-2.
         10 WS-IDX                PIC S9(06) COMP.

----
PROCEDURE DIVISION.

SET WS-IDX TO IDX-A.
DISPLAY WS-IDX.


Corrections welcome.
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 IDCAMS RENAMING VSAM FILE ALONG WITH ... upendrasri JCL & VSAM 11 Tue Apr 17, 2018 10:42 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts REXX LISTDSI () SMSINFO is not working upendrasri CLIST & REXX 4 Fri Nov 17, 2017 11:33 am

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