Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Declare the variable with 88 level

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
mahi

New User


Joined: 04 Apr 2006
Posts: 86
Location: Pune

PostPosted: Wed Aug 27, 2008 1:30 pm    Post subject: Declare the variable with 88 level
Reply with quote

Hi...

IN my detail ercord I have a record type field and some other fields.
in working storage I have declared.

05 sw-hdr-type-ldc pic x.
88 hdr-type-ldc value '1'.
05 ldc-name
05 ldc-cntr

So while writing the output record Is it required to move '1' to the sw-hdr-type-ldc field. Or I can write it directly as i have given the value in the 88 clause.

What is the value if we declare the variable with 88 level as above.
Back to top
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Wed Aug 27, 2008 1:43 pm    Post subject: Reply to: Declare the variable with 88 level
Reply with quote

mahi,

Quote:
So while writing the output record Is it required to move '1' to the sw-hdr-type-ldc field


You can do either of these

- Move '1' to the 05 level field
- Set the 88 level variable to TRUE

Quote:
What is the value if we declare the variable with 88 level as above.


It will have the initialized value before you move anything to that field.
Back to top
View user's profile Send private message
mahi

New User


Joined: 04 Apr 2006
Posts: 86
Location: Pune

PostPosted: Wed Aug 27, 2008 3:20 pm    Post subject:
Reply with quote

Thank you Auru...

It wont contain the value '1' unless we move the value to it eventhough we are giving the value in the 88 level...Am I right?
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Wed Aug 27, 2008 3:22 pm    Post subject: Reply to: Declare the variable with 88 level
Reply with quote

Mahi,

Quote:
It wont contain the value '1' unless we move the value to it eventhough we are giving the value in the 88 level...Am I right?


Yep, you are correct.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8118
Location: East Dubuque, Illinois, USA

PostPosted: Wed Aug 27, 2008 5:14 pm    Post subject:
Reply with quote

An 88 level is a conditional check. You don't give a value in an 88 level, you specify the value(s) for which the condition is true. For example,
Code:
88  TEST-SWITCH  VALUE 10 THRU 19.
is valid and TEST-SWITCH will be TRUE any time the variable value is in the range 10 through 19; less than 10 or greater than 19 and TEST-SWITCH is FALSE.
Back to top
View user's profile Send private message
Selva-kumar

New User


Joined: 01 Mar 2007
Posts: 52
Location: chennai

PostPosted: Wed Aug 27, 2008 5:45 pm    Post subject: Reply to: Declare the variable with 88 level
Reply with quote

Hi,

You can declare the field in the following way.


Code:

05 sw-hdr-type-ldc pic x value '1'.
88 hdr-type-ldc value '<some other value>'.


if declared as such, the 05 field will have the value '1' by default and when you set hdr-type-ldc to true, the value in it will be moved to the 05 field.
Back to top
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Tue Sep 02, 2008 8:57 pm    Post subject: Evaluate clause
Reply with quote

Code:
01  WS-DRADDR-ST                PIC X(02) VALUE SPACES.       
    88 INVALID-ST               VALUE '  '.                                       --two spaces     
    88 VALID-ST                 VALUE  'WA', 'OR', 'NV' ,'CA' ,
          'UT', 'AZ', 'MT', 'WY', 'CO', 'NM', 'ND', 'SD', 'NE',
          'KS', 'OK', 'TX', 'MN', 'IA', 'MO', 'AR', 'LA', 'WI',
          'IL', 'MS', 'MI', 'IN', 'KY', 'TN', 'AL', 'OH', 'WV',
          'VT', 'NY', 'PA', 'VA', 'NC', 'SC', 'GA', 'FL', 'NB',
          'ME', 'CT', 'DE', 'MD', 'PE', 'NS', 'NH', 'MA', 'RI',
          'ID', 'NJ'.                                         


Can I use the Evaluate clause directly as follows?
Code:
EVALUATE WS-DRADDR-ST                       
     WHEN VALID-ST                     
         CONTINUE                     
    WHEN INVALID-ST                   
         MOVE 'ZZ'       TO DRADDR-ST
    WHEN OTHER                       
         MOVE 'ZZ'       TO DRADDR-ST
    END-EVALUATE.                         
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Tue Sep 02, 2008 9:02 pm    Post subject:
Reply with quote

You can.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Sep 02, 2008 9:28 pm    Post subject: Re: Evaluate clause
Reply with quote

It might be simpler with
Code:
EVALUATE WS-DRADDR-ST                       
     WHEN VALID-ST                     
         CONTINUE                     
    WHEN OTHER                       
         MOVE 'ZZ'       TO DRADDR-ST
    END-EVALUATE.                         
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us