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

Display Date Field


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rahuindo

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Wed Oct 06, 2010 1:20 am
Reply with quote

Hi,
I have the following requirement:
Display the date in the format MM/DD/CCYY.
The Map Field has a length of 10 bytes.
The same map will be used for View and Change.
For view, this field will be protected and for Change it will be unprotected.

During Change, the '/' should be always protected and user should be able to tab from Month to Date and to year.
Now, I have usually displayed the Date fields as follows:
MM / DD / CCYY which is 14 bytes and never as MM/DD/CCYY.
This is my problem.
Also, I cannot increase the lenght of the field due to restrictions on the map.

The other option I have is to display the date during Change as follows:
MM DD CCYY

But this will not meet the requirement during View as the date will not be populated with '/'.
Is there any solution? Or am I sounding confused icon_lol.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Oct 06, 2010 1:40 am
Reply with quote

Quote:
During Change, the '/' should be always protected and user should be able to tab from Month to Date and to year.

the approach is just plain wrong...
You cannot have in this case a single field but 5 of them
3 for the input fields 2 for the separating slashes
Back to top
View user's profile Send private message
rahuindo

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Wed Oct 06, 2010 1:51 am
Reply with quote

Hi Enrico,
You are right. We will need 5 fields and also the 5 fields cannot settle in the 10-byte field.
Hence, the approach I think is to display the date without slashes "09 30 2010" whenever the field has to be unprotected but display as "09/30/2010" when protected.
So, this would mean to define 3 fields in the map(A,b and C) when the date has to be unprotected and 1 field (D) when the has to be protected. Both fields have to be defined at same position of the map.
But the problems come when we are setting the attributes of the map.
I am not sure if there is a way by which we can suppress (i.e. do not display) the field D when A, B and C have to be displayed and vice-versa.
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: Wed Oct 06, 2010 1:59 am
Reply with quote

Hello,

Use the same field definition for both cases.

When the field is unprotected, the code must make sure the date input is valid.

If you really want to be helpful to the user, you allow mmddccyy or mm/dd/ccyy or or mm dd ccyy when a date is modified. Even if it is presented to the user as mm/dd/ccyy. It is a tiny bit of code and the date must be validated anyway . . .
Back to top
View user's profile Send private message
rahuindo

New User


Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Wed Oct 06, 2010 2:11 am
Reply with quote

Hi Dick,
I agree with your approach and had given a thought about it. I have kept this as the last option in case I do not find anything else.
Thanks!!
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
Search our Forums:

Back to Top