Skip to main content

Date Setting in Enterprize Server

  • November 12, 2015
  • 3 replies
  • 0 views

How can I change date in my Enterprize Server so that my COBOL program can pick up the date with ACCEPT command? Right now I change my windows date.

I need this because during testing, I need to test few jobs with a particular current date.


#EnterpriseServer

3 replies

  • Author
  • Rocketeer
  • 19312 replies
  • November 12, 2015

How can I change date in my Enterprize Server so that my COBOL program can pick up the date with ACCEPT command? Right now I change my windows date.

I need this because during testing, I need to test few jobs with a particular current date.


#EnterpriseServer

Hi,

Well to perform this you need to prepare it in several steps :

#1 : identify a new VARIABLE that point to an external file in which the desired date will be stored split in 3 parts (YEAR, MONTH, DAY) g.e

FORCE_YEAR=YYYY

FORCE_MONTH=MM

FORCE_DAY=DD

This New VARIABLE should be declared in the CICS you want to change the date.

#2 Create a new COBOL program that will read the external file to get the desired date.

In the COBOL program prepare the date in YY/MM/DD and YYYY/MM/DD format using two host variables

If the reading of external file succeeded, then apply the new date by invoking CICS EXEC :

EXEC CICS ASKTIME ABSTIME(WABS)  END-EXEC

EXEC CICS FORMATTIME ABSTIME(WABS)  YYMMDD(host variable 1) "/" END-EXEC

EXEC CICS FORMATTIME ABS(WABS)  YYYYMMDD(host variable 2) "/" END-EXEC.

#3 connect to the CICS with TN3270 and run the new COBOL program to force the date to change.

Regards.

Megamoks


  • Author
  • Rocketeer
  • 19312 replies
  • November 12, 2015

How can I change date in my Enterprize Server so that my COBOL program can pick up the date with ACCEPT command? Right now I change my windows date.

I need this because during testing, I need to test few jobs with a particular current date.


#EnterpriseServer

I want to do this in a batch program. I am hoping there is some option in Enterprize Server.


  • Author
  • Rocketeer
  • 19312 replies
  • November 12, 2015

How can I change date in my Enterprize Server so that my COBOL program can pick up the date with ACCEPT command? Right now I change my windows date.

I need this because during testing, I need to test few jobs with a particular current date.


#EnterpriseServer

Well , it is very tricky to do this in a batch program. The only way is to set the new date in cobrts.cfg

with this VARIABLES name :

CURRENT_YEAR=YYYY

CURRENT_MONTH=MM

CURRENT_DAY=DD

But be careful, you will get some other side effects.

Regards.

Megamoks