FORM QUEUE NAME and FORM QUEUE NUMBER

254 views
Skip to first unread message

Patrick McCann

unread,
Jul 4, 2018, 10:47:37 PM7/4/18
to jBASE
Hi,

I am hoping somebody can help make sense of this for me.

I am trying to understand the difference/relationship/etc... between the two. I have read the documentation and still can't figure it out.

Looking at the following from the documentation, it talks about the queue number, and only valid if NO (=) sign is present.

Fn assigns specific form queue number n. Only valid if an equals sign (=), is not present in the command line.

Does every form queue name have an associated form queue number? If so, how it is defined? Can it be changed? What is the purpose?

Any help on this would be greatly appreciated.

Thank you,
Patrick

Daniel Klein

unread,
Jul 5, 2018, 5:25:49 AM7/5/18
to jb...@googlegroups.com
The form queue number n is the order in which the form queues were created. So, starting from an empty slate (i.e. no spooler):

SP-NEWTAB -> creates Form Queue 'STANDARD' which is form queue 0 (zero)
SP-CREATE MERCURY . . . -> creates form queue 1
SP-CREATE VENUS . . .   -> creates form queue 2
SP-CREATE EARTH . . .   -> creates form queue 3

Each subsequent SP-CREATE (or option 1 on the SP-STATUS menu) creates the next logical form queue number.

These 3 statements are therefore equivalent:

SP-ASSIGN =VENUS
SP-ASSIGN F2
SP-ASSIGN Q2

SP-STATUS displays the form queues in Q-number sequence, starting with 'zero'.

If you delete a form queue, the other queue numbers remain the same, the 'hole' is not filled in any way.

The only way to change the order is to create the form queues in a different order.

If you already have an existing spooler and you are on the latest jBASE release (5.7.0), you can use the 'sp-fqscript' command to create a script from the current spooler that can be used to regenerate the form queue definitions after running SP-NEWTAB. You then can edit this script and rearrange the order in which the queues are created. If you are not on the latest release then I suggest you create the script manually. If you ever have to refresh the spooler, this script will be a life-saver.

Hope this helps,

Daniel Klein

"Code as if whoever maintains your code is a violent psychopath who knows where you live." -- François Poulin
https://elegantcode.com/2007/11/12/great-quote-on-software-development/

--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
 
To post, send email to jB...@googlegroups.com
To unsubscribe, send email to jBASE-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

---
You received this message because you are subscribed to the Google Groups "jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbase+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Patrick McCann

unread,
Jul 5, 2018, 12:46:44 PM7/5/18
to jBASE
Hi  Daniel,

Thank you for the excellent and detailed information. It really gives me a good understanding between the two.

Now having a better understanding of the two I have some follow-up questions I am hoping you might be able to provide some help on.

I would like to understand the following -
Rn assigns specific report number n. Only valid if an equals sign (=), is not present in the command line.
 
Is this command in anyway related to the form queue number? I don't believe so, but am not sure. I think it is used with "PRINT ON {n}", but would like to know for sure.

And last, in the following command -
SETPTR {channel},,,,,,BANNER 'Some user text'
Is {channel} in anyway associated with the form queue number or is it just used to set-up the page characteristics for the "PRINT ON..."?

Thanks again for your help.

Patrick

Mark Hogden

unread,
Jul 5, 2018, 1:32:51 PM7/5/18
to jb...@googlegroups.com
=fqname is the same as 0=fqname which equates to the default PRINT in JBC
1=fqname is used for PRINT ON 1 
You can go up to 99=fqname if memory serves.
--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
 
To post, send email to jB...@googlegroups.com
To unsubscribe, send email to jBASE-un...@googlegroups.com

For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

---
You received this message because you are subscribed to the Google Groups "jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbase+un...@googlegroups.com.

Daniel Klein

unread,
Jul 5, 2018, 6:22:57 PM7/5/18
to jb...@googlegroups.com
You are correct, the 'n' in this case is the channel number and is used with PRINT ON.

These statement groups are equivalent (using the queue names from my original post):

SP-ASSIGN 42=VENUS
SP-ASSIGN 52=EARTH

SP-ASSIGN F2 R42
SP-ASSIGN F3 R52

SP-ASSIGN Q2 R42
SP-ASSIGN Q3 R52

SETPTR 42,,,,,,VENUS
SETPTR 52,,,,,,EARTH
[I'm not as fluent with SETPTR but I do know that the first parameter is the channel. Not sure if I got the right number of commas in there. However, I find the SP-ASSIGN syntax more intuitive and can do most, if not all, of the things SETPTR can.]

Once the channels are assigned to the queues, you can do things like this in a BASIC program

PRINTER ON 42
PRINTER ON 52
PRINT ON 52 "Launch the rocket to VENUS"  ;* Prints to the EARTH form queue
PRINT ON 42 "Houston, we have a problem!" ;* prints to the VENUS form queue

Daniel
Don’t believe everything you read on the Internet...unless I wrote it. ;-)


To unsubscribe, send email to jBASE-unsubscribe@googlegroups.com

For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

---
You received this message because you are subscribed to the Google Groups "jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbase+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
 
To post, send email to jB...@googlegroups.com
To unsubscribe, send email to jBASE-unsubscribe@googlegroups.com

For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

---
You received this message because you are subscribed to the Google Groups "jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbase+unsubscribe@googlegroups.com.

Patrick McCann

unread,
Jul 7, 2018, 9:37:58 AM7/7/18
to jBASE
Again, Thank you Daniel. Very good detailed information. I will put this away for later reference.

You have helped me get past several hurdles and helped me with my understanding of the the Spooler.

I have one last hurdle related to printing that I am still trying to figure out a solution for.

I will go ahead and describe it here for you and any others to offer any suggestions or possible solutions.

Problem -
I only have one printer. An HP Laserjet 500 MFP M525.
I need to print several different report formats to this printer e.g. 80 column, 132 column, and varying font sizes.

In my previous environment (UniVerse on a Windows 2k Server) I was able to modify the SP.ASSIGN program to use a file I created.
The SP.ASSIGN was a program that executed the SETPTR command behind the scenes. SETPTR in that environment had more options than are available in jBASE 5.7. 

I was able to utilize these other options to accomplish my requirements. By reading the file I created that held the options I wanted, everything was correctly set during assignment of the printer (SP-ASSIGN).
Here are a couple examples of records from the file I created - It held the printer, page width and length, top and bottom margins, print mode, font type, size, and the other available options I needed.
I would parse out the forms assignment from the SP-ASSIGN, read the file, get the options, and execute the SETPTR command with the required options.
0
TOP
.P
TOP
001 HP5SI
002 ,132,59,0,0,
003 GDI,FONTNAME Courier,FONTSIZE 7
004
005
006 132 COLUMN

3
TOP
.P
TOP
001 HP5SI
002
003
004
005 3
006 &HOLD& OUTPUT
BOTTOM

jBASE support mentioned I would need to use jspforms which I will start researching, but thought I would ask the question now for any comments/suggestions.

Thank you,
Patrick
To unsubscribe, send email to jBASE-un...@googlegroups.com

For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

---
You received this message because you are subscribed to the Google Groups "jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbase+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
 
To post, send email to jB...@googlegroups.com
To unsubscribe, send email to jBASE-un...@googlegroups.com

For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

---
You received this message because you are subscribed to the Google Groups "jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbase+un...@googlegroups.com.

Daniel Klein

unread,
Jul 10, 2018, 7:25:44 AM7/10/18
to jb...@googlegroups.com
Yes, the way this is done is to use a custom form type. Take a look at '$JBCRELEASEDIR/config/jspform_deflt'.

Use

STARTJOB set_pcl
and
ENDJOB reset_pcl

to set the PCL sequences before and after print job are despooled.

The 'set_pcl' and 'reset_pcl' would be your programs that send the PCL sequences to the printer.

Don't forget to assign the custom form type to the form queue. For example, if the form queue is HPLASERJET and the form type is 'jspform_custom' then

SP-TYPE HPLASERJET custom

will assign 'custom' to the HPLASERJET queue.

Daniel Klein

To unsubscribe, send email to jBASE-unsubscribe@googlegroups.com

For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

---
You received this message because you are subscribed to the Google Groups "jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbase+unsubscribe@googlegroups.com.

Patrick McCann

unread,
Jul 11, 2018, 2:53:02 AM7/11/18
to jBASE
Hi Daniel,

I copied jspform_deflt to jspform_custom following your example.

I then created a small program called HP_PCL_C12L coded like this -

      $INCLUDE FILE.LIB.CUS HP.COMMANDS
      $INCLUDE FILE.LIB.CUS HP.PCL
      *
      PRINTER ON
      PRINT HP.LANDSCAPE:HP.COMPRESS
      PRINT "THIS IS A TEST LINE 1"
      PRINT "THIS IS A TEST LINE 2"
      *
      STOP
      END

And another called HP_RESET coded like this -

      $INCLUDE FILE.LIB.CUS HP.COMMANDS
      $INCLUDE FILE.LIB.CUS HP.PCL
      *
      PRINT HP.RESET
      *
      STOP
      END

I then added the following to the jspform_custom file

STARTJOB HP_PCL_C12L

and

ENDJOB HP_RESET

Here is my testing and results -
SP-ASSIGN =F4
SP-TYPE F4 custom
LIST PTRS LPTR

On the first page, I do see the two "TEST" lines printed in the HP_PCL_C12L routine and they print correctly e.g. landscape and compressed print.
That is the only thing on the first page. Almost as if it is its own unique print job.
Then an empty page
Then the PTRS file listing in portrait and larger print. e.g. normal print.
Then an empty page.

Based on this it does call the HP_PCL_C12L routine from jsform_custom. It just doesn't work as I expected it to.
I guess I am not understanding something about this flow? Is using a program to "PRINT" the PCL codes correct?

The other test I tried was printing a job from the Spooler.
SP-ASSIGN =F4
SP-TYPE F4 custom
SP-EDIT 3
Then spool the job.
The results were that ONLY the spooled job printed. It printed portrait and larger font e.g. normal print
The two "TEST" lines are NOT printed. It appears the HP_PCL_C12L routine is NOT called from jspform_custom.
Then a blank page

Is my understanding of "The 'set_pcl' and 'reset_pcl' would be your programs that send the PCL sequences to the printer." correct? I.e. use of a basic program to send the codes?

Thank you for your help.
Patrick

Mark Hogden

unread,
Jul 11, 2018, 3:45:49 AM7/11/18
to jb...@googlegroups.com
We have found that many HP printer will page eject when the basic program is called to change font etc, and almost always if the reset command is included.
In our experience it's generally more reliable to write out the PCL commands to files and attach them to the queues using the -h option. 

Daniel Klein

unread,
Jul 11, 2018, 3:51:53 AM7/11/18
to jb...@googlegroups.com
You're on the right track but you need to assign the form type to the queue before you create any print jobs, and you only need to assign the form type once per queue.

So the steps are:

Setup (this only needs to be done once per queue):
1) create the form queue
2) create the form type
3) SP-TYPE formqueue formtype

After this setup has been done:

1) SP-ASSIGN formquue
2) Spool the job(s)

To unsubscribe, send email to jBASE-unsubscribe@googlegroups.com

For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

---
You received this message because you are subscribed to the Google Groups "jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbase+unsubscribe@googlegroups.com.

Patrick McCann

unread,
Jul 11, 2018, 9:37:00 AM7/11/18
to jBASE
Hi Mark,
Thank you for the information. This sounds like what might be happening.
Can you provide me a quick example of the process you are describing?
That would be very helpful in understanding how to set-up and test it.
Thank you,
Patrick

Patrick McCann

unread,
Jul 11, 2018, 9:37:00 AM7/11/18
to jBASE
Thanks Daniel,
This is more good information. I like the fact that SP-TYPE only needs to be done once. I was thinking every time.
I will continue with my trial and error testing...
Patrick

Daniel Klein

unread,
Jul 11, 2018, 11:52:50 AM7/11/18
to jb...@googlegroups.com
What Mark was alluding to was to use the -h<file> option with the 'lp' command when you define the form queue with SP-CREATE, e.g.

SP-CREATE MYQUEUE lp -h<file> -d<device>

where <file> contains the PCL sequence and <device> is the printer name.

You would need to specify the full path to the <file>.

All of this assumes you are on Windows.

To see all  of the 'lp' options:

lp -?


To unsubscribe, send email to jBASE-unsubscribe@googlegroups.com

For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

---
You received this message because you are subscribed to the Google Groups "jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbase+unsubscribe@googlegroups.com.

ma...@proman.com

unread,
Jul 11, 2018, 12:27:09 PM7/11/18
to jb...@googlegroups.com

This is a quick and dirty I have used in the past, which can be used in conjunction with STARTJOB or to write the commands to a text file.   

 

Syntax is

PROGNAME option {TEXTFILEPATH}

e.g. HPCTRL DUMMY C:\temp\HP17CPI.TXT

 

Then as Dan pointed out add the -h C:\temp\HP17CPI.TXT as part of the SP-CREATE or SP-DEVICE statement.

 

  ESC = CHAR(27)

  CPI17 = ESC:'&k2S'

  IF SENTENCE(1) = "MARGIN" THEN

    CPI17:= ESC:'&a7L'

  END

  IF SENTENCE(2) THEN

    OPENSEQ SENTENCE(1) TO TEXTPATH ELSE NULL

    WRITESEQ CPI17 ON TEXTPATH ELSE STOP 'WRITESEQ'

    CLOSESEQ TEXTPATH

  END ELSE

    PRINT CPI17:

  END

Daniel Klein

unread,
Jul 11, 2018, 12:31:42 PM7/11/18
to jb...@googlegroups.com
One correction on my last post, should have been...

SP-CREATE MYQUEUE prog lp - h<file> -d<device>

To unsubscribe, send email to jBASE-unsubscribe@googlegroups.com


For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

---
You received this message because you are subscribed to the Google Groups "jBASE" group.

To unsubscribe from this group and stop receiving emails from it, send an email to jbase+unsubscribe@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
 
To post, send email to jB...@googlegroups.com

To unsubscribe, send email to jBASE-unsubscribe@googlegroups.com


For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

---
You received this message because you are subscribed to the Google Groups "jBASE" group.

To unsubscribe from this group and stop receiving emails from it, send an email to jbase+unsubscribe@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
--
IMPORTANT: T24/Globus posts are no longer accepted on this forum.
 
To post, send email to jB...@googlegroups.com
To unsubscribe, send email to jBASE-unsubscribe@googlegroups.com

For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

---
You received this message because you are subscribed to the Google Groups "jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbase+unsubscribe@googlegroups.com.

Patrick McCann

unread,
Jul 12, 2018, 8:45:10 AM7/12/18
to jBASE
Thank you for the example. I did a cut and paste and ran it.

It was good to see the file it created and helped me understand the file contents.

I assume using the -h<file> option basically replaces using the STARTJOB in my jspform_custom file?  If so, I take it that the ENDJOB will have to stay? Although it seems like the printer is automatically resetting itself. I need to confirm that though..

Thank you,
Patrick

Patrick McCann

unread,
Jul 12, 2018, 8:45:10 AM7/12/18
to jBASE
Thanks to both of you.

I am now having success printing and am now playing around with different PCL sequences and setting up my queues.
I do seem to get an extra page eject that I don't need (or want). This evening I am going to try Mark's suggestion of using a file. 

I will post an update when I have one.

Also, thanks for the example using the -h option.
.
Patrick

Daniel Klein

unread,
Jul 12, 2018, 8:50:35 AM7/12/18
to jb...@googlegroups.com
Add -f to the lp command. That should eliminate the additional formfeed. If you are still getting one then check to make sure the page skip is set to zero for the queue.

To unsubscribe, send email to jBASE-unsubscribe@googlegroups.com

For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

---
You received this message because you are subscribed to the Google Groups "jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbase+unsubscribe@googlegroups.com.

Dick Thiot

unread,
Jul 12, 2018, 8:55:10 AM7/12/18
to jb...@googlegroups.com
Thank you for the replies regarding form queues.  Not only have they been helpful to me and I assume others but it is nice to see one of the vendors adding to the forum without wondering if the customer has a support agreement. You know that I have worked with jBASE for a long time but having this discussion in public rather than on a closed support system or via email or phone can benefit others besides the user with the specific problem.

osag...@gmail.com

unread,
Jul 12, 2018, 9:39:59 AM7/12/18
to jb...@googlegroups.com

Thank you Daniel,

I will give that a try first.

Patrick

Patrick McCann

unread,
Jul 13, 2018, 7:54:24 AM7/13/18
to jBASE
Hi Daniel and Mark,

Here are the results.

First I tried the -f option with the lp command, but still got the additional form feeds. Note - I did set the page skip to zero for the form queue F4

Next I tried the -h option with SP-CREATE
I  commented out STARTJOB and ENDJOB in my jspform_custom script.
I created the file to use with the -h option using Mark's example.
I deleted the form queue. I had to use SP-KILL then SP-STATUS option 7 to delete it.
I re-created it using the following line -
SP-CREATE F4 prog lp -h C:\temp\HP17CPI.TXT -d lp -d "HP5SI_PCL"
Then I set SP-ASSIGN =F4 and generated a report.
It only printed the report with no page-eject before or after the print the job.

I am sure you both understand the steps involved, but maybe in the future it might help someone else..

Thanks to both of you. I have the printing working and a much better understanding of the spooler, spooler commands, and set-up.

I'm sure I will be back with more questions in the near future. I saw spool2pdf in the documentation which caught my attention.

I REALLY appreciate your help.

Thank you,
Patrick

Daniel Klein

unread,
Jul 13, 2018, 3:31:25 PM7/13/18
to jb...@googlegroups.com
You don't need (or want) that ' -d lp', eg

SP-CREATE F4 prog lp -h C:\temp\HP17CPI.TXT -d "HP5SI_PCL"

And you don't really need to put the printer name in quotes unless there are spaces.

To unsubscribe, send email to jBASE-unsubscribe@googlegroups.com

For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

---
You received this message because you are subscribed to the Google Groups "jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbase+unsubscribe@googlegroups.com.

osag...@gmail.com

unread,
Jul 13, 2018, 5:44:08 PM7/13/18
to jb...@googlegroups.com

Thank for the info Daniel.

Its good to know the right way to do these things.

Patrick

Reply all
Reply to author
Forward
0 new messages