IBM i Access Client Solutions

IBM i Access Client Solutions

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

 View Only
  • 1.  Assistance Needed: Creating a Workstation Customizing Object for CPYSPLF to Stream File Without Print Control Characters

    Posted Wed July 17, 2024 09:31 AM

    Hello IBM i Community,

    I hope this message finds you well. I am currently working on an IBM i 7.3 system and facing an issue with the CPYSPLF command when copying spooled files to stream files. Specifically, when using the QWPDEFAULT workstation customizing object (WSCST), I encounter unwanted print control characters such as a NUL character at the beginning of Line 1 and an FF (form feed) control character every 51 lines.

    To provide some context, here is what I am trying to achieve:

    • Objective: Copy spooled files to stream files without including any print control characters.
    • Current Approach: Using CPYSPLF with QWPDEFAULT.

    Here is a snippet of the command I am currently using:

    CPYSPLF FILE(MYDOC) JOB(123456/USER1/PROCESS1) SPLNBR(*LAST) TOFILE(*TOSTMF) TOSTMF('/textfiles/mydoc.txt') WSCST(QSYS/QWPDEFAULT)

    Issue

    The resulting document includes:

    • A NUL character at the beginning of Line 1.
    • An FF control character every 51 lines.

    Request

    Could anyone provide guidance or best practices on how to create or modify a workstation customizing object so that these unwanted print control characters are not included in the stream file?

    Any scripts, detailed steps, or examples would be greatly appreciated.

    Thank you in advance for your assistance!

    Best regards,

    Randy



    ------------------------------
    Randy Stevenson
    MWI Animal Health
    ------------------------------


  • 2.  RE: Assistance Needed: Creating a Workstation Customizing Object for CPYSPLF to Stream File Without Print Control Characters
    Best Answer

    Posted Thu July 18, 2024 01:47 AM

    Hi,

    Did you try to use CPYTOSTMF with a 2-step process? It comes with some options, including end-line limiters and table-based conversion.

    First, copy your file to QTEMP using CPYSPLF, then use CPYTOSTMF.    

    Exemple code:

    CPYSPLF FILE(MYFILE) TOFILE(QTEMP/MYFILE) SPLNBR(*LAST)
    CPYTOSTMF FROMMBR('/QSYS.LIB/QTEMP.LIB/MYFILE.FILE/MYFILE.MBR') TOSTMF('/textfiles/mydoc.txt') STMFOPT(*REPLACE)



    ------------------------------
    Sylvain Manceau
    ------------------------------



  • 3.  RE: Assistance Needed: Creating a Workstation Customizing Object for CPYSPLF to Stream File Without Print Control Characters

    Posted Thu July 18, 2024 10:23 AM

    Hello,

    Yes, I started this process down that path originally, but then discovered when I pressed F4, that there was a more direct method to *TOSTMF and so I tried that, but I'll back track and try the 2 step process and see how that goes. 

    Thank you,



    ------------------------------
    Randy Stevenson
    ------------------------------



  • 4.  RE: Assistance Needed: Creating a Workstation Customizing Object for CPYSPLF to Stream File Without Print Control Characters

    Posted Fri July 19, 2024 11:02 AM
    Edited by Randy Stevenson Fri July 19, 2024 11:02 AM

    Hello,

    Regarding the 2nd part of that with the CPYTOSTMF, does that give any 'conversion/transform' options or would I be better off using CPYTOIMPF.

    Also, just as an observation, it would be really nice if there was a resource somewhere that explained the appropriate times to use each of these copy options, and scenarios :)  It would be helpful.



    ------------------------------
    Randy Stevenson
    ------------------------------



  • 5.  RE: Assistance Needed: Creating a Workstation Customizing Object for CPYSPLF to Stream File Without Print Control Characters

    Posted Tue July 23, 2024 06:30 PM

    I was finally able to get a library file that I had previously copied the output queue to, to present correctly without formatting code. This is an example of that command:

    CPYTOIMPF FROMFILE(LIB/FILE) TOSTMF('/mnt/output.xml') MBROPT(*REPLACE) STMFCCSID(1208) STMFCODPAG(*STMF) RCDDLM(*CRLF) STRDLM(*NONE)

    Now, after days of figuring this out, I'm retracing my footsteps to see how I managed to copy the output queue entry into the library file without an attribute error hehe, but this is so much progress.

    Thank you.



    ------------------------------
    Randy Stevenson
    ------------------------------