- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Cobol - 153 Subscript out of range
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-10-2006 05:05 AM
тАО11-10-2006 05:05 AM
10 RPT1-FIELD-NAME PIC X(25).
77 WS-RPT-SUB PIC 9(6) VALUE 1.
MOVE 'FFV DEPT ID/GL: ' TO
RPT1-FIELD-NAME(WS-RPT-SUB)
Thanks,
Alex
Solved! Go to Solution.
- Tags:
- COBOL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-10-2006 05:13 AM
тАО11-10-2006 05:13 AM
Re: Cobol - 153 Subscript out of range
Cobol array subscripts range from one (1) to n. What you show is only that the *initial* value of WS-PRT-SUB is one which would be valid if RPT1-GIELD-NAME is subordinate to an 'OCCURS' clause.
Addressing outside of the range of occurances that constitute an array (n < 1 or n > nbr_elements) will result in a fault.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-10-2006 06:28 AM
тАО11-10-2006 06:28 AM
Re: Cobol - 153 Subscript out of range
Could you explain that a little differently, maybe even show me how it should look? Thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-10-2006 06:45 AM
тАО11-10-2006 06:45 AM
SolutionConsider (in general):
01 MYTABLE.
03 MYCHARS OCCURS 5 TIMES.
05 CHAR PIC X(1).
...in memory, looks like:
[_][_][_][_][_]
1 2 3 4 5
...and thus we can say:
MOVE "h" TO CHAR(1).
MOVE "i" TO CHAR(2).
[h][i][_][_][_]
1 2 3 4 5
...but if we try:
MOVE "x" TO CHAR(6).
...we fault, because we have tried to write beyond the array bounds -- into memory that doesn't "belong" to us. Similarly, if we were to try:
MOVE "x" to CHAR(0).
Is that the explanation you wanted?
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-13-2006 10:32 AM
тАО11-13-2006 10:32 AM
Re: Cobol - 153 Subscript out of range
Thanks for the help.