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

Cobol Interview Questions


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
saidharrao
Warnings : 1

New User


Joined: 19 Feb 2005
Posts: 27
Location: hyderabad-ap-india

PostPosted: Sun Mar 20, 2005 8:51 pm
Reply with quote

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
d) NONE
3. Can we use $ and Z together to a field?
4.What is INITIAL ? ( we use it program name).
quick reply is highly appriciated..

thanking you,
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Mar 20, 2005 11:09 pm
Reply with quote

Hi Saidhar,

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.
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top