View previous topic :: View next topic
|
Author |
Message |
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
please avoid using local jargon or Your own language
since we take time to understand Your problem it would be nice on Your side to spare us the trouble of understanding and translating Your language
( crores, laks, and friends )
almost time to lock the topic, looks like it is going nowhere and is just wasting everybody' s time |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Enrico,
Does this mean I need to stop using using the "FWORD"?
Bill |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Naah !
IIRC the FWORD has been a standard term in IT jargon for a loong time
( HWORD, FWORD, DWORD, ... ) |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
enrico-sorichetti wrote: |
Naah !
IIRC the FWORD has been a standard term in IT jargon for a loong time
( HWORD, FWORD, DWORD, ... ) |
I've never heard a colleague use "fnord". Of course, I wouldn't |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Why not just run SUPERC or COMPAREX if you have that installed? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Bill O'Boyle wrote: |
To avoid going beyond an array HIBOUNDS, calculate this array-max up front in HOUSEKEEPING and use this max as your HIBOUNDS throughout the code. It will always be correct, regardless of the OCCURS.
Example -
Code: |
03 WS-FWORD PIC 9(08) COMP.
03 WS-ARRAY-REC.
05 WS-ARRAY-ENTRY OCCURS 100 TIMES
INDEXED BY X-WS-AE, X-WS-AE-MAX
PIC X(256).
DIVIDE LENGTH OF WS-ARRAY-REC BY LENGTH OF WS-ARRAY-ENTRY (1)
GIVING WS-FWORD.
SET X-WS-AE-MAX TO WS-FWORD.
|
Hard coding array-max's are for the birds....
Bill |
This is nice.
However, I'd like to have-my-cake-and-eat-it by also having the hard-coded max (maybe a "seed cake", for the birds).
Reason is, when someone comes along with the intention of changing the table, extending the occurs, and what they do is... just change the array-max... It would actually be nice if Cobol let you do that, or to get the max from the OCCURS clause, but it doesn't. Now, with your idea Bill, maybe we can cover that as well.
Code: |
03 WS-ARRAY-MAX PIC 9(08) COMP VALUE 100.
03 WS-FWORD PIC 9(08) COMP.
03 WS-ARRAY-REC.
05 WS-ARRAY-ENTRY OCCURS 100 TIMES
INDEXED BY X-WS-AE, X-WS-AE-MAX
PIC X(256).
DIVIDE LENGTH OF WS-ARRAY-REC BY LENGTH OF WS-ARRAY-ENTRY (1)
GIVING WS-FWORD.
IF WS-FWORD NOT EQUAL TO WS-ARRAY-MAX
report and gracefully collapse
END-IF
SET X-WS-AE-MAX TO WS-FWORD.
|
I know it might seem redundant, but it catches those times that the OCCURS should have been changed, but was not, and the max was. |
|
Back to top |
|
|
kunal jain
New User
Joined: 19 May 2011 Posts: 59 Location: India
|
|
|
|
Thank you all for your advice and suggestion.
I have got the clue of what can be the path to my solution.
I am very pleased to receive in-depth analysis and suggestion to my problem.
Thank you so much.. |
|
Back to top |
|
|
|