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
 

 

ACCEPT current date in the format YYYYMMDD in COBOL II

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: ACCEPT current date in the format YYYYMMDD in COBOL II
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    Post subject:
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    Post subject: Reply to: ACCEPT current date in the format YYYYMMDD in COBO
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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri May 14, 2010 5:08 pm    Post subject: Reply to: ACCEPT current date in the format YYYYMMDD in COBO
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: 7931
Location: Bellevue, IA

PostPosted: Fri May 14, 2010 5:13 pm    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri May 14, 2010 8:16 pm    Post subject: Reply to: ACCEPT current date in the format YYYYMMDD in COBO
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am


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