Automation Infotech
Tuesday, July 26, 2011
Dictionary Object
The Dictionary object stores name/value pairs (referred to as the key and item respectively) in an array. The key is a unique identifier for the corresponding item and cannot be used for any other item in the same Dictionary object.
The following code creates a Dictionary object called "cars", adds some key/item pairs, retrieves the item value for the key 'b' using the Item property and then outputs the resulting string to the browser.
Code:
Output:
"The value corresponding to the key 'b' is Buick"
PROPERTIES
CompareMode Property
The CompareMode property is used to set and return the key's string comparison mode which determines how keys are matched while looking up or searching.
Syntax: object.CompareMode[ = comparison_mode]
The CompareMode property is used to set and return the key's string comparison mode which determines how keys are matched while looking up or searching. Keys can be treated as case-sensitive or case-insensitive.
To do the comparison, you use the Comparison Constants. You may use either the CONSTANT (left column) or the VALUE (center column) in your code and get the same results.
CONSTANT VALUE DESCRIPTION
VBBinaryCompare 0 binary Comparison
VBTextCompare 1 Text Comparison
VBDataBaseCompare 2 Compare information inside database
In the following example the Add method fails on the last line because the key "b" already exists. If CompareMode were set to VBBinaryCompare a new key "B" (upper case) with a value of "Bentley" will be added to the dictionary.
Code:
Output:
"Alvis"
"Buick"
"Cadillac"
Count Property
The Count property is used to determine the number of key/item pairs in the Dictionary object.
Syntax: object.Count
Item Property
The Item property allows us to retreive the value of an item in the collection designated by the specified key argument and also to set that value by using itemvalue.
Syntax: object.Item(key) [ = itemvalue]
Key Property
The Key property lets us change the key value of an existing key/item pair.
Syntax: object.Key(keyvalue) = newkeyvalue
The Item property sets or returns the value of an item for the specified key and Dictionary.
Keyvalue is the value of the key associated with the item being returned or set and itemvalue is an optional value which sets the value of the item associated with that key.
If the specified key is not found when attempting to change an item, a new key/item pair is added to the dictionary. If the key is not found while trying to return an existing item, a new key is added and the item value is left empty.
Code:
Output:
"Value associated with key 'c' has changed to Corvette"
METHODS
Add Method
The Add method is used to add a new key/item pair to a Dictionary object.
Syntax: object. Addkeyvalue, itemvalue
Exists Method
The Exists method is used to determine whether a key already exists in the specified Dictionary. Returns True if it does and False otherwise.
Syntax: object.Exists(keyvalue)
Items Method
The Items method is used to retreive all of the items in a particular Dictionary object and store them in an array.
Syntax: [arrayname = ]object.Items
Keys Method
The Keys method is used to retreive all of the keys in a particular Dictionary object and store them in an array.
Syntax: [arrayname = ]object.Keys
Remove Method
The Remove method is used to remove a single key/item pair from the specified Dictionary object.
Syntax: object. Remove(keyvalue)
RemoveAll Method
The RemoveAll method is used to remove all the key/item pairs from the specified Dictionary object.
Syntax: object.RemoveAll
Example
Add an Item to Dictionary
Set oDictionary = CreateObject("Scripting.Dictionary")
oDictionary.Add "a","Akhila" 'Adds a item and key pair
oDictionary.Add "b","Bhanu"
oDictionary.Add "d","Deepthi"
MsgBox "The number of key/item pairs "&oDictionary.Count
For Each obj in oDictionary
msgbox "The key for "&obj&" and the associated data is "&oDictionary(obj)
Next
Msgbox "The value of key a is "&oDictionary.Item("a")
Determine if a specified key exists in the Dictionary Object
Set oDictionary = CreateObject("Scripting.Dictionary")
oDictionary.Add "a","Akhila" 'Adds a item and key pair
oDictionary.Add "b","Bhanu"
if oDictionary.Exists("b") Then msgbox "Key exists in the Dictionary"
Remove a key/item pair from Dictionary Object
Set oDictionary = CreateObject("Scripting.Dictionary")
oDictionary.Add "a","Akhila" 'Adds a item and key pair
oDictionary.Add "b","Bhanu"
oDictionary.Add "d","Deepthi"
oDictionary.Remove("b")
Removes all key/item pairs from Dictionary Object
Set oDictionary = CreateObject("Scripting.Dictionary")
oDictionary.Add "a","Akhila" 'Adds a item and key pair
oDictionary.Add "b","Bhanu"
oDictionary.Add "d","Deepthi"
oDictionary.RemoveAll
VBScript: comparing two files using dictionary object
Here is a VBScript function to compare 2 files and get the changes between them. The function will return a multi-line string with what was added, modified and deleted between the old and new file.
This function was initially developed for me to compare changes between an old and new input file in my script. I need to know which server was added or removed and which server had its parameters modified. The input files is a delimited file using “~” as a delimiter and contains 2 values in each line: “server name” & “parameter”.
This will help explain why the code was written the way it is. You can use this and change according to what you require. Some of you may cringe that the liberal use of single letter variables, I have my own thoughts about this on the readability versus efficiently in short programming codes
Function Get_FileDiff(pFileOld, pFileNew)
dim fso, t, txt
dim d1, d2, i, k
Get_FileDiff = ""
Set fso = CreateObject("Scripting.FileSystemObject")
if fso.FileExists(pFileOld) and fso.FileExists(pFileNew) then
Set d1 = CreateObject("Scripting.Dictionary") 'old file contents
Set d2 = CreateObject("Scripting.Dictionary") 'new file contents
set txt = fso.OpenTextFile(pFileOld, 1)
do while not txt.AtEndOfStream
t = split(ucase(txt.readline),"~")
d1.Add t(0), t(1)
loop
txt.close
set txt = fso.OpenTextFile(pFileNew, 1)
do while not txt.AtEndOfStream
t = split(ucase(txt.readline),"~")
d2.Add t(0), t(1)
loop
txt.close
k = d1.keys
for i = 0 To d1.Count -1 ' Iterate the array.
if not d2.Exists(k(i)) then
Get_FileDiff = Get_FileDiff & "deleted: " & k(i) & vbCrLf
else
if d1(k(i)) <> d2(k(i)) then
Get_FileDiff = Get_FileDiff & "modified: " & k(i) & ": old=" & d1(k(i)) & ",new=" & d2(k(i)) & vbCrLf
end if
end if
next
k = d2.keys
for i = 0 To d2.Count -1 ' Iterate the array.
if not d1.Exists(k(i)) then Get_FileDiff = Get_FileDiff & "added: " & k(i) & vbCrLf
next
else
Get_FileDiff = "error: One of the files: " & pFileOld & " or " & pFileNew & " not found!"
end if
set fso = Nothing
End Function
Regular Expressions and VBScript
Regular Expressions provide a much more powerful and efficient way of manipulating strings of text than the use of a variety of standard string functions. They have a reputation of being cryptic and difficult to learn, but are actually quite easy to learn and use.
The RexExp Object
The RegExp object has three properties and three methods. The properties are:
Pattern property - holds the regular expression pattern
Global property - True or False (default False). If False, matching stops at first match.
IgnoreCase property - True or False (default True). If True, allows case-insensitive matching
The methods are:
Execute method - executes a match against the specified string. Returns a Matches collection, which contains a Match object for each match. The Match object can also contain a SubMatches collection
Replace method - replaces the part of the string found in a match with another string
Test method - executes an attempted match and returns True or False
To set up a RegExp object:
Dim reSet re = New RegExp
With re
.Pattern = "some_pattern"
.Global = True
.IgnoreCase = True
End With
A Pattern can be any string value. For example, if the pattern is "Hello World", the RegExp object will match that in the target string. If IgnoreCase is True, it will match any case, so "hellO wORld" would be matched. If Global is set to True, it will contine to search the string for all instances of "Hello World". If False, it will stop searching after the first instance is found.
Execute method, returning Matches collection
Dim re, targetString, colMatch, objMatch
Set rs = New RegExp
With re
.Pattern = "a"
.Global = True
.IgnoreCase = True
End With
targetString = "The rain in Spain falls mainly in the plain"
Set colMatch = re.Execute(targetString)
For each objMatch in colMatch
Response.Write objMatch.Value & "
"
Next
The above will produce a list of 5 letter a's.
Test method, returning True or False
Dim re, targetString
Set rs = New RegExp
With re
.Pattern = "a"
.Global = False
.IgnoreCase = False
End With
targetString = "The rain in Spain falls mainly in the plain"
re.Test(targetString)
The above will return True as soon as it hits the first instance of "a"
Metacharacters
Metacharacters are special characters that can be combined with literal characters (which is all that have been used so far) to extend the power of Regular Expressions way beyond the simple examples already seen, and are what set Regular Expressions apart from simple string functions.
Character
Description
\
Marks the next character as either a special character or a literal. For example, "n" matches the character "n". "\n" matches a newline character. The sequence "\\" matches "\" and "\(" matches "(".
^
Matches the beginning of input.
$
Matches the end of input.
*
Matches the preceding character zero or more times. For example, "zo*" matches either "z" or "zoo".
+
Matches the preceding character one or more times. For example, "zo+" matches "zoo" but not "z".
?
Matches the preceding character zero or one time. For example, "a?ve?" matches the "ve" in "never".
.
Matches any single character except a newline character.
(pattern)
Matches pattern and remembers the match. The matched substring can be retrieved from the resulting Matches collection, using Item [0]...[n]. To match parentheses characters ( ), use "\(" or "\)".
xy
Matches either x or y. For example, "zwood" matches "z" or "wood". "(zw)oo" matches "zoo" or "wood".
{n}
n is a nonnegative integer. Matches exactly n times. For example, "o{2}" does not match the "o" in "Bob," but matches the first two o's in "foooood".
{n,}
n is a nonnegative integer. Matches at least n times. For example, "o{2,}" does not match the "o" in "Bob" and matches all the o's in "foooood." "o{1,}" is equivalent to "o+". "o{0,}" is equivalent to "o*".
{n,m}
m and n are nonnegative integers. Matches at least n and at most m times. For example, "o{1,3}" matches the first three o's in "fooooood." "o{0,1}" is equivalent to "o?".
[xyz]
A character set. Matches any one of the enclosed characters. For example, "[abc]" matches the "a" in "plain".
[^xyz]
A negative character set. Matches any character not enclosed. For example, "[^abc]" matches the "p" in "plain".
[a-z]
A range of characters. Matches any character in the specified range. For example, "[a-z]" matches any lowercase alphabetic character in the range "a" through "z".
[^m-z]
A negative range characters. Matches any character not in the specified range. For example, "[m-z]" matches any character not in the range "m" through "z".
\b
Matches a word boundary, that is, the position between a word and a space. For example, "er\b" matches the "er" in "never" but not the "er" in "verb".
\B
Matches a non-word boundary. "ea*r\B" matches the "ear" in "never early".
\d
Matches a digit character. Equivalent to [0-9].
\D
Matches a non-digit character. Equivalent to [^0-9].
\f
Matches a form-feed character.
\n
Matches a newline character.
\r
Matches a carriage return character.
\s
Matches any white space including space, tab, form-feed, etc. Equivalent to "[ \f\n\r\t\v]".
\S
Matches any nonwhite space character. Equivalent to "[^ \f\n\r\t\v]".
\t
Matches a tab character.
\v
Matches a vertical tab character.
\w
Matches any word character including underscore. Equivalent to "[A-Za-z0-9_]".
\W
Matches any non-word character. Equivalent to "[^A-Za-z0-9_]".
\num
Matches num, where num is a positive integer. A reference back to remembered matches. For example, "(.)\1" matches two consecutive identical characters.
\n
Matches n, where n is an octal escape value. Octal escape values must be 1, 2, or 3 digits long. For example, "\11" and "\011" both match a tab character. "\0011" is the equivalent of "\001" & "1". Octal escape values must not exceed 256. If they do, only the first two digits comprise the expression. Allows ASCII codes to be used in regular expressions.
\xn
Matches n, where n is a hexadecimal escape value. Hexadecimal escape values must be exactly two digits long. For example, "\x41" matches "A". "\x041" is equivalent to "\x04" & "1". Allows ASCII codes to be used in regular expressions.
Examples
\d+ will match any digit one or more times, and is the equivalent to [0-9]+<[^>]*> will match any html tag, and looks for an opening "<", followed by anything that isn't a closing block ">", followed finally by a closing block ">". It uses a "negative character set" [^>]
Constructing a RegExp pattern
Form input validation is a key area in which regular expressions can be used, and a common task is to validate the structure of an email address. Initially, the task needs to be broken down into its constituent rules:
Must have 1 or more letters or numbers
Can have underscores, hyphens, dots, apostrophes
Must have an "@" sign following this
First part of domain name must follow the "@", and must contain at least 3 letters or numbers
May contain underscore, dots or hyphen
Must be at least one dot, which must be followed by the TLD.
"[\w\-\'\.]+@{1}[\w\.?\-?]{3,}\.[\a-z]+" will do it, but can be improved upon depending on how specific you want to be.
SubMatches collection
There will be instances where, once a match is found, you want to extract parts of that match for later use. As an example, suppose you have an html page which contains a list of links: Company A
Company B
Company C
Company D
Company E
...
The required parts are the Company name and the id in the querystring. These need to be collected and inserted into a database, for example. The html is fed in as the strSearchOn, and the pattern uses parenthesis to search for each item - The id ([0-9]{5}), which is a 5 digit number, and ([\w\s]+) which collects a series of letters and spaces, and will stop collecting them when the opening angle bracket is reached (). Set objRegExpr = New regexpobjRegExpr.Pattern = "somepage.asp\?id=([0-9]{5})" & chr(34) & ">([\w\s]+)"objRegExpr.Global = True objRegExpr.IgnoreCase = Trueset colmatches = objRegExpr.Execute(strSearchOn)For Each objMatch in colMatchesid = objMatch.SubMatches(0)company = objMatch.SubMatches(1)sql = "Insert Into table (idfield, company) Values (" & id & ",'" & company & "')"conn.execute(sql)Next
Getting Information about Individual Matches
The MatchCollection object returned by the RegExp.Execute method is a collection of Match objects. It has only two read-only properties. The Count property indicates how many matches the collection holds. The Item property takes an index parameter (ranging from zero to Count-1), and returns a Match object. The Item property is the default member, so you can write MatchCollection(7) as a shorthand to MatchCollection.Item(7).
The easiest way to process all matches in the collection is to use a For Each construct, e.g.:' Pop up a message box for each matchSet myMatches = myRegExp.Execute(subjectString)For Each myMatch in myMatches msgbox myMatch.Value, 0, "Found Match"Next
The Match object has four read-only properties. The FirstIndex property indicates the number of characters in the string to the left of the match. If the match was found at the very start of the string, FirstIndex will be zero. If the match starts at the second character in the string, FirstIndex will be one, etc. Note that this is different from the VBScript Mid function, which extracts the first character of the string if you set the start parameter to one. The Length property of the Match object indicates the number of characters in the match. The Value property returns the text that was matched.
The SubMatches property of the Match object is a collection of strings. It will only hold values if your regular expression has capturing groups. The collection will hold one string for each capturing group. The Count property indicates the number of string in the collection. The Item property takes an index parameter, and returns the text matched by the capturing group. The Item property is the default member, so you can write SubMatches(7) as a shorthand to SubMatches.Item(7). Unfortunately, VBScript does not offer a way to retrieve the match position and length of capturing groups.
Also unfortunately is that the SubMatches property does not hold the complete regex match as SubMatches(0). Instead, SubMatches(0) holds the text matched by the first capturing group, while SubMatches(SubMatches.Count-1) holds the text matched by the last capturing group. This is different from most other programming languages. E.g. in VB.NET, Match.Groups(0) returns the whole regex match, and Match.Groups(1) returns the first capturing group's match. Note that this is also different from the backreferences you can use in the replacement text passed to the RegExp.Replace method. In the replacement text, $1 inserts the text matched by the first capturing group, just like most other regex flavors do. $0 is not substituted with anything but inserted literally
Monday, July 25, 2011
Banking related Interview Questions
2. Research analyst may recommend to :- buy, hold and sell
3. Reducing CRR for banks would have impact on:-
a. Increased money supply
b. Reduced interest rates
c. Reduced money supply in the economy
d. Profitability of firms
e. None
4. ___ is the largest part of spread and is paid to broker/dealer that actually took the clients order
a. Salary
b. Wage
c. Manager’s fee
d. Concession
e. Underwriter’s allowance
5. What is the term used to indicate the arrangement of large borrowing for a corporate by a group of lenders?
a. Syndicate
b. Secondary
c. Assignment
d. None
e. Allocation
6. If a price of share changes from 65 to 60 this can be attributed to:
a. Market risk
b. Interest rate risk
c. Credit risk
d. Operational risk
e. Liquidity risk
7. Under corporate stock repurchase program
a. Corporate purchase their own shares from shareholders
8. Private banking providing risk management services strives to:-
a. Eliminate risk and maximize returns
b. Eliminate risk without worrying about returns
c. Reduce risk and optimize returns
d. Avoid risk and returns
e. All
9. Which will have highest interest rate
a. 3 months deposit with min balance of $4000
b. 12 months -> $1000
c. Cannot determine
d. 6 months -> $2000
e. 6 months -> $1000
10. One would go for bank deposits because
a. Money easily available
b. Interest earned
c. Insurance cover available
d. All
11. Basic 4 parties involved in any transaction using letter of credit are following except
a. Issuing bank
b. Buyer
c. Reimbursement bank
d. Seller
e. Beneficiary bank
12. From seller’s point of view which method has least risk
a. LC
b. Direct debit
c. Documentary collection
d. Counter trade
e. Cash in advance
13. ABC rated as AA+ and XYZ rated D. Who gets loan from bank
a. Equally unlikely
b. Equally likely
c. ABC
d. XYZ
e. None
14. Which of the following can be done on LC?
a. Negotiate
b. Purchase
c. Acceptance
d. Discount
e. All
15. Which is not the settlement method for bank loans?
a. Pre-closure
b. Assignment
c. Participation
d. Sub participation
e. Securities repository
16. Which is correct hierarchy of corporate ratings (high to low)?
a. AAA,AA+,BBB,D
17. Purchase as $40. A year later got dividend $2. Sold at $48. What is holding period return?
a. 10%
b. 25%
c. 45%
d. 50%
e. None
18. Inflation- 8%. Future value of 100 units of money after 2 years:
a. 118.8
b. Exactly 100
c. Exactly 200
d. Around 109
e. None
19. Brokerage firms are regulated by
a. SEC
b. Industry wide SROs
c. State regulatory Agency
d. All
20. Odd man out:-
a. SEC
b. NYSE
c. NASDAQ
d. LSE
e. NSE
21. From investor stand point a debenture issued by excellent company will appear risky than share of preferred stock issued by excellent company
a. True
b. False
22. Risk associated with hedge funds:-
a. High exposure in derivatives
b. All
c. High speculation
d. High leveraging
23. Not a feature of private banking:-
a. High investment in technology
b. Lot of research
c. Commercial lending
d. Specialist advice
e. Understanding capital and investment needs
24. Which of the following affects the choice of payment method
a. All
b. Government guarantee method
c. Exporter’s fund
d. Time frame
e. Cost of financing
25. Which risk may bring gains and losses?
a. Credit risk and interest rate risk
b. All
c. Liquidity risk and foreign exchange risk
d. Credit risk and foreign exchange risk
26. Bankers acceptance differs from sight draft in that
a. Sight drafts are negotiable instruments
b. Bankers acceptance demand immediate payments
c. Bank can raise funds by selling acceptance
d. Bank acceptance reduces banks lending capacity
e. None
27. Formal legal commitment to extend credit up to some maximum amount over a period of time is a description of
a. Line of credit
b. Irrevocable credit
c. Letter of credit
d. Revolving credit agreement
e. Trade credit
28. Odd man out
a. None
b. Auto loans
c. Demat
d. Hire purchase
e. Personal loan
29. A choice quote is a price
a. At which a firm is ready to buy or sell
b. Where firm has a choice of deciding the security to take
c. A option and it also means when bid is equal to offer
d. When bid=offer
30. A bank gets a deposit of $1000 assuming CRR=10% and that is circulates through 2 more banks, leading to following money multiplier effect:-
a. Create a reserve of $100
b. Create a reserve of $190
c. None
d. Loans of $1710
e. Loans of $2439
31. Security settlement is function of
a. Specialist
b. Traders
c. Back office
d. Front office
e. Mid office
32. Which of these instruments is not included as part of asset servicing services and the category “Pricing/ Holdings” Valuation which includes accurate pricing, rating etc.
a. Equities
b. Certificate of participation
c. Government securities
d. Certificate of deposit
e. Services may be provided for all
33. Which of the following is involved in retails brokerage business in US
a. E-trade
b. Charles Schwab
c. Sallie Mae
d. Federal reserve
e. a and b both
34. Measures of performance of an investment portfolio are all of the following except:-
a. Risk adjusted return
b. Style maps score
c. Profit/loss on portfolio
d. Alpha
e. Up/down market analysis
35. Interest rate spread:-
a. Current rate – floor
b. Cap – current rate
c. Current rate-base rate
d. Base rate-floor rate
e. None
36. Who insures stocks in stock market
a. Security and exchange commission
b. Federal deposit insurance corporation
c. Us department of treasury
d. None
37. NASD is not an SRO for
a. 4th market
b. 3rd market
c. Listed market
d. 2nd market
e. OTC market
38. Which of the following loan requires the amount of interest that would be earned on the loan to be paid upfront by borrower:-
a. Discounted loans
b. True discount
c. Capitalized
d. Demand
e. Amortized
39. Limit = $2000 Margin=20% Asset value=2000
a. Drawing power = 1600
40. Over the counter market is also called
a. Unlisted market
b. 2nd , unlisted and OTC market
c. Unlisted
d. Super
e. 2nd market
41. Liquidity issues of credit can be addressed by:-
a. Sweep facility
b. Structured lending to client
c. All
d. Short term credit facilities
e. Overdraft
42. Standby letter is _____ secure than documentary collection and cheaper than ____
a. More, commercial LOC
43. Total spread of underwriting = 500000 and manager fee = 100000 and distributed in syndicate=?
a. 600,000
b. 400,000
c. 100000
d. 500000
e. Cannot determine
44. Price of security on day 1&2 is $100 and $102 respectively. The return is
a. -2%
b. 2%
c. -1.96%
d. Very high
e. 1-2%
45. Which is not an option
a. Call
b. Put
c. Swaption
d. Oil futures
e. Leaps
46. question on top 10 US bank – read page number 52
47. ACH transaction involves
a. Cash
b. Electronic data
c. Docs
d. Checks and drafts
e. All
48. Interest rates falls
a. Bond prices increase
b. Bond prices decrease
c. Do not change
d. Economy goes to deflation
49. Rate at which bank purchases US dollars against home currency is :-
a. Bid
b. Indirect
c. Direct
d. Cross currency
e. Ask rate
50. Offer price is the price at which the firm
a. Intends to buy
b. Intends to sell
c. Trades in securities
d. None
51. Presence of risk implies
a. Standard deviation of return is 0
b. Uncertainties of final outcome
c. Final wealth is lower
d. Investment gain
52. Company would pay interest on what portion of the loan?
a. Disbursed amount
b. Committed amount
c. Both
d. Either
e. None
53. Odd man out?
a. Equity
b. Stocks
c. Shares
d. Convertible bonds
e. Common stock
54. A bank cannot cover the money demanded by depositor, then it goes out to –
a. Federal reserve bank
55. Institutions involved in benefit administration process, discussing plans
a. Sponsor
b. Custodian
c. Plan administration
d. Record keeper
e. Participant
56. Which of the following eliminates both country risk and commercial risk?
a. Both standby LOC and LOC
57. When bank goes to the fed to borrow funds then the interest rate charged by fed is known as
a. Prime rate
b. Bond rate
c. Discount rate
d. Federal rate
58. CP full form in corporate lending …
a. commercial paper
59. when was US PATRICAT ACT passed
a. 2001
60. Risk averse
a. less risk/avoid risk
61. full form of EMI. Ans)
Equated Monthly Installment.
62. if day 1and day 2 share price is $100 and $102. return is
a. 2%
63. if day 1and day 2 share price is $102 and $100. return is
a. -1.96%
64. if share price of cognizant changes fronm $65 to $60 ,risk is
a .market risk
67. which of the following is online settlement method
a. RTGS
68. how much you will get at end of 3 years if you deposits $1000 at 7% compound interest
a. $1225
69. you bought 200 shares at $24. now share price is $ 25 and you got dividend of $1.50 your total return is
a. $500
70. if u buy share at price$ 40 and now share price is $ 48 and u got dividend of $2 per share ur total return in % is
a. 25%
71. Which of the following is true for The Fed funds rate
a. It is cost of borrowing immediately available funds for one day.
72. corporate bonds are
a. always secured
73. fastest method in calculating VaR
A. covariance method
74. full form of VaR
a. value at risk
75.if one day var is $ 1M, calculate var for 9 days
a. $3M
76. Which of the following is not a repayment method?
Ans .collatral
78. in credit scores who is involved?
a. Credit Bureau
79. ATM stands for
1) Automatic Transaction Machine; Almost anytime banking
2) Automated Teller Machine; Remote location transactions
3) Automatic Transaction Machine; Fund transfer between accounts
4) Automated Teller Machine; Direct Deposit
5) Automatic Transaction Machine; Personal Banking
80. A Revocable LC (Letter of Credit)
v can be revoked without the consent of the Exporter
v can be revoked without the consent of the Exporter’s bank
v can be revoked without the consent of the Importer’s bank
v can’t be revoked with the consent of the Advising bank
v can’t be revoked without the consent of Exporter.
81. Which of the following are disadvantages of using LC (Letter of Credit)?(check box)
a. Time consuming
b. Costly
c. Specific and Binding
d. Deals with documents and not with products
e. Credit Line tied up.
82. Capital adequacy ratio refers to
a. Amount of bank’s capital expressed as percentage of the risk weighted credit exposure, operational risk & market risk
83. Banker acceptances are ________________ credit investment created by ___________ and used for financing imports, exports and domestic shipping
v Long term; financial firms
v Long term; non-financial firms
v Short term; non-financial firms
v Short term; financial firms
v Medium terms; banks
84. Mutual funds
a. Are less riskier than individual stocks as the fund managers invest in a diversified portfolio
85. Warrants
a. Warrants are call options – variants of equity. They are usually offered as bonus or sweetener
86. bank are least interested in giving a personal
a. credit scores
b. document verification
87. difference between lease & hire purchase
a. all
88. To compare the cost of different Mortgages deals one should look at the
a. APR
89. securitizing cash flows fromfuture monthly sale of oil explored from its specified offshore
a. asset securtisation
90. not a Treasury Management Systems – Inter-bank
91. pre shipment loans
a. Banks provide Pre-shipment finance - working capital for purchase of raw materials, processing and packaging of the export commodities.
92. function of A card Association
a. security/risk management
93. funtions of private banking
95. not a Personal Investment Companies and private bank
96. risk associated with hedge funds
97. function of CORPORATE FINANCE
a. all
98. sales and brokers responds to which department when institution transfer their custody service from one to another
a. Transition management
99. two questions from Netting and RTGS from pdf at page number 180-181
100. who is at risk in defind benefit
a. employer
101. difference between DB (defined benefit) and DC (defined contribution)
102. BAFT stands for
v Bankers Acceptance for Factoring Transactions
v Bankers Association for Foreign Trade
v Bankers Acceptance for Foreign transactions
v Bankers Association for Forfaiting & Factoring transaction
v Bankers association for Factoring Trade.
103. Corporate loans are .. Secured or unsecured , secured, unsecured
104. Pick odd one out ..
1) merril lynch
2) george soros
3) bell graham
4) bill gates
5) warren buffet
105. not investment bank
1) bear starter
2) lehmen brothers
3) icici securities
4) goldman sachs
106. newyork, delhi, Jakarta, thimpu … --- > least risk in investing107. US, india, Pakistan, burma, Bhutan -- > beneficial for loan purpose
108. Which of the following is the most profitable for Credit Card Company?
1) Customers who always pay in time
2) Customers who never pay
3) Customers who default but finally pay
4) all of the listed options
5) None of the listed Options
6) Customer who pays minimum due
109. Which is not the charge type ??
Pledge, hypothecation, lien, collateral
110. Money Multiplier effect would imply………
1) An increase in the total money lent out into the system
2) An increase in the total money in the bank reserves in the system
3) A decrease in the total money in the bank reserves in the system
4) Both An increase in the total money lent out into the system and An increase in the total money in the bank reserves in the system
5) Both An increase in the total money lent out into the system and a decrease in the total money in the bank reserves in the system
111. Which of the following is associated with the purpose of regulating financial institutions?
1) To provide stability of the money supply
2) To serve certain social objectives
3) To prevent failure of any financial institution
4) To offset the moral hazard incentives provided by deposit insurance and other guarantees.
5) Both To serve certain social objectives and To offset the moral hazard incentives provided by deposit insurance and other guarantees.
112. Private banking is a fee driven business
113. Purely competitive financial market not characterized by,
1) govt. regulation
2) cost effective trading
3) full information
4) many traders
114. Open ended loan allow the borrower to borrow additional amount subject to the maximum amount less then a set value.
1) True
2) False
115. investment bank assists in merger & aqisition..
1) Structure and deals
2) All
3) smooth transaction
4) structure and deals
116. card association do ??
1. Security/Risk management
2. Issue cards
3. Set credit limits
4. Set interest rates
117. which is not a pre shipment loan
1. bill discounting
2. row material
118. nominal rate – 8% , rate of inflation – 2%, real rate of inflation ???
1. 6%
2. 10%
119. two way quote for share the bid
120. funding cost goes up due to Hardening interest rate
… Risk ???
121. Federal funds rate: The rate domestic banks charge one another on overnight loans to meet Federal Reserve requirements. This rate tracks very closely to the discount rate, but is usually slightly higher.
My paper
QTP Classroom and Online Training
Comprehensive QuickTest Professional 9.2
Course Code : QTP102009
Source : AutoamtionInfotech
HP Quick Test Professional (QTP basic to In-depth concepts + VB Scripting + Descriptive Programming + Framework Development + Certification) Training
Automation Infotech is a leading software training company from Pune. specialized in software testing started Manual Testing, QTP Certification, Loadrunner, Quality Center, C# Specialist and Perl Specialist trainings. Trainers certified with having 4+ years of exp and working as a Module Test Lead with MNC.
The main objective of Automation Infotech is to provide quality training in testing for the candidates looking to explore their career. Following are the 100% job guaranteed trainings offered by Automation Infotech
Please find below the QTP training details.
Training: QTP Specialist with Framework plus Certification Training
Duration: 4-5 weeks
Trainer: QTP Certified with 4+ years of experience working as module lead
Fees: 7000
-------------------------------------------------------------------
Please find below the Quality Center training details.
Training: Quality Center training, with real time example and project based. (User and Admin both) plus Certification
Duration: 3-4 weeks
Course Contents: Both User and Admin part will be covered with real-time example
Fee: 5000
-------------------------------------------------------------------
Please find below the Manual Testing training details.
Training: Manual-testing training, with real time example and project based.
Duration: 3-4 weeks
Fee: 4000
-------------------------------------------------------------------
Please find below the ISTQB [International Software Testing Quality Board] training details.
Training: ISTQB with Sample certification paper.
Duration: 3-4 weeks
Fee: 4000
-------------------------------------------------------------------
Note: Each batch will only have 10-12 members. Please inform to all your friends, who are looking for Quality Training in Testing.
This core course provides a comprehensive understanding of using QuickTest Professional 10.0 as an automated functional testing tool for different environments.
Course Outline Overview Of QuickTest Professional 10.0
Preparing to Record
Creating a Script
Working with Objects
Using Synchronization
Using Standard Checkpoints
Using Parameters and Data Driven Tests
Using Multiple and Reusable Actions
Using Database Checkpoints.
Using Recovery Scenarios
Object Repository Administration and Maintenance
Script Debugging.
Introduction to Advanced QTP
Introduction to the Expert View
Using the Expert View
Working with Object Properties
Working with Dynamic Objects
Using VBScript Operators, Statements, and Functions
Retrieving External Data
Creating New Procedures
Descriptive Programming
Automation Frameworks
Please book your seat by confirm your seat on :- 9763315036
QTP Classroom and Online Training
This core course provides a comprehensive understanding of using QuickTest Professional 9.2 as an automated functional testing tool for different environments. You will use QuickTest Professional?s graphical point and click interface to record and play back tests, add synchronization points and verification steps, and create multiple action tests. You will build upon fundamental topics by using debug tools to troubleshoot tests and use additional checkpoints and product options to broaden the scope of business processes that can be automated. Once tests are created, you will discover and correct common record and play back problems. All topics are supported by hands-on exercises that are based on real-life examples. Take your functional test automation skills to the next level bylearning to use the Expert View in QuickTest Professional.Through discussions and hands-on exercises, you will learn tocreate steps that work with dynamic objects and data, useVBScript conditional and looping statements to control the flow ofyour tests and components, and use Data Table methods anddatabase connection objects to retrieve external data. Intended Audience New users of QuickTest who need to automate manual testing and verification in a short amount of time Quality assurance engineers who will assume technical lead roles in the use of QuickTest Professional.Quality assurance engineers who will support business analysts using Business Process Testing.Other users of QuickTest Professional who need to customize and enhance their automated tests using scripting.Course ObjectivesAt the end of the course, you will be able to: Create basic scripts from a manual test caseEnhance basic tests with synchronization and verificationParameterize tests to run with multiple sets of dataCreate and reuse modular actionsUse the Object RepositoryUse debugging toolsUse custom checkpoints to create more precise verification points within a testUse the Object Repository ManagerDescribe and use virtual objectsResolve object recognition problemsIdentify the advantages of Expert View.Translate steps between Keyword View and Expert Views.Enter test steps in Expert View.Retrieve and use the properties of an application object.Use constants and variables in tests.Identify application objects with programmatic descriptions.Create tests that include VBScript operators, functions, and statements.Retrieve data from application objects.Describe and use various VBScript looping statements.Use the Data Table object to store run-time data and drive actions.Create scripts that access data from external sources.Create new subroutines and functions.Create and associate a library of functions.Use the Function Library editor.Identify when to handle exceptions programmatically.PrerequisitesWorking knowledge of WindowsWeb sites and browsersTesting conceptsRecommended Follow Up CoursesAdvanced QuickTest Professional 9.2 Course Outline Overview Of QuickTest Professional 9.2Preparing to RecordCreating a ScriptWorking with ObjectsUsing SynchronizationUsing Standard CheckpointsUsing Parameters and Data Driven TestsUsing Multiple and Reusable ActionsUsing Database CheckpointsUsing Recovery ScenariosObject Repository Administration and MaintenanceScript DebuggingIntroduction to Advanced QTPIntroduction to the Expert ViewUsing the Expert ViewWorking with Object PropertiesWorking with Dynamic ObjectsUsing VBScript Operators, Statements, and FunctionsRetrieving External DataCreating New ProceduresAutomation Frameworks
Banking Expected Questions
Concept Of Money
1. What is inflation? Options: Increase in Prices, Decrease in Prices, Varying Prices
2. There is a person getting x salary. Inflation is 20% but his salary raise is 5%. What is the impact? Options: his standard of living goes down, he gets paid some y salary, he quits his job.
3. currency is: Option: practical form of money
4. Full form of IRR, CRR, NPV,
Financial Instruments
5. Commercial Paper
6. Money Market instruments
7. ADR – example based question.
8. What are warrants? Options: Equity and Call Option
Financial Markets
9. List of stock exchanges is given. Pick the one which is not a stock exchange. Options: LSE, BSE, NSE
10. How many stock exchanges are there in India? Options: 2, 4, more than 4
11. Central Bank is also called Options: Banker’s Bank
12. Regulatory Balance Sheet: some question on what is included in this
Risk Management
13. A person who wants to minimize risk would do what? Options: Always consider the risk involved, always consider the rate of return, would invest in low risk-low return instrument
14. A student willing to take maximum risks for high returns would invest in: Options: Stock, Bond
15. Legal risk is: Options: possibility of loss when contract cannot be enforced.
Introduction to Banking
16. If there is a change in interest rate, it refers to: Options: Monetary Policy/ Money Policy/ Multiplier Effect
17. Chinese wall was built to separate: Options: analysts and bankers
Retail Banking
18. Which of the following is not a part of retail banking? Options: Personal Loan, Trade Finance, Home Loan, Car Loan.
19. Where do banks make most money? Options: Customer who pays in time, Customer who never pays, Customer who pays but late
20. FNMA, GNMA, FHLMC functions include: Options: buy mortgages from bank and pool them into bonds to be held or sold.
21. Pick the odd one out. Options: Visa, MasterCard, Discover, HSBC Bank
22. Which of the following is not a banking account: Checking Account, Demat Account, Savings Account, MMDA
Electronic Banking
23. The loss of which of the following can cause maximum harm to customer? Options: ATM Card, Debit Card, Gift Voucher.
24. How does CHIPS use FedWire? Options: over FED New York, over Federal Reserve
25. An example where in some transfers from two accounts are given. Question was that what will happen end of day in case of CHIPS? Options: Difference will get credited, Individual Balances will get credited to both accounts
26. Which of the following is likely to use FedWire? Options: SWIFT, ATM, Debit Card, ACH, Credit Card
Private Banking
27. Net worth is: Options: Household Income, No of shares, Household income + no of shares
28. Full form of PTA
29. ICICI is Options: Investment Bank, Private Bank, Public sector Bank
Asset Management
30. Those using Active Approach for Asset Allocation follow Options: Market Timing
31. The person using diversification strategy for minimizing risks would Options: create portfolio looking similar to the market index
32. Bid-Ask Spread Options: difference in buy and sell price of the same asset, difference in opinion of buyers and sellers on the same asset
Corporate Lending
33. Definition of corporate lending. Question was something like, what will the lending type be if the company requires loans for buying modern equipment.
34. Who is likely to get a loan? Options: Company with BB rating, Company with D rating
35. Conceptual question on working capital.
36. Full form of CP and meaning.
Trade Finance
37. Which is the riskiest form of payment for buyer/seller?
38. Which is the most secure way of payment? Options: LC, Documentary Collection
39. Who issues/ applies for an LC? Options: Buyer’s Bank, Seller’s Bank, Buyer, Seller
Treasury Services and cash management
40. Collections and Payments is a function of which department? Options: Treasury
41. CLS full form.
Investment Banking
42. Pick the odd one out. Which of the following is not an investment bank.
43. Amongst a list of stock exchanges, which one is the Japanese Stock Exchange?
44. Footsie is the stock exchange for which country?
45. In which underwriting do the unsold securities remain with the issuer?
46. Example based question on Limit Order/ Stop Order
Recent Developments
47. What are the three pillars of Basel 2
48. Which of the following is not a pillar of Basel 2 (confusing options, have to know exactly)
49. Difference between Standardized and Internal ratings Based approach.
50. What were the technology challenges for banks in Check 21 act
Infosys declared dividends. Which of the following statements can be linked to this fact. Options:
Questions by Bivek
51. NYSE
Ans) Largest OTC
52. What is NOSTRO acc
Ans) acc in one place having tie up with some foreign bank
53. One question from Hire Purchase
54. maximum benefit to investor by giving money to which bank . Options è (a) Private (b) Asset Manag (c) ? (d) ?
answer Private
55. Odd man out for mode of payments.
56. Oil Grill company takes loan … etc
answer Asset Securitisation
57. BAFT full form
Ans) Banker’s Association for foreign trade
58. IRR full form
Ans) Internal Rate of Return
59. SWIFT –
Ans) society of worldwide interbank financial telecommunication.
60. CRR full form è Cash Reserve Ratio
61. CPI Full form è Consumer’s Price Index
62. FOTSEC ???? which country’s index Ans) Singapore/Switzerland.
63. One question from Chip Cards (Clearing House Interbank Payment System It is a private sector for wire transfer just like fed where all the transaction cleared at the end of day but in fedwire it takes only few minutes(differences).
64. One simple question (numerical) from Compound Interest
(future value = principal ( 1 + r)^t and present value = f.v. / p(1 + r)^t
65. Risk Management à what is VAR è Measurement of Risk (Value at Risk)
66. One 3 mark question from US Patriot ACT
67. Due diligence is?
68. what is Risk averse?
69. which is not the top 10 bank?
70. PTA,ACH,IRR,CLS,POP full form
71. 3 quesitons on custodian
72. settlement,safekeeping,reporting is related to
Ans) custodian
73. If one bank want to deal with another bank which don’t have any relationship wants to keep funds secure etc…
Ans) global custodian services,
74. superDOT ?
Ans) NYSE.
75. In Trade finance which account will have maximum risk for seller
Ans) open account.
76. In Trade finance which one holds true
Ans) distribute risk between buyer and seller.
77. Reserve Bank related question? Generally what kind of bank it is?
78. question related to money market etc
Ans) Monetary policy.
79. full form of EMI. Ans) Equated Monthly Installment.
80. full form of NASDAQ. Ans) National association of security dealers automated quotation.
81. full form of LIBOR,LEAP. London interbank offered rate , long term equity anticipation security.
82. what is APR (annul percentage rate) Interest rate calculation
Amount of interest when & how it should be paid, any other charges when & how it should be paid.
83. Which bank is not an associated bank? any of American Express, Diner’s club, Discover.
84. Which is the point of sale transfer ans) Debit card.
85. If lost which card have maximum risk ans) Debit /ATM card if option is gift voucher then you have to think.
86. Which is know as the Tax haven ans) it could be cayman island & Bermuda.
87. difference between private & Asset management ans) private bank targets Individual & asset management targets institution.
88. contrarian investing -> implied questions
89. sight draft - > implied questions.
90. which are not investment banks.
91. Which underwriting is rights offering Ans) standby.
92. what happens in a stop limit order, choose one from the option.
93. one calculation based on CLS(continuous linked settlement) transaction like A transfer to B then B transfer to A so on
94. What is Chinese wall
Ans) separates research analyst from both bankers and sales & Trading.
95. US Patriot Act four options which one is false
96. Sarbanes Oxley Act four options which one is false.
97. Check 21 four options which one is true.
98. What do you mean by Dealers par excellence?
Ans) Act as a principal and trade for his own interest.
99. Which is the new Risk in Basel2 ans) Operational risk.
100. What is the risk related to cognizant ans) all.
101. if attrition is there what kind of risk it is ans) operational risk.
102. oil company related one question ans) Asset Securitization.
103. One question having Sachin Tendulkar name ans) Sachin Tendulkar.
104. What is leverage financing
Ans) debt/equity ratio but in option it will not be present so the answer will be “use of dept”.
105. which bank initiates the LC ans) buyers bank.
106. Warrants cannot be options can be Traded, Exercise , Expires , etc ans) this three are true so the 4th one is the answer.
107. fannie mae,fannie mac,genie mae are related to ans) options are confusing but option b is the ans. This all are related to Mortgage for US.
108. What is cp?
Ans) commercial papers which is an unsecured short term loans maturity 1 – 270 generally < 30 days.
What is ADR?
Ans) American Deposit Receipt, It has the voting rights(important).
What is RTGS?
Ans) Real Time Gross Settlement which provides online settlement of payments between financial institutions.
111. There is one question on the 13 steps involve during letter of credit in Trade finance,
five options will be given and we have to arrange them in sequential order.
Vipul
112 Cognizant stock is going to increase in next one month , what should we do ?
Option: sell put option, sell call option, buy put option, buy call option
,buy put and call both option at different strike rate.
Answer : for this question answer is both 'buy call option' or 'sell put option' . Buying call option will give you unlimited gains for rise in cognizant stock (because you have the option to buy at the strike price) whereas selling put option would result in you retaining the premium when cognizant stock rises.
113 footsie(FTSE) is related with
Option : UK, Switzerland, Singapore, JAPAN, US
114 due diligence
115 Risk averse
116 stardardize approach
117 US PATRICAT ACT
118 Trade finance—letter of credit.
119 Work of central bank
120 Arbitrage
121 ACH related one question
122 Money market related one question.
123 Which is not a repayment method?
124 Option: direct debit, direct receipt,PDC, one another option which is answer
125 CP full form.
126 what is NYSE option: OTC, primary market, secondary market
127 CLS full form
128 APR contains what ? answer—all the given in list.
129 lost of which contains maximum risk option: ATM card, debit card, credit card, gift
voucher.
130 Which one of following is not a private
Option: Fed wire, CHIPS answer—Fed wire.
131. work of custodian option: settlement, Trading, Aution, netting
132 simple interest is calculated on ?
133 keep the odd term out ? option: visa, mastercard,discover,HDFC bank
134 which is not a top 10 bank ?
135 IRR full form
136 High net work ? option: net worth, Household, no. of share, household + no. of share
137 A brokerage or analyst report will contain all of the following except?
a) a detailed description of the company, and its industry.
b) an opinionated thesis on why the analyst believes the company will succeed orfail.
c) a recommendation to buy, sell, or hold the company.
d) a target price or performance prediction for the stock in a year.
e) a track record of the analyst writing the report.
138 Nikkie is which country’s market indices. ?
139 VaR is used for what ? option: identifying risk, mesure the risk, avoid the risk
140 don’t put all eggs in one basket is used for what ? answer – diversification
141 one question of dealer’s work
142 which type of underwriting is used most probably ?
143 full form of POP
144 with which client (custodian)cognizant is having a old relation shop ?
answer – JPMC-IX
145 Active approach related one question.
146 find the odd term ? option : American express, discover, diner’s club.
147 one question of nostro account.
148 one question of banker’s acceptance.
149 which one is not a payment method is trade finance
150 currency swap related one question.
151 why CRR is required. Answer: manage the liquidity risk.
152 High purchase related one question.
153 overdraft related one question.
154 full form of EFT.
155 question related money multiplier effect.
156 main work of bank ? answer: provide linked between lender and borrower.
157 primary market related one question.
158 convertible bonds related one question.
159 There is a person getting x salary. Inflation is 20% but his salary raise is 5%. What is the
impact? Options: his standard of living goes down, he gets paid some y salary, he quits
his job.
160 it new company established which of the following risk occurs
Option: operational risk, credit risk, market risk, all of the above
Answer: answer is mainly 'operational risk'. There is no question of credit risk as the company has not lent money to someone from whom getting back is doubtful. As for market risk, that term is more used for fluctuation in prices of any thing. If the company is in the business of selling some commodity then we can say it also faces market risk due to fluctuation in selling price of that commodity.
Investment Banking Related Questions
a. Order
b. Market
c. None
2. Primary function of exchange is
Provide liquidity
Provide Info
Protect Investor
Conduct Auction
3. A Xyz airline has just completed an IPO & its stock is going to be traded 4pm
15th march. Where it will be traded?
Primary
Secondary
Derivative
None
4. For Call option stock price is 100 and strike price is 105 …the option is in
a. In the money
b. Out the money
c. at the money
5. Which is not a methodology of equity (IPO)
a.DCF
b.Internal Rate Return
c.Relative value valuation
d.Divident growth rate
6. A question on Reconciliation:-
Ans:- Settlement System Integrity Reconciliation: This reconciliation intends to prove that the settlement system is in balance i.e. the total of securities owned is equal to the sum of the location position. If the firm employs double-entry bookkeeping, theoretically this will be true by default. Still this reconciliation must be performed frequently to prove that the system is in balance.
7. Find the correct order - Order,trade,confirmation,affirmation,NOE
Ans: order, NOE, trade, confirmation, affirmation
8. Which is a derivative market
LSE,CBOE,NYSE
9. The custodian having worldwide network of sub-custodian is
1. Local custodian
2. Global custodian
3. NCSD
4. ICSD
10. on a margin call
1. The broker draws fund from the margin acc
2. The investor adds fund to the margin acc
3. The broker adds fund to margin acc
4. The investor draw fund to margin acc
11. What is the function of Agents in Clearing??
12. Which one is correct?
Answer:
a) If a buyer of securities is unable to make payment for the purchase, he can be made to go through a sell-out procedure.
b) Securities-driven transactions have one more objective. Continued failure of the seller to make a good delivery can cause the buyer to invoke buy-in procedures. In a buy-in, the buyer buys the necessary quantity of securities at the current market price. The securities are then delivered to the buyer and any additional costs incurred in the buy-in are charged to the original seller.
13. Prime broker works on behalf of which brokerage:-
a) Retail Brokerage
b) Investment Brokerage
c) None of these
c) Discount Brokerage
14. Define prime brokerage transaction
Ans: The executing broker gives up to the prime broker
15. Which of these isn’t a custodian function?
a. Provides a daily statement
b. Safekeeping securities
c. Central counterparty
d. Securities lending/ borrowing facilities
e. Holds securities on behalf of an investor
f. Settlement of transaction and collecting income
g. Global Custody
Which of these is not a function of loan syndication?
a. Contact management,
b. Book building
c. Tracking Customer appetites for debt
d. Market tracking
e. Maintaining deal calendars
f. Security lending
abc corporation has a market capitalization of 600 million $. They decide to split shares in the ratio of 3:1. What will be the market capitalization of abc after stock split?
600 mn $
1200 mn $
1800 mn $
2400 mn $
18. Institutional investors may execute their orders through
a. Buy side Order Management Systems (OMS)
b. “Direct Market Access (DMA)”
c. Sell side Order Management Systems (OMS)
d. All of the above
Which of the following is not a money market instrument?
Treasury bills,
commercial paper,
Repos
Forex options
Which of these is not a func of I-bank?
Loan syndication
Treasury activities
Transactions financing and cash management
Sales and trading
Which of the following is securitized product?
Convertible bonds
Unsecured debt with put options for investor
Variable rate bonds with warrants
Bond backed by credit card receivables
What does a company goes public?
Greater scrutiny
To increase market capitalization
Gain ratings
Cant remember the option
Answer: The Company cannot reasonably expect to raise venture capital from institutional funds.
The company needs to raise a very large amount of capital (greater than $15 million) and it is difficult or time consuming to raise this amount through private placement alone
The company requires a significant amount of capital permanently that it won't have to pay back to a bank or other lender.
A company seeks growth through acquisitions, and needs a "currency" other than cash to attract and consummate deals.
A buys a call option with a strike price of Rs 378 and premium Rs. 5. On the expiry day under which scenario will he exercise his option
Price is Rs.400
Price is Rs.378
Price is 373
Doesn’t depend on the price
When is a notice of execution send and by whom
At the point of sale, seller
After executing the order, exchange
After placing the order, Trader
None
A corporate client is likely to use the services of an IB for
Buying other company
Streamlining its receivable management
Raising money through capital market
Obtaining a credit rating
26. How many max investors are allowed in hedge funds?
a. 25
b. 100
c. 500
d. 1000
27. Nasdaq
a.dealer
b.broker
c.market maker
28. Roles of investment Banks involves except
Deposit money
29. What is meant by Naked Writing?
Ans: Derivatives: Payoff to seller of Put Option
30. Question on STP :
The benefits of STP and a T+1 settlement are manifold:
· The most tangible benefit is cost and time savings by virtue of reduction in settlement cycle.
· Reduction in default risk as a T+1 settlement would mean streamlined clearing and settlement latest by the next day of trading.
· It would lead to fewer transaction errors and hence bring down costs associated with correcting these errors.
· Reduction in operational risk due to minimal manual intervention.
31. Market data information providers like Bloomberg and Reuters.
32. Front office Function: Collateral Management
33.
Equity
MACD, Moving average of price, RSI
Fixed Income
Yield to Maturity or Asset swap arbitrage pricing for securities
Zero Coupon Yield Curve
Derivatives
Greeks (Delta, Vega), Volatility Surfaces
Credit Trading, Loans
Sensitivities to default rates, LGD (Loss given default), EDF (Estimated default frequency)
34. choice of brokers to place an order:
35. Question Best Execution
Ans: The opportunity for "price improvement" – which is the opportunity, but not the guarantee, for an order to be executed at a better price than what is currently quoted publicly – is an important factor a broker should consider in executing its customers' orders. Other factors include the speed and the likelihood of execution.
36. Risks associated with the Custodian’s role
The areas that a custodian must pay careful attention to include:
· Holding of securities and cash
· Acting upon settlement instructions
· Deliveries and receipt of physical securities and cash
· Management of corporate actions
· Failure to focus on these areas introduces the risk of loss from both the account holder’s and the custodian’s perspective.
37. Types of reconciliation
The list of reconciliation is depicted in the figure below (the dashed arrows represent reconciliation):
Trade-by-Trade Reconciliation: This is an automated reconciliation that proves that all trades captured by the traders are successfully captured within the settlement system. Not conducting this reconciliation can result in failure to process individual trades. The possibility of trades not coming into the settlement system is very much there. That’s why this reconciliation is important. Its importance will increase as the settlement cycle shrinks.
Trading Position Reconciliation: This reconciliation is designed to prove that the trade dated security positions calculated by the trading system agree with the equivalent positions calculated by the settlement system. Not conducting this reconciliation can result in trades being executed from the incorrect trading position, where the trading system is found to be incorrect. Discrepancies can arise where trades have not been received by the settlement system, and where trade amendments and cancellations have been effected within one system but not the other.
To be certain of being in a fully reconciled position, both the trade-by-trade and trading position reconciliations should be done.
Open Trades Reconciliation: This reconciliation aims to prove that open trades held within internal books and records are actually open at the relevant custodian, or generally have the same status at the custodian.
Custodian Position Reconciliation: The aim of this reconciliation is to prove that settled securities positions held within internal books and records agree with the equivalent positions as advised by the custodian. This is therefore another fundamental control and confirms to the firm that the securities that it believes are held by the custodian are actually held by the custodian.
Settlement System Integrity Reconciliation: This reconciliation intends to prove that the settlement system is in balance i.e. the total of securities owned is equal to the sum of the location position. If the firm employs double-entry bookkeeping, theoretically this will be true by default. Still this reconciliation must be performed frequently to prove that the system is in balance.
38. Pricing/earning ratio…
39 . Question on forward rate:
Spot Rate:
Spot rate is the interest rate on an investment starting today and ending after some specified day. Thus 3 year spot rate from today means the rate of return on an instrument with a three-year maturity and starting from today.
Forward Rate:
A forward rate is an interest rate contracted today on an investment that will be initiated after some time in future. In other words it is spot rate in future.
Forward rates and spot rates are interlinked.
An investment bank that deals mostly in international finance is referred to as a Merchant Banks. Their knowledge in international finances makes merchant banks specialists in dealing with multinational corporations.
Depository Trust Company is a central repository through which members electronically transfer stock and bond certificates (a clearinghouse facility).
One question on “Chinese Wall” – all options were wrong.
43. Securities Underwriting -
Equity Underwriting and Debt Underwriting
44. Question on NSCC
Answer: The largest clearinghouse in the US is the National Securities Clearing Corporation(NSCC). It is owned by brokers and helps broker’s clear trades among themselves. The securities eligible for clearing at NSCC include:
- Corporate bonds and Equities listed on New York Stock Exchange (NYSE) and American Stock Exchange (AMEX)
- Corporate bonds and equities listed on over the counter markets like NASDAQ
- American Depository Receipts (ADRs)
- Municipal bonds
45. Family with two daughters and a son wants to invest their money where they don’t have risk and also get profit.
Where will they invest?
i. stocks
ii. Government bonds
iii. 50% government and 50% multinational bonds
iv. Multinational bonds
46. Brokerage is regulated by_______ in US
47. Out cry Market
48. when put and call options occur at same time – Limit Order
49. Dannis bought 10 shares on 1 july.
On 4th July he sold 6, On 8th July he sold another 6.
At end of 8th July he had how many shares, if he goes through T+2 settlement cycle?
Answer: Prositive, 4
50. Company had 75 core shares, and 50 core shares were given as dividend, so how much was the dividend coverage?
a) 25
b) 1.5
c) 0.667
d) None of these
51. Initial margin is 60%, maintenance margin is 40%, total investment is 5000$
At the end of the day how much should be there?? – Ans: 3000
52. Question on Payment Due date, and Record date? 30th June he has shares, and 1st July is Payment Due date
53. Leverage Finance :
Leveraged finance is commonly employed to achieve a specific, often temporary, objective: to make an acquisition, to effect a buy-out, to repurchase shares or fund a one-time dividend, or to invest in a self-sustaining cash-generating asset.
54. US Trading cycle has- What is true for Settlement? What is true for T+3 trading
55. What is true for Clearing?
Ans: The clearing process is generally taken care of by a Clearinghouse. This is a specialized institution, which takes care of the following:
· Netting
· Determining the obligations of broker-dealers
· Counter party risk guarantee
56. If shares are directly traded in market:-
· Algorithms
· Direct Market Access
· Automatic Trading
· None of these
57. Find the odd one: - Stock Splits, Issuer, Bond, Treasury bills.
58. Company is about to close, what will the company do:-
Stock Splits, Reverse stock, Dividend, none of these.
59. If company’s shares value is going down, what will they do, given time of 4 months? US market is doing well.
Ans: Short term,
60. What is meant by XD?
After the book closure, shares are quoted as ex-dividend, ex-bonus (if bonus has been announced) or ex-rights (if announced) prices, and carry XD, XB, XR after the price figures.
61. Income is positive and yield curve is downwards. True or False.
Ans: False
62. One question on Bid/Ask Price... True or False
What happens to the good till cancelled order at EOD?
a) Cancelled by the exchange
b) Expired
c) Carry forward to the next day
d) Carry forward to the next till the person cancels the order
Investment Banking Related Questions
a. Order
b. Market
c. None
2. Primary function of exchange is
Provide liquidity
Provide Info
Protect Investor
Conduct Auction
3. A Xyz airline has just completed an IPO & its stock is going to be traded 4pm
15th march. Where it will be traded?
Primary
Secondary
Derivative
None
4. For Call option stock price is 100 and strike price is 105 …the option is in
a. In the money
b. Out the money
c. at the money
5. Which is not a methodology of equity (IPO)
a.DCF
b.Internal Rate Return
c.Relative value valuation
d.Divident growth rate
6. A question on Reconciliation:-
Ans:- Settlement System Integrity Reconciliation: This reconciliation intends to prove that the settlement system is in balance i.e. the total of securities owned is equal to the sum of the location position. If the firm employs double-entry bookkeeping, theoretically this will be true by default. Still this reconciliation must be performed frequently to prove that the system is in balance.
7. Find the correct order - Order,trade,confirmation,affirmation,NOE
Ans: order, NOE, trade, confirmation, affirmation
8. Which is a derivative market
LSE,CBOE,NYSE
9. The custodian having worldwide network of sub-custodian is
1. Local custodian
2. Global custodian
3. NCSD
4. ICSD
10. on a margin call
1. The broker draws fund from the margin acc
2. The investor adds fund to the margin acc
3. The broker adds fund to margin acc
4. The investor draw fund to margin acc
11. What is the function of Agents in Clearing??
12. Which one is correct?
Answer:
a) If a buyer of securities is unable to make payment for the purchase, he can be made to go through a sell-out procedure.
b) Securities-driven transactions have one more objective. Continued failure of the seller to make a good delivery can cause the buyer to invoke buy-in procedures. In a buy-in, the buyer buys the necessary quantity of securities at the current market price. The securities are then delivered to the buyer and any additional costs incurred in the buy-in are charged to the original seller.
13. Prime broker works on behalf of which brokerage:-
a) Retail Brokerage
b) Investment Brokerage
c) None of these
c) Discount Brokerage
14. Define prime brokerage transaction
Ans: The executing broker gives up to the prime broker
15. Which of these isn’t a custodian function?
a. Provides a daily statement
b. Safekeeping securities
c. Central counterparty
d. Securities lending/ borrowing facilities
e. Holds securities on behalf of an investor
f. Settlement of transaction and collecting income
g. Global Custody
Which of these is not a function of loan syndication?
a. Contact management,
b. Book building
c. Tracking Customer appetites for debt
d. Market tracking
e. Maintaining deal calendars
f. Security lending
abc corporation has a market capitalization of 600 million $. They decide to split shares in the ratio of 3:1. What will be the market capitalization of abc after stock split?
600 mn $
1200 mn $
1800 mn $
2400 mn $
18. Institutional investors may execute their orders through
a. Buy side Order Management Systems (OMS)
b. “Direct Market Access (DMA)”
c. Sell side Order Management Systems (OMS)
d. All of the above
Which of the following is not a money market instrument?
Treasury bills,
commercial paper,
Repos
Forex options
Which of these is not a func of I-bank?
Loan syndication
Treasury activities
Transactions financing and cash management
Sales and trading
Which of the following is securitized product?
Convertible bonds
Unsecured debt with put options for investor
Variable rate bonds with warrants
Bond backed by credit card receivables
What does a company goes public?
Greater scrutiny
To increase market capitalization
Gain ratings
Cant remember the option
Answer: The Company cannot reasonably expect to raise venture capital from institutional funds.
The company needs to raise a very large amount of capital (greater than $15 million) and it is difficult or time consuming to raise this amount through private placement alone
The company requires a significant amount of capital permanently that it won't have to pay back to a bank or other lender.
A company seeks growth through acquisitions, and needs a "currency" other than cash to attract and consummate deals.
A buys a call option with a strike price of Rs 378 and premium Rs. 5. On the expiry day under which scenario will he exercise his option
Price is Rs.400
Price is Rs.378
Price is 373
Doesn’t depend on the price
When is a notice of execution send and by whom
At the point of sale, seller
After executing the order, exchange
After placing the order, Trader
None
A corporate client is likely to use the services of an IB for
Buying other company
Streamlining its receivable management
Raising money through capital market
Obtaining a credit rating
26. How many max investors are allowed in hedge funds?
a. 25
b. 100
c. 500
d. 1000
27. Nasdaq
a.dealer
b.broker
c.market maker
28. Roles of investment Banks involves except
Deposit money
29. What is meant by Naked Writing?
Ans: Derivatives: Payoff to seller of Put Option
30. Question on STP :
The benefits of STP and a T+1 settlement are manifold:
· The most tangible benefit is cost and time savings by virtue of reduction in settlement cycle.
· Reduction in default risk as a T+1 settlement would mean streamlined clearing and settlement latest by the next day of trading.
· It would lead to fewer transaction errors and hence bring down costs associated with correcting these errors.
· Reduction in operational risk due to minimal manual intervention.
31. Market data information providers like Bloomberg and Reuters.
32. Front office Function: Collateral Management
33.
Equity
MACD, Moving average of price, RSI
Fixed Income
Yield to Maturity or Asset swap arbitrage pricing for securities
Zero Coupon Yield Curve
Derivatives
Greeks (Delta, Vega), Volatility Surfaces
Credit Trading, Loans
Sensitivities to default rates, LGD (Loss given default), EDF (Estimated default frequency)
34. choice of brokers to place an order:
35. Question Best Execution
Ans: The opportunity for "price improvement" – which is the opportunity, but not the guarantee, for an order to be executed at a better price than what is currently quoted publicly – is an important factor a broker should consider in executing its customers' orders. Other factors include the speed and the likelihood of execution.
36. Risks associated with the Custodian’s role
The areas that a custodian must pay careful attention to include:
· Holding of securities and cash
· Acting upon settlement instructions
· Deliveries and receipt of physical securities and cash
· Management of corporate actions
· Failure to focus on these areas introduces the risk of loss from both the account holder’s and the custodian’s perspective.
37. Types of reconciliation
The list of reconciliation is depicted in the figure below (the dashed arrows represent reconciliation):
Trade-by-Trade Reconciliation: This is an automated reconciliation that proves that all trades captured by the traders are successfully captured within the settlement system. Not conducting this reconciliation can result in failure to process individual trades. The possibility of trades not coming into the settlement system is very much there. That’s why this reconciliation is important. Its importance will increase as the settlement cycle shrinks.
Trading Position Reconciliation: This reconciliation is designed to prove that the trade dated security positions calculated by the trading system agree with the equivalent positions calculated by the settlement system. Not conducting this reconciliation can result in trades being executed from the incorrect trading position, where the trading system is found to be incorrect. Discrepancies can arise where trades have not been received by the settlement system, and where trade amendments and cancellations have been effected within one system but not the other.
To be certain of being in a fully reconciled position, both the trade-by-trade and trading position reconciliations should be done.
Open Trades Reconciliation: This reconciliation aims to prove that open trades held within internal books and records are actually open at the relevant custodian, or generally have the same status at the custodian.
Custodian Position Reconciliation: The aim of this reconciliation is to prove that settled securities positions held within internal books and records agree with the equivalent positions as advised by the custodian. This is therefore another fundamental control and confirms to the firm that the securities that it believes are held by the custodian are actually held by the custodian.
Settlement System Integrity Reconciliation: This reconciliation intends to prove that the settlement system is in balance i.e. the total of securities owned is equal to the sum of the location position. If the firm employs double-entry bookkeeping, theoretically this will be true by default. Still this reconciliation must be performed frequently to prove that the system is in balance.
38. Pricing/earning ratio…
39 . Question on forward rate:
Spot Rate:
Spot rate is the interest rate on an investment starting today and ending after some specified day. Thus 3 year spot rate from today means the rate of return on an instrument with a three-year maturity and starting from today.
Forward Rate:
A forward rate is an interest rate contracted today on an investment that will be initiated after some time in future. In other words it is spot rate in future.
Forward rates and spot rates are interlinked.
An investment bank that deals mostly in international finance is referred to as a Merchant Banks. Their knowledge in international finances makes merchant banks specialists in dealing with multinational corporations.
Depository Trust Company is a central repository through which members electronically transfer stock and bond certificates (a clearinghouse facility).
One question on “Chinese Wall” – all options were wrong.
43. Securities Underwriting -
Equity Underwriting and Debt Underwriting
44. Question on NSCC
Answer: The largest clearinghouse in the US is the National Securities Clearing Corporation(NSCC). It is owned by brokers and helps broker’s clear trades among themselves. The securities eligible for clearing at NSCC include:
- Corporate bonds and Equities listed on New York Stock Exchange (NYSE) and American Stock Exchange (AMEX)
- Corporate bonds and equities listed on over the counter markets like NASDAQ
- American Depository Receipts (ADRs)
- Municipal bonds
45. Family with two daughters and a son wants to invest their money where they don’t have risk and also get profit.
Where will they invest?
i. stocks
ii. Government bonds
iii. 50% government and 50% multinational bonds
iv. Multinational bonds
46. Brokerage is regulated by_______ in US
47. Out cry Market
48. when put and call options occur at same time – Limit Order
49. Dannis bought 10 shares on 1 july.
On 4th July he sold 6, On 8th July he sold another 6.
At end of 8th July he had how many shares, if he goes through T+2 settlement cycle?
Answer: Prositive, 4
50. Company had 75 core shares, and 50 core shares were given as dividend, so how much was the dividend coverage?
a) 25
b) 1.5
c) 0.667
d) None of these
51. Initial margin is 60%, maintenance margin is 40%, total investment is 5000$
At the end of the day how much should be there?? – Ans: 3000
52. Question on Payment Due date, and Record date? 30th June he has shares, and 1st July is Payment Due date
53. Leverage Finance :
Leveraged finance is commonly employed to achieve a specific, often temporary, objective: to make an acquisition, to effect a buy-out, to repurchase shares or fund a one-time dividend, or to invest in a self-sustaining cash-generating asset.
54. US Trading cycle has- What is true for Settlement? What is true for T+3 trading
55. What is true for Clearing?
Ans: The clearing process is generally taken care of by a Clearinghouse. This is a specialized institution, which takes care of the following:
· Netting
· Determining the obligations of broker-dealers
· Counter party risk guarantee
56. If shares are directly traded in market:-
· Algorithms
· Direct Market Access
· Automatic Trading
· None of these
57. Find the odd one: - Stock Splits, Issuer, Bond, Treasury bills.
58. Company is about to close, what will the company do:-
Stock Splits, Reverse stock, Dividend, none of these.
59. If company’s shares value is going down, what will they do, given time of 4 months? US market is doing well.
Ans: Short term,
60. What is meant by XD?
After the book closure, shares are quoted as ex-dividend, ex-bonus (if bonus has been announced) or ex-rights (if announced) prices, and carry XD, XB, XR after the price figures.
61. Income is positive and yield curve is downwards. True or False.
Ans: False
62. One question on Bid/Ask Price... True or False
What happens to the good till cancelled order at EOD?
a) Cancelled by the exchange
b) Expired
c) Carry forward to the next day
d) Carry forward to the next till the person cancels the order
Wednesday, July 20, 2011
VbScript Statement
Tuesday, July 19, 2011
Excel and QTP
Add Data to a Spreadsheet Cell Demonstration script that adds the words "Test Value" to cell 1,1 in a new spreadsheet.
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
objExcel.Cells(1, 1).Value = "Test value"
Add Formatted Data to a Spreadsheet Demonstration script that adds the words "test value" to a new spreadsheet, then formats the cell containing the value.
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
objExcel.Cells(1, 1).Value = "Test value"
objExcel.Cells(1, 1).Font.Bold = TRUE
objExcel.Cells(1, 1).Font.Size = 24
objExcel.Cells(1, 1).Font.ColorIndex = 3
Create User Accounts Based on Information in a Spreadsheet Demonstration script that creates new Active Directory user accounts based on information stored in an Excel spreadsheet.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open _
("C:\Scripts\New_users.xls")
intRow = 2
Do Until objExcel.Cells(intRow,1).Value = ""
Set objOU = GetObject("ou=Finance, dc=fabrikam, dc=com")
Set objUser = objOU.Create _
("User", "cn=" & objExcel.Cells(intRow, 1).Value)
objUser.sAMAccountName = objExcel.Cells(intRow, 2).Value
objUser.GivenName = objExcel.Cells(intRow, 3).Value
objUser.SN = objExcel.Cells(intRow, 4).Value
objUser.AccountDisabled = FALSE
objUser.SetInfo
intRow = intRow + 1
Loop
objExcel.Quit
Format a Range of Cells Demonstration script that adds data to four different cells in a spreadsheet, then uses the Range object to format multiple cells at the same time.
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
objExcel.Cells(1, 1).Value = "Name"
objExcel.Cells(1, 1).Font.Bold = TRUE
objExcel.Cells(1, 1).Interior.ColorIndex = 30
objExcel.Cells(1, 1).Font.ColorIndex = 2
objExcel.Cells(2, 1).Value = "Test value 1"
objExcel.Cells(3, 1).Value = "Test value 2"
objExcel.Cells(4, 1).Value = "Tets value 3"
objExcel.Cells(5, 1).Value = "Test value 4"
Set objRange = objExcel.Range("A1","A5")
objRange.Font.Size = 14
Set objRange = objExcel.Range("A2","A5")
objRange.Interior.ColorIndex = 36
Set objRange = objExcel.ActiveCell.EntireColumn
objRange.AutoFit()
List Active Directory Data in a Spreadsheet Demonstration script that retrieves data from Active Directory and then displays that data in an Excel spreadsheet.
Const ADS_SCOPE_SUBTREE = 2
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
objExcel.Cells(1, 1).Value = "Last name"
objExcel.Cells(1, 2).Value = "First name"
objExcel.Cells(1, 3).Value = "Department"
objExcel.Cells(1, 4).Value = "Phone number"
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 100
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.CommandText = _
"SELECT givenName, SN, department, telephoneNumber FROM " _
& "'LDAP://dc=fabrikam,dc=microsoft,dc=com' WHERE " _
& "objectCategory='user'"
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
x = 2
Do Until objRecordSet.EOF
objExcel.Cells(x, 1).Value = _
objRecordSet.Fields("SN").Value
objExcel.Cells(x, 2).Value = _
objRecordSet.Fields("givenName").Value
objExcel.Cells(x, 3).Value = _
objRecordSet.Fields("department").Value
objExcel.Cells(x, 4).Value = _
objRecordSet.Fields("telephoneNumber").Value
x = x + 1
objRecordSet.MoveNext
Loop
Set objRange = objExcel.Range("A1")
objRange.Activate
Set objRange = objExcel.ActiveCell.EntireColumn
objRange.Autofit()
Set objRange = objExcel.Range("B1")
objRange.Activate
Set objRange = objExcel.ActiveCell.EntireColumn
objRange.Autofit()
Set objRange = objExcel.Range("C1")
objRange.Activate
Set objRange = objExcel.ActiveCell.EntireColumn
objRange.Autofit()
Set objRange = objExcel.Range("D1")
objRange.Activate
Set objRange = objExcel.ActiveCell.EntireColumn
objRange.Autofit()
Set objRange = objExcel.Range("A1").SpecialCells(11)
Set objRange2 = objExcel.Range("C1")
Set objRange3 = objExcel.Range("A1")
List Excel Color Values Demonstration script that displays the various colors -- and their related color index -- available when programmatically controlling Microsoft Excel.
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
For i = 1 to 56
objExcel.Cells(i, 1).Value = i
objExcel.Cells(i, 1).Interior.ColorIndex = i
Next
List Service Data in a Spreadsheet Demonstration script that retrieves information about each service running on a computer, and then displays that data in an Excel spreadsheet.
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
x = 1
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Set colServices = objWMIService.ExecQuery _
("Select * From Win32_Service")
For Each objService in colServices
objExcel.Cells(x, 1) = objService.Name
objExcel.Cells(x, 2) = objService.State
x = x + 1
Next
Open an Excel Spreadsheet Demonstration script that opens an existing Excel spreadsheet named C:\Scripts\New_users.xls.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Scripts\New_users.xls")
Read an Excel Spreadsheet Demonstration script that reads the values stored in a spreadsheet named C:\Scripts\New_users.xls.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open _
("C:\Scripts\New_users.xls")
intRow = 2
Do Until objExcel.Cells(intRow,1).Value = ""
Wscript.Echo "CN: " & objExcel.Cells(intRow, 1).Value
Wscript.Echo "sAMAccountName: " & objExcel.Cells(intRow, 2).Value
Wscript.Echo "GivenName: " & objExcel.Cells(intRow, 3).Value
Wscript.Echo "LastName: " & objExcel.Cells(intRow, 4).Value
intRow = intRow + 1
Loop
objExcel.Quit
Source:- http://www.activexperts.com/activmonitor/windowsmanagement/scripts/msoffice/excel/
QTP Code to read an excel file
Dim arr() ' Declares the array arr
zRead_frm_Excel "c:\data.xls","Sheet1",1
For i=0 to ubound(arr)-1
msgbox arr(i)
next
' This function is to read and close the xl arg1=path of xl, arg2=sheet name, arg3=startn row
Function zRead_frm_Excel(xl,sheet,srt_row)
Set xlApp = GetObject("","Excel.Application")
xlApp.visible = true
Set xlWrkbk = xlApp.Workbooks.Open(xl)
Set xlWrksht = xlWrkbk.Worksheets(sheet) ' Data is the name of the sheetint
StartRow = srt_row ' Row from whcih you need to
startrow_cnt= xlWrksht.UsedRange.Rows.Count
ReDim arr(row_cnt)
ub= ubound(arr)-1
i=0
For intRow = intStartRow to xlWrksht.UsedRange.Rows.Count
strAccountNumber = Trim(xlWrksht.Range("A" & intRow)) ' Column A
strAccuntName = Trim(xlWrksht.Range("B" & intRow)) ' Column B
dtDate = Trim(xlWrksht.Range("C" & intRow)) ' Column C
arr_value=strAccountNumber&strAccuntName&dtDate
arr(i)=arr_value
i=i+1
Next
xlApp.Quit
Set xlApp = Nothing
zRead_frm_Excel=arr
End Function
How To open Password Protected Excel sheets
Function UnprotectXL(filePath,fileName,pwd,writeresPwd)
Set objExcel=CreateObject(“Excel.Application”)
objExcel.Visible=false
testData=filePath&”\”&fileName
Set oWorkbook=objExcel.Workbooks
Set myWkbook=objExcel.Workbooks.open (testData,0,False,5,pwd,writeresPwd)
objExcel.DisplayAlerts=False
oWorkbook(fileName).Activate
For Each w in objExcel.Workbooks
w.SaveAs testData,,”",”"
Next
objExcel.Workbooks.Close
objExcel.Quit
Set oWorkbook=Nothing
Set objExcel=Nothing
End Function
Function ProtectXL(filePath,fileName,pwd,writeresPwd)
On Error Resume Next
Set objExcel=CreateObject(“Excel.Application”)
objExcel.Visible=False
testData=filePath&”\”&fileName
Set oWorkbook=objExcel.Workbooks
Set outputWkbook=objExcel.Workbooks.open (testData,0,False)
oWorkbook(testData).Activate
objExcel.DisplayAlerts=False
outputWkbook.SaveAs testData,,pwd,writeresPwd
outputWkbook.Close
objExcel.Workbooks.Close
objExcel.Quit
Set outputWkbook=Nothing
Set objExcel=Nothing
End Function
‘Call ProtectXL(“C:\Documents and Settings\kmohankumar\Desktop”,”4.xls”,”test123″,”test123″)
‘Call UnprotectXL(“C:\Documents and Settings\kmohankumar\Desktop”,”4.xls”,”test123″,”test123″)
November 27, 2008 Posted by QTP Excel Automation 10 Comments
Search for a particular value in Excel
Set appExcel = CreateObject(“Excel.Application”)
appExcel.visible=true
Set objWorkBook = appExcel.Workbooks.Open (filepath)’opens the sheet
Set objSheet = appExcel.Sheets(“Sheet1″)’ To select particular sheet
With objSheet.UsedRange ‘ select the used range in particular sheet
Set c = .Find (“nn”)’ data to find
For each c in objSheet.UsedRange’ Loop through the used range
If c=”nn” then’ compare with the expected data
c.Interior.ColorIndex = 40′ make the gary color if it finds the data
End If
Set c = .FindNext(c)’ next search
next
End With
objWorkBook.save
objWorkBook.close
set appExcel=nothing
October 21, 2008 Posted by QTP Excel Automation, Uncategorized excel and qtp, Excel Automation, searc for a string in excel 15 Comments
Copy an excel sheet to another excel
Following is the code to copy the conntents of a sheet in one excel to another excel sheet
Set objExcel = CreateObject(“Excel.Application”)
objExcel.Visible = True
Set objWorkbook1= objExcel.Workbooks.Open(“C:\Documents and Settings\mohan.kakarla\Desktop\1.xls”)
Set objWorkbook2= objExcel.Workbooks.Open(“C:\Documents and Settings\mohan.kakarla\Desktop\2.xls”)
objWorkbook1.Worksheets(“Sheet1″).UsedRange.Copy
objWorkbook2.Worksheets(“Sheet1″).Range(“A1″).PasteSpecial Paste =xlValues
objWorkbook1.save
objWorkbook2.save
objWorkbook1.close
objWorkbook2.close
set objExcel=nothing
June 9, 2008 Posted by QTP Excel Automation, Uncategorized excel copy, excel copy and paste, execl automation, qtp excel copy and paste 13 Comments
Compare 2 Excel sheets cell by cell
This code will open two excel sheet and compare each sheet cell by cell, if any changes there in cells , it will highlight the cells in red color in the first sheet.
Set objExcel = CreateObject(“Excel.Application”)
objExcel.Visible = True
Set objWorkbook1= objExcel.Workbooks.Open(“C:Documents andSettingsmohan.kakarlaDesktopDocs1.xls”)
Set objWorkbook2= objExcel.Workbooks.Open(“C:Documents and
Settingsmohan.kakarlaDesktopDocs2.xls”)
Set objWorksheet1= objWorkbook1.Worksheets(1)
Set objWorksheet2= objWorkbook2.Worksheets(1)
For Each cell In objWorksheet1.UsedRange
If cell.Value <> objWorksheet2.Range(cell.Address).Value Then
cell.Interior.ColorIndex = 3′Highlights in red color if any changes in cells
Else
cell.Interior.ColorIndex = 0
End If
Next
set objExcel=nothing
February 27, 2008 Posted by QTP Excel Automation AOM, Automation Testing, Compare 2 Excel sheets, Compare 2 Excel sheets cell by cell, Excel Automation, QTP, QTP Additional Faqs, QTP AOM, VBS, VBScripting 44 Comments
Excel Sorting(Ascending , Descending) By Rows and Columns
Excel Sorting By Row:
Const xlAscending = 1
Const xlNo = 2
Const xlSortRows = 2
Set objExcel = CreateObject(“Excel.Application”)
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Open(“C:Documents and Settingsmohan.kakarlaDesktopDocs1.xls”)
Set objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Cells(1,1).activate
Set objRange = objExcel.ActiveCell.EntireRow
objRange.Sort objRange, xlAscending, , , , , , xlNo, , , xlSortRows
set objExcel=nothing
Excel Sorting By Colum :
Const xlAscending = 1′represents the sorting type 1 for Ascending 2 for Desc
Const xlYes = 1
Set objExcel = CreateObject(“Excel.Application”)’Create the excel object
objExcel.Visible = True’Make excel visible
Set objWorkbook = _
objExcel.Workbooks.Open(“C:\Documents and Settings\mohan.kakarla\Desktop\Docs1.xls”)’Open the
document
Set objWorksheet = objWorkbook.Worksheets(1)’select the sheet based on the index .. 1,2 ,3 …
Set objRange = objWorksheet.UsedRange’which select the range of the cells has some data other than blank
Set objRange2 = objExcel.Range(“A1″)’ select the column to sort
objRange.Sort objRange2, xlAscending, , , , , , xlYes
set objExcel=nothing
Reference: MSDN
February 26, 2008 Posted by QTP Excel Automation AOM, Automation Testing, Excel Automation, Excel Sorting, Excel Sorting Ascending, Excel Sorting By Colum, Excel Sorting By Row, Excel Sorting Descending, QTP, QTP Additional Faqs, QTP AOM, VBS, VBScripting 7 Comments
DELETE ROWS FROM XL SHEET
DELETE ROWS FROM
XL SHEET
Public Function BIP_xlsDeleteRowRange (sSrcPath, sDestPath, sStartRow, sEndRow) ‘Create Excel object
Set oExcel = CreateObject(“Excel.Application”)
‘Sets the application to raise no app alerts
‘In this case it will allow a file overwrite w/o raising a ‘yes/no’ dialog
oExcel.DisplayAlerts = False
‘Open Book in Excel
Set oBook = oExcel.Workbooks.Open(sSrcPath)
‘Set Activesheet
Set oSheet = oExcel.Activesheet
‘Delete row range
oSheet.Rows(sStartRow +”:”+ sEndRow).Delete
‘Save new book to Excel file
oBook.SaveAs (sDestPath)
‘Close the xls file
oExcel.Workbooks.Close()
End Function
February 14, 2008 Posted by QTP Excel Automation AOM, Automation Testing, Excel Automation, QTP, QTP AOM, VBS, VBScripting, word automation 10 Comments
DELETE COLUMNS FROM XL SHEET
DELETE COLUMNS FROM
XL SHEET
Public Function BIP_xlsDeleteColumnRange (sSrcPath, sDestPath, sStartCol, sEndCol) ‘Create Excel object
Set oExcel = CreateObject(“Excel.Application”)
‘Sets the application to raise no app alerts
‘In this case it will allow a file overwrite w/o raising a ‘yes/no’ dialog
oExcel.DisplayAlerts = False‘Open Book in Excel
Set oBook = oExcel.Workbooks.Open(sSrcPath)
‘Set Activesheet
Set oSheet = oExcel.Activesheet
‘Delete row range
oSheet.Columns(sStartCol + “:” + sEndCol).Delete
‘Save new book to Excel file
oBook.SaveAs (sDestPath)
‘Close the xls file
oExcel.Workbooks.Close()
End Function
February 14, 2008 Posted by QTP Excel Automation AOM, Automation Testing, DELETE COLUMNS FROM XL SHEET, Excel Automation, QTP, QTP AOM, VBS, VBScripting, word automation Leave a Comment
ADODB CONNECTION TO READ DATA FROM EXCEL SHEET
Function GetContentFromDB (strFileName, strSQLStatement)
Dim objAdCon, objAdRs
Set objAdCon = CreateObject(“ADODB.Connection”)
objAdCon.Open “DRIVER={Microsoft Excel Driver (*.xls)};DBQ=”&strFileName & “;Readonly=True”
If Err <> 0 Then
Reporter.ReportEvent micFail,”Create Connection”, “[Connection] Error has occured. Error : ” & Err
Set obj_UDF_getRecordset = Nothing
Exit Function
End If
Set objAdRs = CreateObject(“ADODB.Recordset”)
objAdRs.CursorLocation=3 ‘ set the cursor to use adUseClient – disconnected recordset
objAdRs.Open strSQLStatement, objAdCon, 1, 3
MsgBox objAdRs.fields(4).name
While objAdRs.EOF=false
For i=0 to objAdRs.Fields.count
Msgbox objAdRs.fields(i)
Next
objAdRs.moveNext
Wend
If Err<>0 Then
Reporter.ReportEvent micFail,”Open Recordset”, “Error has occured.Error Code : ” & Err
Set obj_UDF_getRecordset = Nothing
Exit Function
End If
Set objAdRs.ActiveConnection = Nothing
objAdCon.Close
Set objAdCon = Nothing
End Function
Set rsAddin = GetContentsFromDB(“C:\Documents and Settings\mohank\Desktop\Login.xls”, “Select * from [Login$]“)