Hi everyone, I have been working on a Z3950 server for Koha and I am finally at the point where the server works, and I need some help refining the records that I am generating (eventually I will build in support for multiple formats; but for now I would be pretty excited if I could get it to generate "good" MARC) Basically, the Z3950 server uses SimpleServer, which has a fetch handler subroutine to fetch one record(the present handler will call fetch_handler as often as necessary for the client's request). So...here is a snipit of code from my script where I attempt to generate a MARC record. When I run the resulting string from this code through Paul's dumpmarc.pl it complains about the leader. MARC::Record experts: any ideas, suggestions as to how to set the leader? Any other suggestions? (BTW: this is my first ever Perl script, so please don't laugh too hard:)) Thanks, Joshua sub fetch_handler { my ($args) = @_; my $offset = $args->{OFFSET}; $offset -= 1; ## because $args->{OFFSET} 1 = record #1 chomp (my $bibid = $bib_list[$offset]); ## Not sure about this my $dbh = C4::Context->dbh; my $sql_query = "SELECT tag, subfieldcode, subfieldvalue FROM marc_subfi eld_table where bibid=?"; my $sth_get = $dbh->prepare("$sql_query"); $sth_get->execute($bibid); ## Build the record: my $rec = MARC::Record->new(); while (my @data=$sth_get->fetchrow_array) { my $tag = $data[0]; my $subfieldcode = $data[1]; my $subfieldvalue = $data[2]; my $field = MARC::Field->new( $tag,'','', $subfieldcode => $subfieldvalu e, ); $rec->append_fields($field); ## build the marc string and put into $record my $record = $rec->as_usmarc(); $args->{RECORD} = $record; }