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

ACCEPT current date in the format YYYYMMDD in COBOL II


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
SowmyaRukmani

New User


Joined: 17 Jan 2010
Posts: 2
Location: Chennai

PostPosted: Fri May 14, 2010 3:41 pm
Reply with quote

Hi all,

I need to accept current date in the format YYYYMMDD.

i tried using ACCEPT <identifier> from DATE YYYYMMDD.

I also tried using MOVE FUNCTION CURRENT-DATE TO W01-CURRENT-DATE.

it gave me an error FUNCTION Is not defined as a dataname.

Pls help me to get date in YYYYMMDD format.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri May 14, 2010 4:06 pm
Reply with quote

Well, first you should look at the COBOL II manual,
where you will see that what you want, can not be done.

but, with System Information Transfer you can obtain the DATE which has the implicit PICTURE 9(6).

most shops that are still using outdated cobol compilers get around the problem by determining the century on a
YY = 00>50 = 20
YY = 51>99 = 19
Back to top
View user's profile Send private message
SowmyaRukmani

New User


Joined: 17 Jan 2010
Posts: 2
Location: Chennai

PostPosted: Fri May 14, 2010 4:53 pm
Reply with quote

So, this cant be done at all??
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri May 14, 2010 5:00 pm
Reply with quote

SowmyaRukmani wrote:
So, this cant be done at all??


*sigh*

I showed you how you can interpolate the results of a cobol II accept date
in order to derive a YYYYMMDD.

TGIF
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri May 14, 2010 5:08 pm
Reply with quote

Check with your system personnel to determine whether Language Environment is optionally installed in your LPAR.

If true, then you can obtain the current-date with a format of "CCYYMMDD/YYYYMMDD", via the LE Callable Service routine "CEELOCT".

COBOL FUNCTIONS were not introduced until COBOL/370, which was the successor to COBOL II.

Bill
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Fri May 14, 2010 5:13 pm
Reply with quote

VS COBOL II does not support a 4-digit year in its date formats. So under VS COBOL II what you want cannot be done. Considering VS COBOL II was withdrawn from marketing in June 1997 and service stopped in March 2001, there's not much that can be done about that.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri May 14, 2010 8:16 pm
Reply with quote

I thought that IBM had offered a non-LE Callable routine for COBOL II/Y2K, but couldn't recall the name. However, after some research, the swatting of flies and the moving of cob webs, here it is (IGZEDT4), along with a syntax example -

Code:

03  WS-DATE-CCYYMMDD PIC  9(08).
03  WS-IGZEDT4       PIC  X(08) VALUE 'IGZEDT4'.
*
CALL WS-IGZEDT4      USING WS-DATE-CCYYMMDD.

This routine was delivered as part of an APAR (unknown) and you need to verify with your system's personnel that it's in your COBOL II Run Time Library(s).

You should use this routine in Batch only, because it may (under the covers), issue an SVC.

For CICS, use a combination of the ASKTIME ABSTIME and FORMATTIME API's.

Bill
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts Need help with ADABAS query (COBOL-AD... All Other Mainframe Topics 0
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
No new posts Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
No new posts Sorting Date Field DFSORT/ICETOOL 4
Search our Forums:

Back to Top