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



Typically German keyboards are found on a system configured for German, Spanish keyboards are found on a system configured for Spanish, Russian keyboards are found on a system configured for Russian, etc. So your program should be good to go IF the system/job you are running on/in has been properly configured for the language environment. Proper configuration here means that the job default CCSID matches the language in use by the user. So in your test environment, if the workstation is CCSID 273 then the job should be in CCSID 273 or the job CCSID should be 65535 and the job language ID should be DEU (which sets the default job CCSID to 273). Only if there is a mismatch between device and job will your program have a problem, and even then only if the commercial at sign is variant within the mismatch.

This mismatch can be handled by changing your *DSPF CHRID to *JOBCCSID (or equivalent using *CHRIDCTL). A typical reason for a mismatch is the traveling executive situation where a person signs on to one system with one language keyboard type, passes through to another system configured in a different language, and then runs an application on the target system. CHRID(*JOBCCSID) will cause work station data management to do a CCSID conversion to/from the *DEVD CCSID and the actual job CCSID (so long as the job is not 65535 -- and if it is 65535 then that's a configuration problem with the *USRPRF as people using different runtime environments (different CCSID *DEVDs in this case) should not be set to run in 65535).

So you should be OK assuming the system is properly configured.

Bruce


Ashish Kulkarni <ashish.kulkarni13@xxxxxxxxx> wrote:
HiI did change my client access to Host Code Page to 273, which is German,
then changed my job to CCSID to 273 and then ran the program and it did
work.
But now again the issue is how do i get a RPGLE program working to validated
email address in all different setups, i have to support various languages
in various countries.

Ash

On Fri, Oct 17, 2008 at 4:44 PM, Bruce Vining wrote:

If your terminal is named TERMA then use DSPDEVD TERMA and record what is
shown for the Character identifier. I'm expecting it to be 697 37 which
means you are using a US keyboard but telling the job to run in German.

If your RPG *DSPF is named DSPFA then use DSPFD DSPFA and record what is
shown for Character identifier. I'm expecting it to be *DEVD which means
you are telling the system to not convert any character data from/to the
display device when reading/writing from the job (your RPG program running
in German).

This combination means you are entering CCSID 37 data (TERMA definition),
telling the system to leave any data entered as is (DSPFA definition), and
telling the RPG program that the data is in German (Job CCSID). This will
not work the way you want it to, but will result in the "incorrect" (from
your point of view) character being displayed.

To really test your program you need to use a German display device.
Hopefully you are using a PC as your terminal. If so, most emulators allow
you to change the CCSID quite easily. After you change the emulator, then
make sure the *DEVD on the system reflects the changed CCSID. It may or may
not depending on your system configuration. The *DEVD and emulator settings
do however need to match.

After this you should be up and running.

Bruce

Ashish Kulkarni wrote:
Hi

What i did was wrote an RPGLE program which accepts one input string as
email address and then validates it,

I then changed to current job CCSID to 273 and ran the program, i got § as
input,

My system CCSID is 37 ( i hope that is what is meant by *DEVD CCSID, it is
the system CCSID)

How do i find out my terminal CCSID or *DEVD

Nice, enjoy Las Vegas

Ash

On Fri, Oct 17, 2008 at 3:23 PM, Bruce Vining wrote:

You need to describe in more detail how you are performing your test.

If, for example, you simply did a CHGJOB CCSID(273) and then entered a @
at a CCSID 37 terminal using a *DSPF with CHRID(*DEVD) then you would, in
debug, see a §.

You would also get the same § if you had your job in 37, the device was
in
273, and the *DSPF was CHRID(*DEVD).

If you have the job in 273 and the device in 273 then you should get @.

What is your job CCSID?
What is your *DEVD CCSID (CHRID)?
What CCSID is the display device configured to be using?
What is your *DSPF CHRID setting? (the default is *DEVD, which is
essentially 65535 -- no conversion between the job and the device)

Bruce (who is off to Las Vegas and the RPG/DB2 Summit shortly)

Ashish Kulkarni wrote:
Hi

I did used

eval At_Sign = u'0040'

in my RPG code and i get @ sign no matter what the CCSID is (did not try
with 65535 as most of our systems are set not to use this)

But i have another issue now, i ask the user to enter the email address
in
a
screen as input,

But if the CCSID is not 37 then i get different value for @ sign in my
RPGLE
program.

For example if i set CCSID as 273 then i get § instead of @ sign, even if
the user enters @ sign

So how do i convert this input value to @ sign for validation and then
inserting in database

Ashish

On Fri, Oct 17, 2008 at 1:54 PM, Bruce Vining wrote:

This Bruce V. does NOT agree ;)

The system will take care of the conversion IF the job CCSID is NOT
65535.
But if the job CCSID is 65535 then no conversion will occur.

Using the Unicode to Character approach I proposed in an earlier append
the conversion will take place in either case. If the job CCSID is not
65535 you'll get At_Sign in the job CCSID. If the job CCSID is 65535
you'll
get At_Sign in the job default CCSID. Since the job default CCSID will
always match the job CCSID (except for the 65535 case) this means
you'll
always get At_Sign in the "most likely correct" CCSID.

This is not true when using database conversion support.

Bruce Vining
Bruce Vining Services

Vern Hamberg wrote:
One technique is to put literals like the @ sign into a CCSID-tagged
field in a PF - it can even be tagged with 37. Then when it is brought
into your program, the system takes care of converting to the right
thing.

That's what a support guy at IBM said, and Bruce V. seemed to agree.

Vern

Takken, Cor wrote:
You don't want to check an email address only by the presence of the
@-sign. A much better idea is to check it using regular expressions.
This will not remove the limitation of the CCSID, however there must
be
a way to represent the string to check in unicode or the likes.

Just my incomplete 2 cents,

Cor


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-
bounces@xxxxxxxxxxxx] On Behalf Of Ashish Kulkarni
Sent: vrijdag 17 oktober 2008 13:25
To: RPG programming on the AS400 / iSeries
Subject: Validate Email address in RPGLE

HiDoes anyone have sample of validating email address in RPGLE

program,

For example in RPGLE i can write
'@':1 Scan $1SeMail @Pos
If @Pos = 0
//process error here
endif

But this code will only work if CCSID is 37, as @ will be valid only
for
CCSID 37, but what is CCSID is different.
How do i check for the character,
Does anyone have any idea or sample code to do so

Ash
--
This is the RPG programming on the AS400 / iSeries (RPG400-L)
mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be
copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.



--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




Bruce
Bruce Vining Services
507-206-4178
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




Bruce
Bruce Vining Services
507-206-4178
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




Bruce
Bruce Vining Services
507-206-4178
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.