View previous topic :: View next topic
|
Author |
Message |
sm_2009
New User
Joined: 10 May 2009 Posts: 72 Location: bangalore
|
|
|
|
hi
i have declared an array as:
Quote: |
05 ws-count pic 99 value zeroes
05 tab-contents occurs 10 times
10 tab-no pic 9(2) value zeroes.
10 tab-desc pic x(10) value spaces.
|
this is part of input file.
i do processing of this array with a subscript varing 1 by 1 until sub > ws-count
i have included a checking in pgm as to check for ws-count is less than equal to 10 , then do processing.
but when i give 11 in input file, and submit jcl, it shows the error msg in sysout but abends.
how can i avoid the abend and it will not allow to key in 11 for ws-count |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Compile option SSRANGE will help. Be aware that it imposes a performance penalty at run-time, though. |
|
Back to top |
|
|
sm_2009
New User
Joined: 10 May 2009 Posts: 72 Location: bangalore
|
|
|
|
if i declare the variable as
05 ws-count-a.
10 count-pr pic 99.
88 count-t value 1 thru 10.
it giving error as "count-t" was defined as a type that was invalid in this context. The statement was discarded.
whts the reason??? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
sm,
Quote: |
...was invalid in this context... |
refers to the procedure division statement that contains the reference COUNT-T.
so, what procedure division statement contained the reference?
also, cut&paste the entire error message from your compiler listing
and we will show you how to find your errors. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Change your WS definition -
Code: |
05 WS-COUNT PIC 9(04) COMP.
05 WS-COUNT-MAX PIC 9(04) COMP.
05 TAB-CONTENTS-REC.
10 TAB-CONTENTS OCCURS 10 TIMES.
15 TAB-NO PIC 9(02) VALUE ZERO.
15 TAB-DESC PIC X(10) VALUE SPACES.
MOVE 1 TO WS-COUNT.
DIVIDE LENGTH OF TAB-CONTENTS-REC BY LENGTH OF TAB-CONTENTS (1) GIVING WS-COUNT-MAX.
|
After the calculation, WS-COUNT-MAX will equal 10 and can be used against WS-COUNT to measure the maximum. If the OCCURS changes in the future, then the calculation will always be correct. Try to always use binary-variables for subscripts, either halfwords (as illustrated) or fullwords (PIC 9(08) COMP). Indices are the better way to go. Display-Numeric subscripts should be avoided.... |
|
Back to top |
|
|
sm_2009
New User
Joined: 10 May 2009 Posts: 72 Location: bangalore
|
|
|
|
hi all thanks
just one more query
i have used a check for ws-count in program as
if ws-count > 10
display 'wrong data entered'
perform error-para
else
continue
end-if
i have keyed in '11' in input file for ws-count.
whn i submit jcl, its displaying error message but the job is abending with U0963. what may be the reason.
[/quote] |
|
Back to top |
|
|
sm_2009
New User
Joined: 10 May 2009 Posts: 72 Location: bangalore
|
|
|
|
issue resolved, no abend |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thanks for letting us know
d |
|
Back to top |
|
|
|