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
Solved

MSGCON and AFP

Posted on 2004-09-24
6
637 Views
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 !!
0
Comment
Question by:Helixir
  • 3
  • 3
6 Comments
 
LVL 14

Expert Comment

by:daveslater
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                                                                                            
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                                                                                          
C                   EVAL      *INLR=*ON                                                    
** Message array    
MSG0001              
MSG0002              
MSG1025              
MSG1027              
MSG1256              
MSG1035


Dave            

0
 
LVL 1

Author Comment

by:Helixir
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 !
0
 
LVL 14

Expert Comment

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

Dave
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 1

Author Comment

by:Helixir
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 ??
0
 
LVL 14

Accepted Solution

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

I use the AFP 300 Printer in 2K/XP

check out
http:Q_20884225.html
for 2k/xp configuration

Win  9x should be OK.


Dave
0
 
LVL 1

Author Comment

by:Helixir
ID: 12163643
Thanks Dave
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
cwbx.dll not working on 64-bit 6 2,195
CWBX .NET Message Queue 9 336
Comments on the use of ftp server/client on OS/400 AS/400 4 111
FTP Server IBM i -  Passive Modus and IP Address 2 71
Most MSPs worth their salt are already offering cybersecurity to their customers. But cybersecurity as a service is wide encompassing and can mean many things.  So where are MSPs falling in this spectrum?
This article describes how to reset your Windows 10 password when you've forgotten it.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 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