IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

accessing a table with SSrange ON.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
counto

New User


Joined: 30 Jun 2005
Posts: 1

PostPosted: Thu Jun 30, 2005 4:48 am
Reply with quote

Hi,

I have the following array:

01 WS-LINE-TABLE.
05 WS-LINE-SWITCH OCCURS 7 TIMES.
07 WS-LINE-SW PIC X.

With SSrange ON is it possible for me to access all the occurences of WS-LINE-SW ? I mean, will the following line of code work?

MOVE WS-LINE-SW (var-1) TO var-2 ?

Or would i need to access it by:
MOVE WS-LINE-SWITCH (var-1) TO var-2.

Thanks.
Back to top
View user's profile Send private message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Sun Jul 03, 2005 3:04 am
Reply with quote

Quote:
all the occurences of WS-LINE-SW


WS-LINE-SW is not an array. Then how you got occurances??

MOVE WS-LINE-SW (var-1) TO var-2

Error.

MOVE WS-LINE-SWITCH (var-1) TO var-2

It's ok. If you code SSRANGE, then you will get an error message at runtime only if var-1 > 7. Otherwise (SSRANGE Off) you will get Junk value in Var-2.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Jul 05, 2005 12:15 am
Reply with quote

WS-LINE-SW is part of the array because it is subordinate to
WS-LINE-SWITCH.
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Mon Aug 08, 2005 4:59 pm
Reply with quote

SS range is used only just 2 check the out of boundary conditions so what u have specified there will will work as long as its with in the array limit
Back to top
View user's profile Send private message
atik

New User


Joined: 29 Jul 2005
Posts: 20

PostPosted: Wed Aug 10, 2005 4:41 pm
Reply with quote

MOVE WS-LINE-SW (var-1) TO var-2
can be used.
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Wed Aug 10, 2005 5:58 pm
Reply with quote

It will work definitely we cna move value like that as u specifed
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top