Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Will the variable POS in the following code have a value of
2 or not?

01 POS PIC S9(4) COMP VALUE 2.
01 FIRST-NAME PIC X(10) VALUE 'ABC'.
01 LAST-NAME PIC X(10) VALUE 'XYZ'.
01 NAME PIC X(20) VALUE SPACES.

STRING FIRST-NAME DELIMITED BY SPACES
' ' DELIMITED BY SIZE
LAST-NAME DELIMITED BY SPACES
INTO NAME
WITH POINTER POS

Answers were Sorted based on User's Feedback



Will the variable POS in the following code have a value of 2 or not? 01 POS PIC S9(4) COMP VAL..

Answer / shobhit garg

No, It wont have value 2. rather value of POS will be 9.

Pointer specifies the number of non blank characters moved
to the receiveing string ( in our case its NAME).

So FIRST-NAME will return 3 bytes then a space then LAST-
NAME will return 3 bytes means overall 7 bytes.

Since our POS varibale starts from 2 , so overall count for
POS will be 2 + 7 = 9

Is This Answer Correct ?    7 Yes 0 No

Will the variable POS in the following code have a value of 2 or not? 01 POS PIC S9(4) COMP VAL..

Answer / jyoti prakash

total no in pos field is 9 byte

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

I have a files containing both duplicate and non-duplicate records.The file is already sorted by a key.I want to determine those records that are duplicate and records that are non-duplicate.If duplicate the record is move to a duplicate file and if non-duplicate that will be move to valid file.thank you

1 Answers  


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

0 Answers  


S9(5)V9(2) occupies how many bytes memory ?

6 Answers   Cap Gemini,


input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.

0 Answers  


What are some examples of command terminators?

1 Answers  


What is the default value of DISP parameter?

3 Answers   IBM,


Which of the following files can be OPENed in all the 4 modes? The four modes are INPUT, I-O, OUTPUT and EXTEND. (a) INDEXED (b) RELATIVE (c) SEQUENTIAL (d) All of the above

7 Answers   TCS,


How to covert given string into ASCII value in COBOL/MF COBOL

3 Answers   CTS, IBM, iFlex,


what r the types of perform statement

4 Answers  


How to read the last 100 records from a COBOL file. The file contains N number of records.

11 Answers   IBM,


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

0 Answers  


In COBOL, what is the different between index and subscript?

0 Answers   TryTechnicals Pvt Ltd,


Categories