• Declaring primary file in fully free format in rpgle and error *RNF7421

    From techie21 IT@21:1/5 to All on Thu Jan 13 06:47:59 2022
    Hi,

    How can we declare primary file in a fully free format RPGLE program also how to avoid *RNF7421-Operands are not compatible with the type of operator.
    for below piece of program:-


    If fld1 = 'ABCDEF' AND +
    %Date(fld2 : *CYMD) = %Date AND +

    (fld3 = 'AAA' or FLD3 = 'BBB');


    Thanks .....

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Yann Oche@21:1/5 to All on Fri Mar 4 01:08:59 2022
    Le jeudi 13 janvier 2022 à 15:48:01 UTC+1, techie21 IT a écrit :
    Hi,

    How can we declare primary file in a fully free format RPGLE program also how to avoid *RNF7421-Operands are not compatible with the type of operator.
    for below piece of program:-


    If fld1 = 'ABCDEF' AND +
    %Date(fld2 : *CYMD) = %Date AND +

    (fld3 = 'AAA' or FLD3 = 'BBB');


    Thanks .....
    Hi,
    For primary, teh doc says: 'P Input or Update Primary file Not supported in free-form'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Carlos@21:1/5 to yann.he...@gmail.com on Mon Oct 3 14:19:50 2022
    On Friday, March 4, 2022 at 3:09:01 AM UTC-6, yann.he...@gmail.com wrote:
    Le jeudi 13 janvier 2022 à 15:48:01 UTC+1, techie21 IT a écrit :
    Hi,

    How can we declare primary file in a fully free format RPGLE program also how to avoid *RNF7421-Operands are not compatible with the type of operator.
    for below piece of program:-


    If fld1 = 'ABCDEF' AND +
    %Date(fld2 : *CYMD) = %Date AND +

    (fld3 = 'AAA' or FLD3 = 'BBB');


    Thanks .....
    Hi,
    For primary, teh doc says: 'P Input or Update Primary file Not supported in free-form'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Carlos@21:1/5 to yann.he...@gmail.com on Mon Oct 3 14:21:37 2022
    On Friday, March 4, 2022 at 3:09:01 AM UTC-6, yann.he...@gmail.com wrote:
    Le jeudi 13 janvier 2022 à 15:48:01 UTC+1, techie21 IT a écrit :
    Hi,

    How can we declare primary file in a fully free format RPGLE program also how to avoid *RNF7421-Operands are not compatible with the type of operator.
    for below piece of program:-


    If fld1 = 'ABCDEF' AND +
    %Date(fld2 : *CYMD) = %Date AND +

    (fld3 = 'AAA' or FLD3 = 'BBB');


    Thanks .....
    Hi,
    For primary, teh doc says: 'P Input or Update Primary file Not supported in free-form'
    Try SQL cursors and do a loop. You primary file will be the one that you are using in the Select. For MR, you can use JOIN. I hope it helps. Carlos Irigoyen

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jon.f.paris@gmail.com@21:1/5 to All on Tue Oct 4 14:21:31 2022
    On Thursday, January 13, 2022 at 9:48:01 AM UTC-5, techie21 IT wrote:
    Hi,

    How can we declare primary file in a fully free format RPGLE program

    Simple answer - you can't. When fully free-form RPG was introduced the decision was taken to not support primary/secondary files. The cycle is not taught in schools and is rarely used in modern programs.

    also how to avoid *RNF7421-Operands are not compatible with the type of operator.

    You have used "+" signs to continue a line when no such continuation marker is needed. Normally the only continuations needed in expressions is when a literal has to stretch over multiple lines. So just remove the "+"s and all will be well - assuming
    the rest of the syntax is kosher of course.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)