Joined: 19 Feb 2005 Posts: 27 Location: hyderabad-ap-india
My dear friends i have the following doubt in Cobol..
1.What is meant by Reference Modofication..can anybody give me explaination with an example..
2. Where do we cannot use MOVE verb
a) OCCURS clause
b) USAGE is COMP
c) USAGE is POINTER
3. Can we use $ and Z together to a field?
4.What is INITIAL ? ( we use it program name).
quick reply is highly appriciated..
1) Ref/Mod allows you to reference any byte or bytes in a field of data when using a COBOL stmt, such as move. Some stmts don't allow its use. Check the stmt's description in the COBOL ref manual before using it. An example: Suppose you wanted to move bytes 4 thru 8 of frm-fld to positions 3 thru 7 of to-fld. The move stmt would look like this:
move frm-fld(4:5) to to-fld(3:5)
2) Where can we not use MOVE verb? C
Data is moved to and from POINTER data items via the SET stmt.
3) Can we use $ and Z together to a field? No $ is a floating fill char and serves a similar purpose to Z. If you code $$$$9.99 a value of 142.98 wotld print as $149.98 with 1 leading space; a value of .98 would print as $0.98 with 3 leading spaces.
So you see there's no reason to include Zs too.
4) What is INITIAL ? ( we use it program name). This tells the compiler to generate code that results in Working Starage being reinitialized whenever it is CALLed. That is the values you originally coded in the VALUE clauses in the pgm are reinserted in the data fields. This means that whatever values were there when the previous execution ended are overlaid and no longer available.