Problem:
Demo - print flow of data from Unix on Default Printer of a Windows PC thru File Share
=======
This KB is the next step of the KB 25059 http://supportline.microfocus.com/mf_kb_display.asp?kbnumber=25059
Which implements the STEP 5) of this KB
===
5) Regards to the File Handler called by FS server thru the use of the /ap parameter
Another scenario, could be,
On the File Handler order 'OPEN OUTPUT'
I use a MF PC_PRINTER_OPEN
On the File Handler order 'WRITE'
I use a MF PC_PRINTER_WRITE
On the File Handler order 'CLOSE'
I use a MF PC_PRINTER_CLOSE
===
=======
On File Share Server side (WINDOWS)
The File Handler invoked by File Share thru the use of the /ap parameter is named here mymffhPCPR
Depending on the existence of a CONSTANT named SaveOfTheFilePrinted
If Exists:
Il will SAVE on FS Server side (Windows) the 'Data stream' received thru File Share
And will print the 'Data stream' using the MF primitive PC_PRINT_FILE
If Not Exists,it won't SAVE on FS Server side (Windows) the 'Data stream' received thru File Share
And will print the 'Data stream' using the MF primitives
PC_PRINTER_OPEN and PC_PRINTER_WRITE and PC_PRINTER_CLOSE
The term 'Data Stream' is a flow of bytes.
On File Share Client side (WINDOWS or UNIX),
the aim of the program c$localprint which I-Os with FS server described above
is to simulate the ACU primitive c$localprint
> ACU DOC
> C$LOCALPRINT
> The C$LOCALPRINT routine provides access to the ACUCOBOL-GT window manager's local print > mechanism.
>This allows the program to write to a printer or other device attached directly to the user's >terminal. One or two USING parameters should be pro
> Usage
CALL "C$LOCALPRINT"
USING SOURCE-DATA, LINE-SPACE
Parameters
SOURCE-DATA PIC X(n)
...
The test program calllocalprint, used on client side
Sends some datas to the File Share Server to be printed
working-storage section.
01 STR20 pic x(20) value ALL "A".
01 STR30 pic x(30) value ALL "B".
01 STR40 pic x(40) value ALL "C".
01 STR50 pic x(50) value ALL "01234567890123456789".
procedure division.
CALL "c$localprint" using STR20 0
CALL "c$localprint" using STR30 1
CALL "c$localprint" using STR40 2
CALL "c$localprint" using STR50 3
The test program bytestreamtofsprt, used on client side
Reads a whole Line sequential file thru MF Byte stream routines
And invokes c$localprint to Send this 'Data Stream' ( The Whole file ) to the File Share Server to be printed
=======
Resolution:
=======
1) Environment
On Windows
Net Express (Test was done with NE 5.0 Websync4)
On Unix
Server Express 5.0 (Test was done with SE 5.0 Websync4)
Acronym used: FS = File Share
2) Launching of the demonstration
Unzip the demonstration on a Working directory
21) Launch File Share Server on windows
Launch FSDBPCPR.bat from a Net Express command prompt
22) Launch FS client on Windows
Open the Net Express project
Control,at the first line of c$localprint.cbl = $SET constant UNIXorWindows 'xU' ,
(A value NOT = to U means Windows OS)
That the constant above is not equal to U
Rebuild the project
set CCITCP2 environment variable so it's equal to the PC name where FS server activated or to the IP address where FS server activated
From a Net Express command prompt,
or
Run debug\\ calllocalprint
or
run debug\\ bytestreamtofsprt
Or just run these programs within Net Express project
23) Launch FS client on Unix
Open the Net Express project
Control,at the first line of c$localprint.cbl = $SET constant UNIXorWindows 'xU' ,
(A value NOT = U means Unix OS)
That the constant above is equal to U
ftp calllocalprint.cbl bytestreamtofsprt c$localprint.cbl to Unix
compile them ( cob -ia *.cbl)
set CCITCP2 environment variable so it's equal to the PC name where FS server activated or to the IP address where FS server activated
launch: cobrun calllocalprint or cobrun bytestreamtofsprt