vscode-ibmi icon indicating copy to clipboard operation
vscode-ibmi copied to clipboard

Error RNF0733 Compile Error Only in VSCode

Open rroberts-sas opened this issue 2 years ago • 11 comments

We increased the record length of our source files to 132 bytes. We also use /include in our code to import prototypes into the RPG code when compiled.

This means we need to use *LVL2 on the RPGPPOPT parm on the CRTSQLRPGI command. When we compile a program from PDM, command line, or RDi the code compiles successfully. When we execute the compile using an Action in VSCode, the compile fails with RNF0733: The record length of the output file is too small.

The environment variable QIBM_RPG_PPSRCFILE_LENGTH is set to 132 and, as I mentioned, the code compiles successfully when using PDM to compile.

Would you look for a reason why this may happen? If you need more information, let me know.


Context Version
Code for IBM i version 2.4.0
Visual Studio Code version 1.84.1
Operating System win32_x64
Active extensions
Code for IBM i Walkthroughs (vscode-ibmi-walkthroughs): 0.4.0
Db2 for IBM i (vscode-db2i): 0.5.2
Emmet (emmet): 1.0.0
Error Lens (errorlens): 3.15.0
Extension Authoring (extension-editing): 1.0.0
Git (git): 1.0.0
Git Base (git-base): 1.0.0
GitHub (github): 0.0.1
GitHub Authentication (github-authentication): 0.0.2
Grunt support for VS Code (grunt): 1.0.0
Gulp support for VSCode (gulp): 1.0.0
IBM i Notebooks (vscode-ibmi-notebooks): 0.0.6
JSON Language Features (json-language-features): 1.0.0
Jake support for VS Code (jake): 1.0.0
Markdown Language Features (markdown-language-features): 1.0.0
Markdown Math (markdown-math): 1.0.0
Merge Conflict (merge-conflict): 1.0.0
NPM support for VS Code (npm): 1.0.1
Node Debug Auto-attach (debug-auto-launch): 1.0.0
RPGLE (vscode-rpgle): 0.23.0
Reference Search View (references-view): 1.0.0
TODO Highlight (vscode-todo-highlight): 1.0.5
TypeScript and JavaScript Language Features (typescript-language-features): 1.0.0
WSL: Recommender (remote-wsl-recommender): 0.0.19

Remote system
Setting Value
IBM i OS V7R4M0
Tech Refresh 8
CCSID 37
SQL Enabled
Source dates Enabled

Enabled features

/QOpenSys/pkgs/bin /usr/bin /QSYS.lib/ILEDITOR.lib /QSYS.LIB /QIBM/ProdData/IBMiDebugService/bin
bash attr GENCMDXML.PGM QZDFMDB2.PGM startDebugService.sh
git iconv GETNEWLIBL.PGM
ls setccsid
md5sum tar
sort
stat
tn5250
Shell env
BUILDLIB=AIMDRRR2
CURLIB=AIMDRRR2
HOME=/home/RROBERTS
HOST=devsysp7
LIBLS=RROBERTS QTEMP QS36F QGPL AIMPROD@ AIMPRODDTA AIMPROD AIMDRRDTA2 AIMDRR@R2 AIMMOD22D AIMMOD22 AIMMOD22@ AIMUAT22D AIMUAT22 AIMUAT22@ ITUTILSSRC ITUTILS AIMDRRR2
LOGIN=rroberts
LOGNAME=rroberts
MAIL=/var/spool/mail/rroberts
OLDPWD=/home/RROBERTS
PASE_USRGRP_LIMITED=N
PATH=/QOpenSys/usr/bin:/usr/ccs/bin:/QOpenSys/usr/bin/X11:/usr/sbin:.:/usr/bin
PWD=/home/RROBERTS
SHELL=/QOpenSys/pkgs/bin/bash
SHLVL=1
SSH_CLIENT=10.199.80.42 60682 22
SSH_CONNECTION=10.199.80.42 60682 10.0.0.230 22
TZ=<MST>7<MDT>,M3.2.0,M11.1.0
USER=rroberts
USERNAME=rroberts
_=/QOpenSys/usr/bin/env
Variants
{
  "american": "#@$",
  "local": "#@$"
}
Errors
[
  {
    "command": "/QOpenSys/usr/bin/qsh",
    "code": 1,
    "stderr": "CPC7301:  File QSQLPRE created in library QTEMP.\nCPC7305:  Member AN5252RP added to file QSQLPRE in QTEMP.\nCPC3201:  Member AN5252RP file QSQLPRE in QTEMP changed.\nRNS9307:  Diagnostic check of source is complete. Highest severity is 00.\nCPC0904:  Data area RETURNCODE created in library QTEMP.\nCPC7301:  File QSQLTEMP1 created in library QTEMP.\nCPC7305:  Member AN5252RP added to file QSQLTEMP1 in QTEMP.\nCPF7302:  File EVFTEMPF01 not created in library AIMDRRR2.\nRNS9308:  Compilation stopped. Severity 20 errors found in program.\nRNS9309:  Compilation failed. Module AN5252RP not created in library AIMDRRR2.",
    "cwd": "/home/RROBERTS"
  },
  {
    "command": "/QOpenSys/usr/bin/qsh",
    "code": 1,
    "stderr": "CPC7301:  File QSQLT00132 created in library QTEMP.\nCPC7305:  Member AN5252RP added to file QSQLT00132 in QTEMP.\nSQL9001:  SQL precompile failed.",
    "cwd": "/home/RROBERTS"
  },
  {
    "command": "/QOpenSys/usr/bin/qsh",
    "code": 1,
    "stderr": "CPC7301:  File QSQLPRE created in library QTEMP.\nCPC7305:  Member AN5252RP added to file QSQLPRE in QTEMP.\nCPC3201:  Member AN5252RP file QSQLPRE in QTEMP changed.\nRNS9308:  Compilation stopped. Severity 20 errors found in program.\nCPC0904:  Data area RETURNCODE created in library QTEMP.\nRNS9309:  Compilation failed. Module AN5252RP not created in library AIMDRRR2.\nSQL9019:  SQL precompile failed.",
    "cwd": "/home/RROBERTS"
  }
]

rroberts-sas avatar Nov 15 '23 14:11 rroberts-sas

Please verify that the environment variable QIBM_RPG_PPSRCFILE_LENGTH is set at the system level (WRKENVVAR LEVEL(*SYS)) - Code for IBM i spawns a new job for each compile, which needs to pick up this variable from the system level.

chrjorgensen avatar Nov 15 '23 14:11 chrjorgensen

It is specified at the system level.

image

rroberts-sas avatar Nov 15 '23 15:11 rroberts-sas

Please verify the compile command submitted from Code for IBM i (defined the your action) is the same as the compile commands used by PDM and RDi. C4i does not compile any different than the other two, just in a different environment.

Also look at the documentation for QIBM_RPG_PPSRCFILE_LENGTH - there are some conditions, like only the main source length being checked...

chrjorgensen avatar Nov 15 '23 15:11 chrjorgensen

The command executed from VSCode is the same as what is in the defined Action (except for the variables, obviously):

Here is the Action command: CRTSQLRPGI OBJ(AIMDRRR2/&OPENMBR) SRCFILE(&OPENLIB/&OPENSPF) OPTION(*EVENTF) DBGVIEW(*source) rpgppopt(*lvl2)

Here is the command in the compile output: CRTSQLRPGI OBJ(AIMDRRR2/AN5252RP) SRCFILE(AIMDRR@R2/QRPGLESRC) OPTION(*EVENTF) DBGVIEW(*source) rpgppopt(*lvl2)

Here are two screenshots of the output shown in VSCode.

image

image

When I execute this command from the command line, the compile completes successfully.

image

rroberts-sas avatar Nov 15 '23 16:11 rroberts-sas

Any chance the @ in the source library name is causing an issue?

CRTSQLRPGI OBJ(AIMDRRR2/AN5252RP) SRCFILE(AIMDRR@R2/QRPGLESRC) OPTION(*EVENTF) DBGVIEW(*source) rpgppopt(*lvl2)

SJLennon avatar Nov 15 '23 17:11 SJLennon

I copied the source to a file in a library that doesn't have the @ in the library name and the pre-compile still fails for the same reason.

CRTSQLRPGI OBJ(AIMDRRR2/AN5252RP) SRCFILE(RROBERTS/QRPGLESRC) OPTION(*EVENTF) DBGVIEW(*source) rpgppopt(*lvl2)

rroberts-sas avatar Nov 15 '23 19:11 rroberts-sas

In the spool file of your complication, I believe there is a way to print the environment variables of the job. Can you try this and share the entire spool file with us? Thanks

worksofliam avatar Nov 17 '23 13:11 worksofliam

I have searched the compile command (CRTSQLRPGI) for an option to output the environment variables and don't see one. I also searched for the job that does the compile and it looks like those jobs start and end quickly. The QB5ROUTER job has 132 as the environment variable length, if that matters.

If there is such a compile option, if someone can point me to where it is, that would help.

I decided to run the DSPJOB command from the Action in VSCode to see what that job has in the environment variables. Here is what it created. The QIBM_RPG_PPSRCFILE_LENGTH global variable is not in the list.

DSPJOB ENVVAR output.txt

rroberts-sas avatar Nov 17 '23 17:11 rroberts-sas

Has your SSH server been restarted after you set the system environment value? The connection from C4i is run in a job spawned from the SSH server...

chrjorgensen avatar Nov 17 '23 18:11 chrjorgensen

I went ahead and ended and then restarted the *SSHD server and ran the compile as well as the DSPJOB. The compile still failed with the same error and the DSPJOB does not have the environment variable.

Quite a mystery happening here...

rroberts-sas avatar Nov 17 '23 19:11 rroberts-sas

@rroberts-sas is it possible to get the source code you are trying to compile? Perhaps through private communication channel. Would like to see if I can figure out what is happening.

krethan avatar Feb 03 '24 07:02 krethan

Hello, I had same issue on a new installation. I solved by ending and restarting *SSHD tcp service.

HenryMiller avatar Dec 03 '24 16:12 HenryMiller