Latest News

the latest news from our team

Importing Reports to Excel

Some users want to import reports to Excel. The problem is that the first position of the spool file is a carriage control character. This does not import well into Excel. This script will prompt you for a spool file name, and the path and location where it isto be placed on the PC.  Read the file into the HP editor, strip the carriage control character from the file, save it, and download the edited file to the PC. Prompt for the spool file on the HP. Only the name of the spool file is needed; the group and account will be appended.

LET HEADER = “Spool File”
LET PROMPT = “Please Enter the Spool file name ‘onnnn’ :”
ACCEPT SPOOL
Prompt for the path and file name where the file is to be placed on the PC.
LET HEADER = “PC Path and File Name”
LET PROMPT = “Please enter the PC file name including the full Path”
ACCEPT PCFILE
Append the group and account to the spool file name.
LET SPOOLFIL = SPOOL & “.OUT.HPSPOOL^M”
LET EDFILE = “T ” & SPOOLFIL
Run HP’s editor and text in the spool file.
KBSTRING editor
KBSPEC HP_RETRNKEY
WAITS “/^Q”
TRANSMIT EDFILE
KBSPEC HP_RETRNKEY
WAITS “/^Q”
Remove the first position from the spool file–this is the carriage control character.
KBSTRING cq 1/1 to “” in all
KBSPEC HP_RETRNKEY
WAITS “/^Q”
Keep the file to a name that can be used for the download.
KBSTRING k WS92xxx,unn
KBSPEC HP_RETRNKEY
WAITS “^Q”
KBSTRING y
KBSPEC HP_RETRNKEY
WAITS “^Q”
KBSTRING E
KBSPEC HP_RETRNKEY
WAIT 00:00:02
Transfer the edited file to the PC.
HOSTF WS92XXX
LOCF  PCFILE
RECSIZE 256
ASCII
DOWNLOAD
END

Leave a Reply

Your email address will not be published. Required fields are marked *