× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks for the idea...  I ended up using a cruder method, but it did the
job...

After the replace, I have a routine that looks for spaces, in the
substitution range, and if their there, I squeeze them out...
SBMJOB CMD(CRTBNDRPG PGM(___LIBR___/__SCRIPT__)
SRCFILE(___LIBR___/___FILE___)
becomes.
SBMJOB CMD(CRTBNDRPG PGM(cginew/__SCRIPT__) SRCFILE(cginew/___FILE___)


     c                   dou        sub_mbr = 0

     c                   eval       sub_mbr = %scan('___LIBR___':cmd)

     c                   if         sub_mbr > 0

     c                   eval       %subst(cmd:sub_mbr:10) = srclibrary

     c                   eval       cmd = stripspaces(cmd:sub_mbr:10)

     c                   endif

     c                   enddo


........

It will remove the spaces

     P stripspaces     B

     D stripspaces     PI          1024    Varying

     D   instring                  1024    varying options(*varsize) const

     D   start                        5  0 value

     D   end                          5  0 value

     d workstring      s           1024    varying inz(*blanks)

     d count           s              5  0 inz(1)

     d i               s              5  0

 

     C                   for       i = 1 to %len(instring)

     c                   if        %subst(instring:i:1) = ' ' and

     c                             (i >=start and i<=end+start)

     c                   iter

     c                   endif

 

     c                   eval      %subst(workstring:count:1) =

     c                             %subst(instring:i:1)

 

     c                   eval      count = count +1

 

     c                   endfor

     C                   return    workstring

/********************************************

     P stripspaces     E


Thanks again, tim



> -----Original Message-----
> From: midrange-l-bounces@xxxxxxxxxxxx
> [SMTP:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jonathan Mason
> Sent: Wednesday, February 23, 2005 9:59 AM
> To:   Midrange Systems Technical Discussion
> Subject:      Re: cl replacment values.
> 
> Tim
> 
> In the past I have tended to use the technique that Paul suggests, however
> I have started moving towards using message files and creating a message
> definition for the command with replacement variables, for example
> 
> ADDMSGD MSGID(CMD0100) MSGF(mylib/mymsgf) 
>   MSG('CRTBNDRPG PGM(&1/&2) SRCFILE(&3/&4) DBGVIEW(*LIST)')
>   FMT((*CHAR 10) (*CHAR 10) (*CHAR 10) (*CHAR 10))
> 
> Then in a CL program I can use:
> 
> CHGVAR &MSGDTA VALUE(&LIBR *CAT &MEMBER *CAT &LIBR *CAT &FILE)
> 
> RTVMSG MSGID(CMD0100) MSGF(mylib/mymsgf) MSGDTA(&MSGDTA)
>   MSG(&CMD) MSGLEN(&CMDLEN)
> 
> Alternatively, I can use a sub-procedure in a service program that places
> a call to the QMHRTVM API (apologies for the spacing with the font):
> 
> p RtvMsg          b                   Export                
>                                                             
> ** Procedure interface                                      
> d RtvMsg          pi           512                          
> d  MsgId                         7    Value                 
> d  MsgF                         20    Options(*NoPass)      
> d  MsgDta                      256    Options(*NoPass)      
>                                                             
> d RtvM0100        ds                                        
> d  Byte_Rtn                      9b 0                       
> d  Byte_Avl                      9b 0                       
> d  Lgth_Msg_Rtn                  9b 0                       
> d  Lgth_Msg_Avl                  9b 0                       
> d  Lgth_Hlp_Rtn                  9b 0                       
> d  Lgth_Hlp_Avl                  9b 0                       
> d  Msg_Txt                     512                          
>                                                             
> d MsgFile         s             20    Inz('SYSMSGF   *LIBL')
> d MsgLgth         s              9b 0 Inz(%Size(RtvM0100))  
> d MsgFmt          s              8    Inz('RTVM0100')               
> d Subst           s             10    Inz('*NO')                    
> d RtnFmt          s             10    Inz('*NO')
> 
> d Rep             s            256                                  
> d RepLgth         s              9b 0 Inz(%Size(Rep))               
>                                                                     
> c                   Reset                   ApiErr                  
>                                                                     
> c                   If        %Parms > 1 and MsgF <> '*SAME'
> 
> c                   Eval      MsgFile = MsgF                        
> c                   EndIf                                           
>                                                                     
>  * If substitution data is passed then we need to include it when we
>  * retrieve the message description...                              
> c                   If        %Parms = 3                            
> c                   Eval      Rep = MsgDta                          
> c                   Eval      RepLgth = %Size(Rep)                  
> c                   Eval      Subst = '*YES'                        
> c                   EndIf                           
>                                                     
> c                   Call(e)   'QMHRTVM'             
> c                   Parm                    RtvM0100
> c                   Parm                    MsgLgth 
> c                   Parm                    MsgFmt  
> c                   Parm                    MsgId   
> c                   Parm                    MsgFile 
> c                   Parm                    Rep     
> c                   Parm                    RepLgth 
> c                   Parm                    Subst   
> c                   Parm                    RtnFmt  
> c                   Parm                    ApiErr  
>                                                     
> c                   Return    Msg_Txt               
>                                                     
> p RtvMsg          e                                 
> 
> 
> Hope it helps
> 
> All the best
> 
> Jonathan
> www.astradyne-uk.com
> 
> -----Original message-----
> From: "Paul Morgan" pmorgan@xxxxxxxxxxxxxx
> Date: Tue, 22 Feb 2005 22:20:20 +0000
> To: midrange-l@xxxxxxxxxxxx
> Subject: Re: cl replacment values.
> 
> > Tim,
> > 
> > If you're building this command in a CL program use the *TCAT operator
> right
> > after the library, member and file variables:
> > 
> > CHGVAR VAR(&COMMAND) VALUE('CRTBNDRPG PGM(' *CAT &LIB *TCAT '/' *CAT
> &MEMBER
> > *TCAT ') SRCFILE(' *CAT &LIB *TCAT '/' *CAT &FILE *TCAT ')
> DBGVIEW(*LIST)')
> > 
> > If you're building the command string in RPG use the %TRIMR built in
> > function (free format):
> > 
> > Command = 'CRTBNDRPG PGM(' + %TrimR( Lib ) + '/' + %TrimR( Member ) + ')
> > SRCFILE(' + %TrimR( Lib ) + '/' + %TrimR( File ) + ') DBGVIEW(*LIST)';
> > 
> > Paul
> > 
> > -- 
> > Paul Morgan
> > Senior Programmer Analyst - Retail
> > J. Jill Group
> > 100 Birch Pond Drive, PO Box 2009
> > Tilton, NH 03276-2009
> > Phone: (603) 266-2117
> > Fax:   (603) 266-2333
> > 
> 
> -- 
> This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
> list
> To post a message email: MIDRANGE-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/midrange-l
> or email: MIDRANGE-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/midrange-l.
> 
This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential or privileged
information.  Any unauthorized review, use, disclosure or distribution is
prohibited.  If you are not the intended recipient, please contact the
sender by reply e-mail and destroy the message.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.