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 20 days ago

    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 19 days ago

    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 19 days ago

    Appreciate prompt response from Markmagic (Jmagic) experts here.

    Thanks much..




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

    Posted 17 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 17 days ago

    Hi,

    Could someone please advise here in the same regard soon.

    Thanks