Validating a numeric 'monetary' BMS field



Support for CICS/ESA, CICS/TS & Transaction Gateway, CICS Configuration Manager and CICS Performance Analyzer

Validating a numeric 'monetary' BMS field

Postby David Jackson » Mon Jan 31, 2011 12:56 am

Been away from CICS for a few years, so apologies for what is a basic question.
I have a BMS field defined as follows:
DEPAMT DFHMDF POS=(6,25),LENGTH=8,ATTRB=(UNPROT,NUM)
Note this is a CL8 field with NUM set - NUM implies JUSTIFY RIGHT and ZEROS but does not stop the user from entering 'Shifted' garbage if he so chooses. So the field still has to be validated.
The MAP is being RECEIVED by an ASM program.
Within the ASM program, I have written a small routine that validates each byte for x'F0'-'F9' validity, checks for the presence of a decimal point x'4B' and it being in the correct place (based on the number of permitted decimal places etc and of course that only one decimal point be present etc etc and if valid, removes the decimal point (if present) and PACKS the resultant field into a PL5.

Is there a more 'elegant' way of handling a numeric 'monetary' amount validation of a BMS field from an ASM program - these days - or is a homegrown routine still the way to go?
User avatar
David Jackson
 
Posts: 10
Joined: Wed Jan 26, 2011 5:09 am
Location: California
Has thanked: 0 time
Been thanked: 0 time

Re: Validating a numeric 'monetary' BMS field

 

Re: Validating a numeric 'monetary' BMS field

Postby dick scherrer » Mon Jan 31, 2011 2:14 am

Hello,

As far as i know there is no automagic validator for assembler - one must still "roll one's own".

Having said that, the places i've been that use assembler for "business" code (rather than system/utility code) have various "edit" routines that are invoked when needed. These include editing dates, money, plain numeric, etc and have been standard at these places for many years.

So the code is not re-written for each edit needed, but invoked and returns an indicator of good/why bad and if valid the value in a proper format for use within the code. Depending on how much of this you are going to do, you may want to create these if they are not already available.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6308
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 90 times

Re: Validating a numeric 'monetary' BMS field

Postby David Jackson » Mon Jan 31, 2011 2:46 am

Yes thanks. I agree most of these routines should pre-exist in most shops.
I wasn't sure if anything was available "canned" these days that removed the need for inhouse stuff for for CICS/ASM programs.

Cheers
User avatar
David Jackson
 
Posts: 10
Joined: Wed Jan 26, 2011 5:09 am
Location: California
Has thanked: 0 time
Been thanked: 0 time


Return to CICS

 


  • Related topics
    Replies
    Views
    Last post