IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SPACES are getting changed to NULL in DB2


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ezhil Murugan

New User


Joined: 10 Jul 2008
Posts: 14
Location: Chennai

PostPosted: Tue Nov 25, 2008 3:59 pm
Reply with quote

Hi,

My application has a web front end and Mainframe Cobol module accessing DB2 in the backend. Email id is a field in the web and it gets stored in the Db2 tables. I could see that for one or 2 rows , emailid gets changed from SPACES to low-values when Web users do some transactions in the front end. This is happening even when the user does no changes in the Email field. I could see that the initializations are properly done for t he variables used for email. I tested similar transactions but the issue did not happen. Any idea what might be the reason it's happening for web users' transactions?
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Tue Nov 25, 2008 4:59 pm
Reply with quote

How is the EMAIL ID field declared with in the DB2 table?
Back to top
View user's profile Send private message
Ezhil Murugan

New User


Joined: 10 Jul 2008
Posts: 14
Location: Chennai

PostPosted: Tue Nov 25, 2008 5:59 pm
Reply with quote

Hi ,

It's EMAIL_TXT CHAR(45)
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Nov 25, 2008 6:19 pm
Reply with quote

your could define a trigger to the table that contains the email-id column and fire off an error when an attempt is made to change email-id column from spaces to low-values.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Nov 25, 2008 11:58 pm
Reply with quote

Hello,

Sounds like the problem is the front end code. When the user does not enter a value, the web app does not force spaces into the field. Suggest the web app be changed to force spaces when no data is entered.

Depending on how many people following how many differnt coding conventions wrote the "user" presentation code, there may be multiple pieces of presentation code that need to be changed. There may also be some that work as needed.
Back to top
View user's profile Send private message
atosvv

New User


Joined: 04 Dec 2008
Posts: 11
Location: Mumbai

PostPosted: Fri Dec 05, 2008 11:55 am
Reply with quote

Hi Ezhil,

Please have an input field control check in COBOL Service Program.
IF IN-EMAIL-TXT = LOW-VALUES
MOVE SPACES TO WW-EMAIL-TXT
ELSE
MOVE IN-EMAIL-TXT TO WW-EMAIL-TXT
END-IF
Use the WW-EMAIL-TXT while updating or inserting in to the table.
Note:- IN-EMAIL-TXT is the input field which contains the value which has sent by WEB. Declare WW-EMAIL-TXT in Working Storage Section with the size as same as IN-EMAIL-TXT.

While sending data from MF to WEB, have a control check.
Assume OUT-EMAIL-TXT contains the value retrieved from the table.
IF OUT-EMAIL-TXT = LOW-VALUES
MOVE SPACES TO OUT-EMAIL-TXT
END-IF.

Whatever WEB sends a valid value to MF, Even though MF Program has to have a control check on each and every input field.

-VV
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Cobol program with sequence number ra... COBOL Programming 5
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
No new posts To Remove spaces (which is in hex for... JCL & VSAM 10
Search our Forums:

Back to Top