Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute PPMINOUTLN command default #182

Open
edmundreinhardt opened this issue Dec 8, 2022 · 2 comments
Open

Compute PPMINOUTLN command default #182

edmundreinhardt opened this issue Dec 8, 2022 · 2 comments
Assignees

Comments

@edmundreinhardt
Copy link
Member

The following CL command would have to be converted to Python

   dcl &cmd      type(*char) len(20) value('CRTBNDRPG BMORRIS740')
   dcl &destinfo type(*char) len(1000)
     dcl &ccsid      *int  4    stg(*defined) defvar(&destinfo 1)
     dcl &cntryid    *char 2    stg(*defined) defvar(&destinfo 5)
     dcl &langid     *char 3    stg(*defined) defvar(&destinfo 7)
     dcl &rsrvd1     *char 3    stg(*defined) defvar(&destinfo 10)
     dcl &pathtype   *int  4    stg(*defined) defvar(&destinfo 13)
     dcl &pathlen    *int  4    stg(*defined) defvar(&destinfo 17)
     dcl &pathdelim  *char 2    stg(*defined) defvar(&destinfo 21)
     dcl &rsrvd2     *char 10   stg(*defined) defvar(&destinfo 23)
     dcl &pathname   *char 200  stg(*defined) defvar(&destinfo 33)
   dcl &rcvr     type(*char) len(1)
   dcl &errcode  type(*char) len(8)  value(x'00000000')
   chgvar &ccsid      0
   chgvar &cntryid    x'0000'
   chgvar &langid     x'000000'
   chgvar &rsrvd1     x'000000'
   chgvar &pathtype   0
   chgvar &pathdelim  '/'
   chgvar &rsrvd2     x'00000000000000000000'
   chgvar &pathlen    17
   chgvar &pathname   '/home/bmorris/yyy'
   call QCDRCMDD                       +
      parm(&cmd &destinfo 'DEST0200'   +
           &rcvr 'CMDD0200' &errcode)
   return

It returns the following XML for the PPMINOUTLN parameter

<Parm Kwd="PPMINOUTLN" 
 PosNbr="40" 
 KeyParm="NO" 
 PmtCtl="PMTRQS" 
 RtnVal="NO" 
 PassVal="DFT" 
 Type="INT2" 
 Min="0" 
 Max="1" 
 Prompt="MINIMUM OUTPUT LINE LENGTH" 
 Rstd="NO" 
 Dft="250" 
 RangeMinVal="100" 
 RangeMaxVal="32754" 
 AlwUnprt="YES" 
 AlwVar="YES" 
 Expr="NO" 
 Full="NO" 
 DspInput="YES" 
 Vary="NO" 
 PassAtr="NO" 
 Case="MONO" 
 CCSID="JOB" 
 IsDtaAra="NO" 
 IsFile="NO" 
 IsPgm="NO" 
 Choice="100-32754" 
></Parm>

The case above comes from CHGCMDDFT to make PPMINOUTLN 250

@worksofliam
Copy link
Member

Another way to do it in SQL

call qsys.qcdrcmdd(
  'CRTBNDRPG QSYS      ', 
  x'00000000000000000000000000000000' || x'0000000F614000000000000000000000' || rpad('/tmp/abcdefghijklmno', 32, x'40'), 
  'DEST0200', 
  ' ', 
  'CMDD0100', 
  X'00000010404040404040404040404040'
);

Note that the total path cannot be more than 15 characters.

@edmundreinhardt
Copy link
Member Author

IBM believes that the solution for the Idea described is available with PTFs for 7.3, 7.4, and 7.5.

          The PTFs allow you to control the line length of the source file specified by the PPSRCFILE parameter for CRTBNDRPG or CRTRPGMOD when the RPG compiler is called in pre-processor mode. The most common reason for the RPG compiler to be called in pre-processor mode is when the CRTSQLRPGI command is specified with RPGPPOPT(*LVL1) or RPGPPOPT(*LVL2). In that case, the SQL precompiler calls the RPG compiler, specifying PPSRCFILE(QTEMP/QSQLPRE).
          
          The actual record length of the file is 12 bytes longer than the line length. For example, if the line length is the default of 100, the record length is 112.
          
          There are two separate enhancements:
          
          1. Support for compile-time environment variable QIBM_RPG_PPSRCFILE_LENGTH. When this environment variable is specified with a value between 100 and 32754, the file specified by the PPSRCFILE parameter is created with that line length, if the file does not already exist.
          
          2. Support for new command parameter PPMINOUTLN (Minimum output length for PPSRCFILE). You can specify a value between 100 and 32754. This parameter specifies the minimum line length for the file specified by the PPSRCFILE parameter. If the file does not exist, the RPG compiler creates the file with the maximum of the value specified by the PPMINOUTLN parameter and the longest line length in the file specified by the SRCFILE or SRCSTMF parameter, up to a length of 32754.
          
          Warning: If you apply the PTF for the command parameter, it will cause any changed command defaults to revert to the shipped defaults. If command default changes have been made for the CRTBNDRPG or CRTRPGMOD commands, the changes will have to be made
          again. If copies have been made of the QDEVTOOLS/CRTBNDRPG or QDEVTOOLS/CRTRPGMOD commands, these copies will not have the new
          PPMINOUTLN parameter. If this new parameter is desired, then new copies will have to be made of the commands.
          
          To obtain these enhancements, you need the following PTFs:
          
          7.3:
          1. PTF to support the environment variable: 5770WDS SI82184
          2. PTF to support the new commad parameter: 5770WDS SI82183
          
          7.4:
          1. PTF to support the environment variable: 5770WDS SI82178
          2. PTF to support the new commad parameter: 5770WDS SI82179
          
          7.5:
          1. PTF to support the environment variable: 5770WDS SI82185
          2. PTF to support the new commad parameter: 5770WDS SI82186
          
          For more information, see https://www.ibm.com/support/pages/node/6857461.
          
          - IBM Power Systems Development

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants