sub WriteEbcdicHeader
{
my $Htimestamp=localtime();#i need to pack and unpack this
my $eheaderline = $Htimestamp;
#packing has to be done here
#unpacking has to be done after packing
print $EOUTFILE
return $eheaderline;
}
sub WriteEbcdicTrailer
{
my $Ttimestamp = localtime();
my $etrailerline=$Ttimestamp.$ase_rowcnt ;#i need to pack and unpack
#packing has to be done here
#unpacking has to be done after packing
return $etrailerline;
}
Have you read the descriptions for the pack and unpack functions in Perl?
What character set are you converting from?
What EDCBIC codepage are you converting to?
Also, are you aware that the conversion from ASCII to EBCDIC and vice versa isn't actually a pack/unpack operation, but a translation between character encodings that isn't based on simple functions but will most likely require a translation table?
Hi thank u for reponding. Actually i am very new to perl scripting.The requirement is to write the header in the file with the timestamp.I am assuming that we are packing the same by converting into EBCDIC format and print the same in file header.
Similarly the requirement is to write the trailer into the file with time stamp and the rowcount.