View previous topic :: View next topic
|
Author |
Message |
SowmyaRukmani
New User
Joined: 17 Jan 2010 Posts: 2 Location: Chennai
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
SowmyaRukmani
New User
Joined: 17 Jan 2010 Posts: 2 Location: Chennai
|
|
|
|
So, this cant be done at all?? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
|