× 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.


  • Subject: RE: RPG Field Scan
  • From: Neil Palmer <npalmer@xxxxxxxxxxx>
  • Date: Wed, 11 Mar 1998 18:35:14 -0600

Here's a nasty bit of RPGII code to convert to upper case that I just
thought I'd post because I had nothing better to do and thought it would
be fun to be attacked by all the RPG purists in the world !     :-)


C**                                               
C** Ensure that Surname prints in CAPITAL letters.
C**                                               
C                     DO   18        IX           
C                     BITON'1'       SNM,IX       
C                     END                         



Neil Palmer                                AS/400~~~~~      
NxTrend Technology - Canada   ____________          ___  ~     
Thornhill, Ontario,  Canada   |OOOOOOOOOO| ________  o|__||=   
Phone: (905) 731-9000  x238   |__________|_|______|_|______)   
Cell.: (416) 565-1682  x238    oo      oo   oo  oo   OOOo=o\   
Fax:   (905) 731-9202       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
mailto:NPalmer@NxTrend.com        http://www.NxTrend.com


> -----Original Message-----
> From: bvining@VNET.IBM.COM [SMTP:bvining@VNET.IBM.COM]
> Sent: Wednesday, March 11, 1998 1:09 PM
> To:   MIDRANGE-L@midrange.com
> Subject:      RPG Field Scan
> 
> Scott,
> 
> For the scan function, just using the RPG SCAN opcode should be
> sufficient.  For the uppercasing function, I would suggest using the
> Convert Case (*PGM QLGCNVCS or ILE function QlgConvertCase) system
> API.
> The APIs are documented in the System API Reference National Language
> Support APIs chapter.  To convert the contents of field DATAIN from
> OPM
> RPG (assuming you have already stripped of the '?') you could use:
> 
>      IREQCTL      DS
>      I I            1                     B   1   40TYPE
>      I I            0                     B   5   80CCSID
>      I I            0                     B   9  120CASE
>      I                                       13  22 RESERV
>      IMISC        DS
>      I I            11                    B   1   40LENGTH
>      I I            0                     B   5   80BYTPRV
>      I I            'Hello World'             9  33 DATAIN
>      C                     MOVE *LOVAL    RESERV
>      C                     CALL 'QLGCNVCS'
>      C                     PARM           REQCTL
>      C                     PARM           DATAIN
>      C                     PARM           DATAOT 25
>      C                     PARM           LENGTH
>      C                     PARM           BYTPRV
>      C           DATAIN    DSPLY
>      C           DATAOT    DSPLY
>      C                     MOVE '1'       *INLR
>      C                     RETRN
> 
> Alternatively you could use the RPG XLATE opcode to perform
> uppercasing,
> but using the API provides valid uppercasing in all national languages
> supported by the AS/400 (the CCSID of 0 in REQCTL) without you having
> to be concerned with the language currently in use.
> 
> Bruce Vining
> 
> >
> >I would like to be able to scan a field in a RPG program for a
> certain
> >character.  If that character exist, I would like to take that field
> and
> >convert it all to uppercase to be chained to another file.
> >
> >e.g.
> >
> >  Catalog Number:  gfn 3_______________
> >  Catalog Number:  ?drills_______________
> >
> >If this field starts with a '?' I want to make the field Uppercase
> and
> >then chain it to a different file.  This will be used to signify
> >KEYWORDS within the field without defining a new field. What API's
> are
> >available to make this happen.  and also what are the parm to pass to
> >these API's?
> >
> >TIA
> >Scott Swaim
> >Quality Corps, Inc.
> >scott@qualitycorps.com
> 
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.