Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8165
Location: East Dubuque, Illinois, USA

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: 8165
Location: East Dubuque, Illinois, USA

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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us