ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  MainFrame  >>  IBM MainFrame  >>  COBOL
 
 


 

 
 COBOL interview questions  COBOL Interview Questions
 JCL interview questions  JCL Interview Questions
 CICS interview questions  CICS Interview Questions
 DB2 interview questions  DB2 Interview Questions
 IMS interview questions  IMS Interview Questions
 IDMS interview questions  IDMS Interview Questions
 Natural interview questions  Natural Interview Questions
 ADABAS interview questions  ADABAS Interview Questions
 REXX interview questions  REXX Interview Questions
 Assembler interview questions  Assembler Interview Questions
 CLIST interview questions  CLIST Interview Questions
 QMF interview questions  QMF Interview Questions
 MVS interview questions  MVS Interview Questions
 OS390 interview questions  OS390 Interview Questions
 OS 2 interview questions  OS 2 Interview Questions
 VSAM interview questions  VSAM Interview Questions
 QSAM interview questions  QSAM Interview Questions
 Sysplex interview questions  Sysplex Interview Questions
 IBM MainFrame AllOther interview questions  IBM MainFrame AllOther Interview Questions
Question
what is the advantage of sync class
 Question Submitted By :: Pratap
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is the advantage of sync class
Answer
# 1
The SYNCHRONIZED clause is sometimes used with USAGE IS 
COMP or USAGE IS INDEX items. It is used to optimize speed 
of processing but it does so at the expense of increased 
storage requirements.

Many computer memories are organized in such a way that 
there are natural addressing boundaries - such as word 
boundaries. If no special action is taken some data items 
in memory may straddle theses boundaries. This may cause a 
processing overhead as the CPU may need two fetch cycles to 
retrieve the data from memory.

The SYNCHRONIZED clause is used to explicitly align COMP 
and INDEX items along their natural word boundaries. 
Without the SYNCHRONIZED clause, data-items are aligned on 
byte boundaries. 

The word SYNC can be used instead of SYNCHRONIZED.

 
For the purpose of illustrating how the SYNCHRONIZED clause 
works let us assume that a COBOL program is running on a 
word-oriented computer where the CPU fetches data from 
memory a word at a time. 

01 three-byte pic x(3) value 'dog'.
01 two-byte   pic s9(4) comp .

In this program we want to perform a calculation on the 
number stored in the variable TwoBytes (as declared in the 
diagram below). Because of the way the data items have been 
declared, the number stored in TwoBytes straddles a word 
boundary. 

In order to use the number, the CPU has to execute two 
fetch cycles - one to get the first part of the number in 
Word2 and the second to get the second part of the number 
in Word3. This double fetch slows down calculations. 


01 three-byte pic x(3) value 'dog'.
01 two-byte   pic s9(4) comp sync .

Now consider the impact of using the SYNCHRONIZED clause. 
The number in TwoBytes is now aligned along the word 
boundary, so the CPU only has to do one fetch cycle to 
retrieve the number from memory. This speeds up processing 
but at the expense of wasting some storage (the second byte 
of Word2 is no longer used).
 
Is This Answer Correct ?    5 Yes 1 No
Rajini
 

 
 
 
Other COBOL Interview Questions
 
  Question Asked @ Answers
 
how to transfer the file from pc to mainframe??  2
1.What is the limit of linkage section?  3
I got user abend U4038 while compiling my runjcl.. can anyone help me?  8
how many bytes do SPPPP999 will store?  17
what are the limitations of Inline Perform? Zensar3
What is Static,Dynamic linking ?  1
What is SET TO TRUE all about, anyway?  4
We are using the searching a table which is indexed, once the key is found, how can we get the occurance at which the key was found.  1
consider the following two statements MOVE 10 TO N PERFORM PARA-X N TIMES STOP RUN PARA-X MOVE 5 TO N how many times PARA-X willbe exicuted? a.10 b.5 c.infinate d.execution error TCS3
01 ws-p pic 9(2). 01 ws-q pic 9(2) value 01. 01 ws-r pic 9(2) value 99. p.d. compute p = q + r what will be result of p ans(00) but my question is that how i got 10 on the place of 00. (truncation will ocuure on right side not left). please tell me ? L&T5
How to retain the Duplicates in the one records? CS3
How is sign stored in a comp-3 field?  4
What are the two search techniques ?  2
01 MOVE 10 TO N 05 PERFOM PARA1 TIMES STOP RUN WAT WILL HAPPEN?? WILL IT RUN INFINITELY OR AN ERROR WIL BE THER BECAUSE NO OF TIMES IS NOT GIVEN??  1
I have a sequential file of 100 records. How do I load the records into a two dimensional array ? Xansa2
How we copy a program from production region to development region.What is the process & syntax ?  3
1.Can we define condition-name conditions in FD entry.  9
What is the Linkage section? What is the Use and Why the parm length use alway "PARM-LENGTH PIC S9(4) or PIC S9 (4) COMP." any reason?.Please let me know any one... Cheers,Prasad Syntel5
How many sections are there in data division?.  4
How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.  3
 
For more COBOL Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com