User's Guide for converting CUSIPs to 6-digit CUSIPs or 8-digit CUSIPs using cusiper program
About the program
Title: cusiper
Description:

Prefix zeros to CUSIPs whose preceding zeros were truncated in MS Excel, and then

1) Convert 6-digit CUSIPs to 8-digit CUSIPs for CRSP, I/B/E/S and Execucomp.

2) OR keep it as 6-digit CUSIPs for Compustat.

3) OR from 8-digit CUSIPs from, say, Thomson, to 8-digit CUSIPs with leading zeros and replaced zeros for last digit.

4) OR from 8-digit CUSIPs to 6-digit CUSIPs.


Important things to remember:

  • This program can only run on Windows operating systems, such as Windows XP. It is possible that Windows Scripting host, which is required to run this program, is not installed on your PC. You will get an error message that looks like "WScript....not found". In this case, you need to download Windows® Script files. If you are using Windows 2000, XP, go to Windows Script 5.6 for Windows XP and Windows 2000 to download and install Windows® Script. If you are using Windows 98, me, NT 4.0, go to Windows Script 5.6 for Windows 98, Windows Millennium Edition, and Windows NT 4.0 to download and install Windows® Script.
  • Source file MUST be a .txt file with only CUSIPs with one CUSIP on each line.
  • Output file of conversion will ALWAYS be named NEWCUSIPS.txt. Please back up the output file each time you run the program, otherwise it will be OVERWRITTEN.
  • Most of time, NEWCUSIPS.txt will be in the same folder as you ran the cusiper program, which is the path or folder before > when you enter the command line. For example, in step 3.a of the first example below, the path before > is C:\Documents and Settings\bordelon, then NEWCUSIPS.txt will be in that folder, not where you saved the cusiper program. But in step 3.b, the path before > is H:, then NEWCUSIPS.txt will be in the root of H: drive, not where you saved the cusiper program. I encourage you run the program from the same folder where you saved it to avoid confusion. Please read the message on the pop up message box to find out where NEWCUSIPS.txt is. If you couldn't find it, just do a search for file named "NEWCUSIPS".
  • For command line, there MUST be one space between program name (e.g. C:\temp\cusiper), absolute path of your .txt file to convert from (e.g. C:\temp\my6cusip.txt) and /digflag:6to6.

If you encounter any problems, please contact Bobray Bordelon at bordelon@princeton.edu.

 


Here are steps to convert CUSIPs
Step 1: Download the cusiper program

If you didn't download the cusiper program yet, please go to

http://firestone.princeton.edu/econlib/cusip/cusiper.wsf

Note: DON'T double click the file, or it will execute and display an error message. Please right click on the URL to save the file to your local computer, e.g. your H: drive. DON'T save the file to My Documents, desktop, or any folders with names that are longer than 8 characters.

Example:

In this example, I saved my cusiper program in H:\cusip folder on my computer. So the path of the cusiper program is H:\cusip\cusiper. But if you save it in difference folder or drive, for example, Z drive thesis folder, then the path of the cusiper program is Z:\thesis\cusiper.

Here is content of my6cusip.txt that I want to convert, which is in folder C:\temp. I suggest you saving your CUSIP file in the same folder as the cusiper program to reduce errors. BE SURE to include .txt in the command, such as H:\cusip\cusiper C:\temp\my6cusip.txt

 

my6cusip.txt

3.b Converted 6-digit CUSIPs using command:

H:\cusip\cusiper C:\temp\my6cusip.txt /digflag:6to6

3.a Converted 8-digit CUSIPs using command:

H:\cusip\cusiper C:\temp\my6cusip.txt

387472
90921V
172529
402734
577767
30405
423666
440327
64938P
78074G
344912
518074
74371R
49513
320103
75086K
892335
37857
461142
69514V
701645
37564
387472
90921V
172529
402734
577767
030405
423666
440327
64938P
78074G
344912
518074
74371R
049513
320103
75086K
892335
037857
461142
69514V
701645
037564
38747210
90921V10
17252910
40273410
57776710
03040510
42366610
44032710
64938P10
78074G10
34491210
51807410
74371R10
04951310
32010310
75086K10
89233510
03785710
46114210
69514V10
70164510
03756410

 

Step 2: Go to Start -> Run, then type in “cmd” in the box and click OK.

Step 3:

a. Command to convert 6-digit CUSIPs to 8-digit CUSIPs:

[path of cusiper program]cusiper [absolute path of your .txt file to convert from]

Type the command H:\cusip\cusiper C:\temp\my6cusip.txt after the > and press enter

b. Command to convert 6-digit CUSIPs to 6-digit CUSIPs

[path of cusiper program]cusiper  [absolute path of your .txt file to convert from]  /digflag:6to6

Note: /digflag:6to6 is exactly what it should be typed in the command line

Type the command H:\cusip\cusiper  C:\temp\my6cusip.txt /digflag:6to6 after the > and press enter

Example of results is displayed in table above for comparison.

 


Another example for convert 8-digit CUSIPs from, say Thomson Financial, to proper 8-digit CUSIPs by restoring leading zeros and replace last digit with zero.
my8cusip.txt

c. Converted 6-digit CUSIPs using command:

H:\cusip\cusiper C:\temp\my8cusip.txt /digflag:8to6

d. Converted 8-digit CUSIPs using command:

H:\cusip\cusiper C:\temp\my8cusip.txt /digflag:8to8

88610
91210
91410
93710
97310
97510
105510
108410
120410
125010
154710
167410
169310
176510
185310
195710
M8791510
N0704510
N0705911
N1980810
N2093510
N2271710
N5091910
N5424G10
N6748L10
N7248210
P8797T13
V7780T10
Y0251610

000886
000912
000914
000937
000973
000975
001055
001084
001204
001250
001547
001674
001693
001765
001853
001957
M87915
N07045
N07059
N19808
N20935
N22717
N50919
N5424G
N6748L
N72482
P8797T
V7780T
Y02516
00088610
00091210
00091410
00093710
00097310
00097510
00105510
00108410
00120410
00125010
00154710
00167410
00169310
00176510
00185310
00195710
00195720
M8791510
N0704510
N0705910
N1980810
N2093510
N2271710
N5091910
N5424G10
N6748L10
N7248210
P8797T10
V7780T10
Y0251610

c. Command to convert 8-digit CUSIPs to 6-digit CUSIPs with leading zeros and last digit truncated

[path of cusiper program]cusiper [absolute path of your .txt file to convert from] /digflag:8to6

Note: /digflag:8to6 is exactly what it should be typed in the command line

Type the command H:\cusip\cusiper C:\temp\my8cusip.txt /digflag:8to6 after the > and press enter

 

d. Command to convert 8-digit CUSIPs to 8-digit CUSIPs with leading zeros and replaced zeros for last digit

[path of cusiper program]cusiper [absolute path of your .txt file to convert from] /digflag:8to8

Note: /digflag:8to8 is exactly what it should be typed in the command line

Type the command H:\cusip\cusiper C:\temp\my8cusip.txt /digflag:8to8 after the > and press enter

Example of results is displayed in table above for comparison.

 

You will see a popup box with message “New CUSIPs file: NEWCUSIPS.txt was created successfully! NEWCUSIPS.txt will be in the same folder in which you ran the program, which is the folder before > when you entered the command line. If you couldn't find it, do a search for NEWCUSIPS.” when conversion is finished.

NEWCUSIPS.txt is the output file that has 8-digit or 6-digit CUSIPs. NEWCUSIPS.txt will be in the same folder as you ran the cusiper program, which is the path or folder before > when you enter the command line. For example, in step 3.a of the first example below, the path before > is C:\Documents and Settings\jianbai, then NEWCUSIPS.txt will be in that folder, not where you saved the cusiper program. But for step 3.b, the path before > is H:, then NEWCUSIPS.txt will be in the root of H: drive, not where you saved the cusiper program. I encourage you run the program from the same folder where you saved it to avoid confusion. Please read the message on the pop up message box to find out where NEWCUSIPS.txt is.

If you couldn't find it,just do a search for file named "NEWCUSIPS".

 

Good luck!