View previous topic :: View next topic
|
Author |
Message |
Ruchir Singh
New User
Joined: 15 Oct 2008 Posts: 2 Location: Delhi, India
|
|
|
|
There has been a change in the layout of OLD-FIELD from 10 level to NEW-FIELD which is now 88 level. Permissible values of OLD-FIELD are now in 88 level NEW-FIELD.
OLD: 10 OLD-FIELD 9(9).
NEW: 88 NEW-FIELD VALUE 00000300
00000301
00000302
00000303.
What changes will I have to make to this IF statement:
OLD: IF OLD-FIELD='00000302'
DO SOMETHING
ELSE-IF OLD-FIELD='00000303'
DO SOMETHING
...
NEW: ?? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
If I understood corectly what is being asked, just change "OLD-FIELD" to "NEW-FIELD" in that IF construct. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
if you want to do A for 302
and B for 303,
you need to leave the old construct.
otherwise IF NEW-FIELD will be true for 300 & 301 & 302 and 303.
by the way, even though COBOL allows you to compare a numeric display field to an x-type literal ('00000302')
you should get in the practice of using numeric literals.
plus, why go to all the problem of providing leading zeroes on a literal
and the value clause of the 88 level,
if you don't put enough of them on?
granted, 00000302 is the same as 000000302 and 302,
but if the pic clause calls for 9 digits,
don't confuse people by using 8 digits in your literal and value clauses. |
|
Back to top |
|
|
Ruchir Singh
New User
Joined: 15 Oct 2008 Posts: 2 Location: Delhi, India
|
|
|
|
Thanks for the inputs.
Leading zeros is a requirement for preserving my file structure. I missed a leading zero in values, apologies. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Leading zeros is a requirement for preserving my file structure |
WTFAYTA? (what are you talking about?)
the file structure is defined by your pic and usage clauses.
has nothing to do with value clauses.
so, what IF construct are you going to use? |
|
Back to top |
|
|
|