Opnqry problem
Last Post 04 Jan 2013 04:11 PM by Brian Rusch. 2 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:19 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
0001    1–  2          2.0
F0001  17 – 44    28A

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

 

GARYS
Basic Member
Basic Member
Posts:211

--
04 Jan 2013 03:30 PM
Hi Stu:

I think there should there be 4 0's in F0001 (F00001)

Best of Luck
Gary
Brian Rusch
Advanced Member
Advanced Member
Posts:557

--
04 Jan 2013 04:11 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).

You are not authorized to post a reply.

Acceptable Use Policy