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
 

 

Cobol Interview questions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
winner
Warnings : 2

New User


Joined: 17 Dec 2009
Posts: 3
Location: chennai

PostPosted: Sat Jan 30, 2010 12:44 pm    Post subject: Cobol Interview questions
Reply with quote

1)How to identify a particular letter is available or not in the word. Example: ‘E’ is available or not in “READ”
2)Two files of same record length, some records are in file 1 not in file 2 and vice versa. Write a logic in Cobol to put unique records in one file and other records in another file

My answer:

1 A) Move string to array and process array

2 A) Mater file ,transaction file control break logic


Can anybody help me in finding out the correct answers
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Sat Jan 30, 2010 7:56 pm    Post subject:
Reply with quote

1. Reference modification also works well.
2. The answer will depend upon whether or not the two files are sorted. If sorted, there is a sticky with a two file match merge that can be used.
Back to top
View user's profile Send private message
venki3

New User


Joined: 20 Jan 2010
Posts: 3
Location: Chennai

PostPosted: Tue Feb 16, 2010 11:30 am    Post subject: Reply to: Cobol Interview questions
Reply with quote

How does reference modification help in checking whether a particular character is present or not in a given string?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Tue Feb 16, 2010 4:32 pm    Post subject:
Reply with quote

Reference modification allows you to look at each individual character of a given variable (note the terminology -- COBOL does not have strings, never has had them, and likely never will) to match another variable, literal, or whatever.
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Wed Feb 17, 2010 12:20 pm    Post subject:
Reply with quote

For 1 - we can use INSPECT also.

so if

Code:

01 ws-str pic x(10) value 'READ'.
01 ws-cnt pic 99.


then

Code:

inspect ws-str tallying ws-cnt for all 'E'


will give a non zero result.
Back to top
View user's profile Send private message
venki3

New User


Joined: 20 Jan 2010
Posts: 3
Location: Chennai

PostPosted: Wed Feb 17, 2010 5:31 pm    Post subject:
Reply with quote

Yes..even I was aware of only the 'INSPECT' option for identifying a particular letter is available or not in the word

Thanks,
Venkateswari
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm


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