IBM i Global

IBM i Global

Connect, learn, share, and engage with IBM Power.

 View Only
  • 1.  Regarding Markmagic version 9 to print spool file

    Posted Fri May 30, 2025 03:09 AM

    Hi,

    Can we use markmagic in IBM i to skip specific page from spool file using  Mark magic version 9 to print this spool file from a mark magic printer?

    Also can it( markmagic tool) be used to print a new page along with the existing pages in spool file as per  given sample page ?

    If answer to above questions is yes, then could someone please advise how to do the same with the appropriate screenshots and videos please?

    I already referred couple of you tube videos from CYBRA regarding the same, but it seems i don't have all the icons enabled in my current  markmagic version.(below is the disabled icons shown in pasted screen shot).

    Is this version issue or something skipping or adding new page for printing using spool file cannot be achieved here?

    Thanks 



  • 2.  RE: Regarding Markmagic version 9 to print spool file

    Posted Fri May 30, 2025 11:31 AM

    To skip 2nd page for printing wrote below CL but it's not compiling:

    PGM
    DCL VAR(&PAGE) TYPE(*DEC) LEN(3 0) VALUE(1)
    DCL VAR(&MAXPAGES) TYPE(*DEC) LEN(3 0) VALUE(10) /* Set this appropriately */
    DCL VAR(&SPLFNAME) TYPE(*CHAR) LEN(10) VALUE('MYSPLF')
    DCL VAR(&JOB) TYPE(*CHAR) LEN(28) VALUE('123456/USER/JOBNAME')
    DCL VAR(&NEWFILE) TYPE(*CHAR) LEN(10) VALUE('NEWSPLF')
    DCLF MYLIB/TMPSPLF
     
     
    /* Clear the temporary file before starting */
    CLRPFM FILE(MYLIB/TMPSPLF)
     
    LOOP:
      IF COND(&PAGE *GT &MAXPAGES) THEN(GOTO END)
     
      IF COND(&PAGE *NE 2) THEN(DO)
        /* Copy all pages except page 2 */
        CPYSPLF FILE(&SPLFNAME) TOFILE(MYLIB/TMPSPLF) JOB(&JOB) +
                SPLNBR(*LAST) PAGE(&PAGE) MBROPT(*ADD)
      ENDDO
     
      CHGVAR VAR(&PAGE) VALUE(&PAGE + 1)
      GOTO LOOP
     
    END:
      /* Create final output spool file */
      CPYF FROMFILE(MYLIB/TMPSPLF) TOFILE(QTEMP/NEWSPLF) MBROPT(*REPLACE)
      CPYSPLF FILE(QTEMP/NEWSPLF) TOFILE(QSYSPRT) SPLFNAME(&NEWFILE)
     
    ENDPGM
    PGM
    DCL VAR(&PAGE) TYPE(*DEC) LEN(3 0) VALUE(1)
    DCL VAR(&MAXPAGES) TYPE(*DEC) LEN(3 0) VALUE(10) /* Set this appropriately */
    DCL VAR(&SPLFNAME) TYPE(*CHAR) LEN(10) VALUE('MYSPLF')
    DCL VAR(&JOB) TYPE(*CHAR) LEN(28) VALUE('123456/USER/JOBNAME')
    DCL VAR(&NEWFILE) TYPE(*CHAR) LEN(10) VALUE('NEWSPLF')
    DCLF MYLIB/TMPSPLF
    
    
    /* Clear the temporary file before starting */
    CLRPFM FILE(MYLIB/TMPSPLF)
    
    LOOP:
      IF COND(&PAGE *GT &MAXPAGES) THEN(GOTO END)
    
      IF COND(&PAGE *NE 2) THEN(DO)
        /* Copy all pages except page 2 */
        CPYSPLF FILE(&SPLFNAME) TOFILE(MYLIB/TMPSPLF) JOB(&JOB) +
                SPLNBR(*LAST) PAGE(&PAGE) MBROPT(*ADD)
      ENDDO
    
      CHGVAR VAR(&PAGE) VALUE(&PAGE + 1)
      GOTO LOOP
    
    END:
      /* Create final output spool file */
      CPYF FROMFILE(MYLIB/TMPSPLF) TOFILE(QTEMP/NEWSPLF) MBROPT(*REPLACE)
      CPYSPLF FILE(QTEMP/NEWSPLF) TOFILE(QSYSPRT) SPLFNAME(&NEWFILE)
    
    ENDPGM
    
    
    


    ------------------------------
    jerry ven
    ------------------------------



  • 3.  RE: Regarding Markmagic version 9 to print spool file

    Posted Sat May 31, 2025 03:05 AM

    Appreciate prompt response from Markmagic (Jmagic) experts here.

    Thanks much..




  • 4.  RE: Regarding Markmagic version 9 to print spool file

    Posted 29 days ago

    Or how about this CL program to achieve yhe same here , if it can't be done through MarkMagic?

    PGM
    DCL VAR(&PAGE) TYPE(*DEC) LEN(3 0) VALUE(1)
    DCL VAR(&MAXPAGES) TYPE(*DEC) LEN(4 0)
    DCL VAR(&SPLFNAME) TYPE(*CHAR) LEN(10) VALUE('YOURSPLF')
    DCL VAR(&JOB) TYPE(*CHAR) LEN(28) VALUE('123456/USER/JOBNAME')
    DCL VAR(&TMPFILE) TYPE(*CHAR) LEN(10) VALUE('TMPSPLF')
    DCL VAR(&OUTF) TYPE(*CHAR) LEN(10) VALUE('QTEMP/OUTPF')
     
    /* Step 1: Get total pages of spool file */
    DLTOVR FILE(QPRINT)
    DLTF FILE(QTEMP/OUTPF)
    OVRPRTF FILE(QPRINT) TOFILE(QTEMP/OUTPF)
    DSPSPLF FILE(&SPLFNAME) JOB(&JOB) SPLNBR(*LAST) OUTPUT(*PRINT)
    MONMSG MSGID(CPF0000)
     
    RCVF: /* Get total pages from spool file listing */
    RCVMSG MSGTYPE(*LAST) RMV(*NO)
    DMPMSG MSGID(*LAST) /* Just in case you want to debug */
     
    RUNQRY QRY(*NONE) QRYFILE((QTEMP/OUTPF))
    RTVMBRD FILE(QTEMP/OUTPF) NBRCURRCD(&MAXPAGES)
    /* Optional: use CPYF + OPNQRYF if you want to parse real page number from content */
     
    DLTOVR FILE(QPRINT)
     
    /* Step 2: Clear the output PF before starting */
    CLRPFM FILE(MYLIB/&TMPFILE)
     
    /* Step 3: Loop and copy pages except page 2 */
    LOOP:
      IF COND(&PAGE *GT &MAXPAGES) THEN(GOTO END)
     
      IF COND(&PAGE *NE 2) THEN(DO)
        CPYSPLF FILE(&SPLFNAME) TOFILE(MYLIB/&TMPFILE) JOB(&JOB) +
                SPLNBR(*LAST) PAGE(&PAGE) MBROPT(*ADD)
      ENDDO
     
      CHGVAR VAR(&PAGE) VALUE(&PAGE + 1)
      GOTO LOOP
     
    END:
    ENDPGM

    Thanks..




  • 5.  RE: Regarding Markmagic version 9 to print spool file

    Posted 29 days ago

    Hi,

    Could someone please advise here in the same regard soon.

    Thanks




  • 6.  RE: Regarding Markmagic version 9 to print spool file

    Posted 11 days ago
    Hi,

    Could someone please respond here ?

    Also could Someone please share correct PRTLBLF command which prints a label format correctly in a pdf format to IFS path so that without actually printing it from a markmagic printer we can view it (kind of print preview) ?


    Thanks much..






  • 7.  RE: Regarding Markmagic version 9 to print spool file

    Posted 11 days ago

    Hi,

    with respect to last post I have been trying to follow this CYBRA's video but the pdf which gets generated on IFS path is blank, I want to remove dependency on mark magic printer ( hardware) in such a way that if someone does not have this printer then that person should be able to see printed labels in a pdf format with lay out and with data along with headings and with layout both way and the exactly the same way they are printed using the mark magic printer (with all those bar codes etc.) so could someone please help regarding the same here:

    link of CYBRA'S for this PRTLBLF command: https://cybra.com/how-to-create-a-pdf-on-your-as400-iseries-with-markmagic/

    So, if someone who is expert in printing barcode labels etc. using this mark magic tool then appreciate prompt response from experts here.

    Thanks a lot !!




  • 8.  RE: Regarding Markmagic version 9 to print spool file

    Posted 10 days ago

    not sure if this is the right forum to ask this question here but it looks like noone has worked on this tool here? if yes, could someone please help by routing it to appropriate forums?

    thanks