Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17



Posted on 2004-09-24
Medium Priority
Last Modified: 2012-06-21
Is there any know solution to specify a position to a MSGCON in a PTRF with the AFP op-code POSITION(X,Y)  ?

when I compile my prtf it gives me an error wherever I put the MSGCON.

PS: Samething with DFT !!
Question by:Helixir
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 14

Expert Comment

ID: 12158475
Hi  Helixir
I have had this problem and could not get it to work.
My understanding is you can only use the position keyword with fields and overlays.
My workround solution was:

make the field names in the DDS the message id's ie (note to make like easy in the RPG make all the field lengths the same- proessing can the be performed in an array

A          R @@HDR                                                
A            MSG0001       25          POSITION(12 10)            
A            MSG0002       25          POSITION(12 12)            
A            MSG1025       25          POSITION(12 13)            
A            MSG1027       25          POSITION(12 14)            
A            MSG1256       25          POSITION(12 15)            
A            MSG1035       25          POSITION(12 16)            

then in the RPG would look somthing like

 ** Api to get messages                                                                      
dRcv100           ds                                                                          
dByteRtn                  1      4b 0                                      Bytes Returned    
dByteAvl                  5      8b 0                                      Bytes Available    
dMsgLenRtn                9     12b 0                                      Length Of Msg. R  
dMsgLenAvl               13     16b 0                                      Length Of Msg. A  
dMsgData                 25    174                                         Actual Message    
 * Error Codes In Case of Error                                                              
dErrCode          ds            16                                                            
dByteProvide              1      4b 0 Inz(16)                              Byyes Provided    
dByteAvail                5      8b 0                                      Bytes Available    
dExcpText                 9     15                                         Exception Msg./T  
 **Parms for the API call                                                                    
dLenMsgInf        s              9b 0 Inz(%SIZE(MsgData))                  Message Length    
dFmtName          s              8    Inz('RTVM0100')                      Format name        
dMsgIdn           s              7                                         Message Id        
dMsgFile          s             20    Inz('MYMSGFILE *LIBL     ')          Message File      
dMesgData         s            130    Inz(*Blanks)                         Message            
dMesgLen          s              9b 0 Inz(130)                             Message Length    
dReplSubs         s             10    Inz('*NO')                           Replace Substitu  
dRtnFmtCC         s             10    Inz('*NO')                           Return Fmt.Contr  
 ** MAP DDS fields to array and set degfault values                                          
d fmt@@HDR        ds                                                                          
d MSG0001                             Inz('Initial value')                                    
d MSG0002                             Inz('Initial value')                                    
d MSG1025                             Inz('Initial value')                                    
d MSG1027                             Inz('Initial value')                                    
d MSG1256                             Inz('Initial value')                                    
d MSG1035                             Inz('Initial value')                                    
d txtary                              like(MSG0001) dim(6)                                    
D                                     Overlay(fmt@@HDR:1)                                    
 ** Msg Id's to override default values                                                      
d fmtHDRAry       s              7    Dim(6) Perrcd(1) CtData                                
 ** Wirk Fielsd                                                                              
d idx             s             10i 0                                                        
C                   FOR       IDX=1  TO %ELEM(fmtHDRAry)                                      
C                   CLEAR                   MsgData                                          
C                   reset                   ErrCode                                        
c                   Call      'QMHRTVM'                                                    
c                   Parm                    Rcv100                                          
c                   Parm                    LenMsgInf                                      
c                   Parm                    FmtName                                        
c                   Parm      fmtHDRAry(idx)MsgIdn                                          
c                   Parm                    MsgFile                                        
c                   Parm                    MesgData                                        
c                   Parm                    MesgLen                                        
c                   Parm                    ReplSubs                                        
c                   Parm                    RtnFmtCC                                        
c                   Parm                    ErrCode                                        
 ** If no error then message exists, so use the dext                                        
C                   IF        ByteAvail=0                                                  
C                   EVAL      TXTARY(IDX)=MsgData                                          
C                   ENDIF                                                                  
C                   ENDFOR                                                                  
C                   EVAL      *INLR=*ON                                                    
** Message array    



Author Comment

ID: 12159407
Thanks Dave,

My problem is that it for the Fax Cover, so I don't have RPG behind the printer file, I'll probably do a old fashionned record !! with no position !
LVL 14

Expert Comment

ID: 12159553
another solution is to craete an overlay. This could then be positioned in the DDS.

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.


Author Comment

ID: 12163201
Hey, Last time I did overlays I was using the driver AFP240, but it doesn't seem to work with Office 2002, What driver are you using ??
LVL 14

Accepted Solution

daveslater earned 1000 total points
ID: 12163479
are you working in Win 9x or Win 2K/XP. They work differently.

I use the AFP 300 Printer in 2K/XP

check out
for 2k/xp configuration

Win  9x should be OK.


Author Comment

ID: 12163643
Thanks Dave

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question