ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Print source files in their original name

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Print source files in their original name

    Option 6 in the PDM options prints the source, with the spool file named QPSUPRTF. I would like to have this name same as the source member.
    Anyway of doing it? Any sort of override will do it?
    Thanks
    Sudarshan

  • #2
    Re: Print source files in their original name

    write one to print them and put the source member name in the user data field of the printf.
    What are you attempting to do with the source print? Copy ot text file?
    Bill
    "A good friend will bail you out of jail,
    A true friend would be sitting beside you saying,
    'Wow, that was fun.'"

    Comment


    • #3
      Re: Print source files in their original name

      Hi sudarshan_ramal:

      Under user options (f16 in pdm) add the following option:
      Code:
      CALL MYLIB/PRTSRC PARM(&L &F &N)
      And in mylib create prtsrc as follows:
      Code:
             pgm parm(&l &f &n)                                
                  dcl &l *char 10                              
                  dcl &f *char 10                              
                  dcl &n *char 10                              
                  OVRPRTF    FILE(QPSUPRTF)  USRDTA(&N)        
                  STRSEU SRCFILE(&l/&f) SRCMBR(&n) option(6)   
             endpgm
      The above will change the user data of the spool file to be the source member name, but the spool file name will still be QPSUPRTF.

      Best of Luck
      GLS
      The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

      Comment


      • #4
        Re: Print source files in their original name

        Ok..i will put down what my idea is:
        I am trying to EDIT some spool files just like editing a source member. CPYSPLF -> CPYF with CVTSRC-> STRSEU and EDIT -> PRINT.....Generate a new one with the same name.
        I am doing this because there is a complex job that we frequently run that produces a number of reports. Mock reports are needed for future projects which are similar to these reports. So just thought of editing all these instead of running the daily/weekly jobs. Well SQL is not that easy.

        May be a not so good idea, but just wanted to do it however useful it may prove.



        And yes, i have tried QAUOOPT PDM options already and changing the USERDATA will be fine, but it wouldn't look as if the reports were generated by the system.

        Even if i accomplish this, i still have a problem, the version and other details are printed on the first line. Not a big concern.
        Thanks
        Sudarshan

        Comment


        • #5
          Re: Print source files in their original name

          errm, Sorry GLS, but no cl is needed...
          just do F16, F6, give it the code you want and then type in OVRPRTF FILE(QPSUPRTF) USRDTA(&N).

          If one wanted to use a cl for this then the cl might be something like:
          Code:
                 pgm parm(&l &f &n)                                
                      dcl &l *char 10                              
                      dcl &f *char 10                              
                      dcl &n *char 10                              
                      CRTDUPOBJ OBJ(QPSUPRTF) FROMLIB(*LIBL) OBJTYPE(*FILE) NEWOBJ(&N) 
                      OVRPRTF    FILE(QPSUPRTF) FILE(*LIBL/&N)
                      STRSEU SRCFILE(&l/&f) SRCMBR(&n) option(6)
                      dltf (&l/&n) 
                 endpgm
          Just ensure that QPSUPRTF is in QSYS or QSYSxxxx (language dependent lib). The duplicate will be created in the same library and will be deleted from there as well. One might also want to use qtemp. Just remember that if you use this for the printing of a PF or LF, the duplicated object may now has the same name and type (i.e. *file) as the proper PF or LF and you don't want to be deleting that.
          Last edited by kitvb1; October 22, 2008, 12:54 AM.
          Regards

          Kit
          http://www.ecofitonline.com
          DeskfIT - ChangefIT - XrefIT
          ___________________________________
          There are only 3 kinds of people -
          Those that can count and those that can't.

          Comment


          • #6
            Re: Print source files in their original name

            CL is needed. If you just OVRPRTF you must enter first the newly created PDM option AND then 6. Besides the override remains active.

            Below yet another easier workaround of the CL program using SPLNAME on OVRPRTF.

            Code:
            pgm parm(&l &f &n)                            
                 dcl &l *char 10                          
                 dcl &f *char 10                          
                 dcl &n *char 10                          
                                                          
                 ovrprtf QPSUPRTF  [B]splfname[/B]( &N )         
                 strseu  &l/&f srcmbr( &n ) option( 6 )   
                 dltovr  QPSUPRTF                         
            endpgm
            The spool file will get the same name as the related member name and there's no need to create any dup file in QTEMP lib either.
            Last edited by Mercury; October 22, 2008, 03:49 AM.
            Philippe

            Comment


            • #7
              Re: Print source files in their original name

              Hey Phillipe,

              I like yours the best.
              Regards

              Kit
              http://www.ecofitonline.com
              DeskfIT - ChangefIT - XrefIT
              ___________________________________
              There are only 3 kinds of people -
              Those that can count and those that can't.

              Comment


              • #8
                Re: Print source files in their original name

                Thanks Kit.
                Philippe

                Comment


                • #9
                  Re: Print source files in their original name

                  Kit:

                  For what it's worth
                  Code:
                  CRTDUPOBJ OBJ(QPSUPRTF) FROMLIB(*LIBL) OBJTYPE(*FILE) NEWOBJ(&N)
                  OVRPRTF    FILE(QPSUPRTF) FILE(*LIBL/&N)
                  does not work. The error is EDT0245:
                  Message . . . . : Invalid printer override active. Printing terminated.
                  Cause . . . . . : The SEU printer file QPSUPRTF is overridden with an
                  override with a name other than QPSUPRTF.
                  Recovery . . . : Delete the printer override of QPSUPRTF.
                  No printout at all...

                  I like Mercury's the best too.

                  GLS
                  The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                  Comment


                  • #10
                    Re: Print source files in their original name

                    thanks Greg
                    Philippe

                    Comment


                    • #11
                      Re: Print source files in their original name

                      Hey GLS,
                      You are right.
                      It took the override ok, but fails on the print. Strange... and there's no documentation (that I can find on IBM) on why they disallow this.

                      btw and hint to keyboard buyers... I also notice that my post had the ovrprtf "file" parameter twice instead of "tofile" as the 2nd parameter. I got myself 2 new keyboards recently - Logitech Wave. I chose them 'cos the F-keys work with the IBM 5250emulation (the Microsoft Keyboard Elite for Bluetooth does not!). But the Wave has the insert key 1 line higher - so i keep going to Pos1 or deleting chars . Oh well, something to check for when I next buy keyboards.
                      Regards

                      Kit
                      http://www.ecofitonline.com
                      DeskfIT - ChangefIT - XrefIT
                      ___________________________________
                      There are only 3 kinds of people -
                      Those that can count and those that can't.

                      Comment

                      Working...
                      X