Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SPACES are getting changed to NULL in DB2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: SPACES are getting changed to NULL in DB2
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    Post subject:
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    Post subject: Reply to: SPACES are getting changed to NULL in DB2
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: 6967
Location: porcelain throne

PostPosted: Tue Nov 25, 2008 6:19 pm    Post subject:
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

Site Director


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

PostPosted: Tue Nov 25, 2008 11:58 pm    Post subject:
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    Post subject: Reply to: SPACES are getting changed to NULL in DB2
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us