OPNQRY Problem
Last Post 15 Jan 2013 02:04 PM by stu. 6 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
stu
New Member
New Member
Posts:47

--
04 Jan 2013 03:22 PM

 

Hi all,

    I have a problem with opnqry.  I have to sort an s36 type file with undefined fields.

K0001   1 –  8       8.0   Selection
F0001    1–  2          2.0    Div
F0001  17 – 44    28A      Name

K0001- - >             F0001 17 - 44- - - - - - - - - - - ->
01001000080êÌ­­­   LASTNAME       FIRSTNAME   I PO BOX 718               Phoenix         AZ85928   
                  div

Here is my CL:

CLOF       OPNID(STU.PAYMST)              
OVRDBF     FILE(STU.PAYMST) SHARE(*YES)

OPNQRYF    FILE((PAYMST)) QRYSLT('K00001 *EQ +    
             01001000') KEYFLD((DIV) (NAME)) +               
             MAPFLD((DIV '%SST(F0001 1 2)' *ZONED 2) (NAME + 
             'F0001 9 36)'))

#1, it displays error:     700 - OVRDBF FILE(STU.PAYMST) SHARE(*YES)                            
                                        900 - OPNQRYF FILE((STUART/STU.PAYMST)) QRYSLT('K00001 *EQ 01001000')
                                               KEYFLD((DIV) (NAME)) MAPFLD((DIV '%SST(F0001 1 2)' *ZONED 2) (NAME    
                                               'F0001 9 36)'))                                                       
                                             Field F0001 on MAPFLD parameter not found.                              
                                                 Error occurred during processing of command.                            
                                             Function check. CPF9899 unmonitored by TSTQRYCL at statement 0000000900,  instruction X'0000'.

 #2. the RPG processes every record, it should be processing 1 record.

Thanks in advance

 

Brian Rusch
Advanced Member
Advanced Member
Posts:557

--
04 Jan 2013 04:14 PM

You forgot the %SST function for the NAME field in the MAPFLD parameter:

OPNQRYF FILE((PAYMST)) QRYSLT('K00001 *EQ +
01001000') KEYFLD((DIV) (NAME)) +
MAPFLD((DIV '%SST(F0001 1 2)' *ZONED 2) (NAME +
'%SST(F0001 9 36)'))

Also, F0001 has to be defined as a field in the PAYMST file (as well as K00001).

GARYS
Basic Member
Basic Member
Posts:211

--
04 Jan 2013 08:49 PM
Hi Stu:
F0001 should have 4 0's (F00001)

Best of luck
Gary
stu
New Member
New Member
Posts:47

--
05 Jan 2013 08:24 AM
Thank you both. I will be able to try this Monday & let you know
Stu
stu
New Member
New Member
Posts:47

--
07 Jan 2013 08:39 AM
Hi all,
I tried a few different changes, including 4 0000's, but still no luck.
Here is my latest:

600 - OPNQRYF FILE((PAYMST)) QRYSLT('K00001 *EQ 01001000') KEYFLD((DIV))
MAPFLD((DIV '%SST(F00001 1 2)' *ZONED 2) (NAME '(F00001 9 36)'))
Missing operator in expression on MAPFLD parameter.
Error occurred during processing of command.
Function check. CPF9899 unmonitored by TESTQRY at statement 0000000600,
instruction X'0000'.

Thanks again
Bryan Leaman
Veteran Member
Veteran Member
Posts:1745
Avatar

--
07 Jan 2013 09:01 AM
Looks like you're still missing the %sst function on your "NAME" mapfld: (NAME '(F00001 9 36)'))

--Bryan
stu
New Member
New Member
Posts:47

--
15 Jan 2013 02:04 PM
Hi All,
I finally put all the fires out & got back to this, works perfect
Thanks
You are not authorized to post a reply.

Acceptable Use Policy