INF: Extracting Month and Year from ASCII File with BCPID: Q67658
|
The following information describes how to use BCP (bulk copy program) to extract just the month and the year from an ASCII file with a column that has a date of "mm/dd/yy" in it.
Using a format file, BCP can be instructed to skip information or
entire fields. For example, suppose a table is defined as the
following:
create table bcpin
( f1 char(4),
f2 char(2),
f3 char(2),
f4 char(5))
test01/03/90hello
test01/03/90hello
test01/03/90hello
test01/03/90hello
test01/03/90hello
skip and bcp and identifies and prod(sqlndk)
4.0
5
1 SYBCHAR 0 4 "" 1 f1
2 SYBCHAR 0 2 "" 2 f2
3 SYBCHAR 0 4 "" 0 Dummy
4 SYBCHAR 0 2 "" 3 f3
5 SYBCHAR 0 5 "\r\n" 4 f4
Keywords : kbtool SSrvBCP
Version : 4.2
Platform : OS/2
Issue type :
Last Reviewed: March 10, 1999