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

88 level multiple value


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

New User


Joined: 15 Oct 2008
Posts: 2
Location: Delhi, India

PostPosted: Tue Apr 14, 2009 12:24 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Apr 14, 2009 2:41 pm
Reply with quote

If I understood corectly what is being asked, just change "OLD-FIELD" to "NEW-FIELD" in that IF construct.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Apr 14, 2009 2:54 pm
Reply with quote

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
View user's profile Send private message
Ruchir Singh

New User


Joined: 15 Oct 2008
Posts: 2
Location: Delhi, India

PostPosted: Tue Apr 14, 2009 3:16 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Apr 14, 2009 3:29 pm
Reply with quote

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
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts How to load to DB2 with column level ... DB2 6
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
Search our Forums:

Back to Top