View previous topic :: View next topic
|
Author |
Message |
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
I know there is a CICS DELAY function which can let the program suspend for a specified time, but I want this function in COBOL program which is not supposed to be run in CICS region.
I looked into COBOL manual, but no result found.
Can u suggest a better way to realise this?
thanks. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
the better way would be not to do it at all,
the operations team would not be glad to see an initiator hanging around doing nothing . |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why do you want your program to "wait" (locking-up resources)? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
here is a copy of the asm module I used 10 years ago
Code: |
ASMSUSP TITLE 'WAIT FOR SPECIFIC TIME PERIOD'
SPACE 3
PRINT GEN
*********************************************************
* USED MACROS FOR LE COMPATIBILTY:
* CEEENTRY
* CEETERM
* CEEPPA
* CEECAA
* CEEDSA
*
* CALLED MVS SERVICES:
* ----- --------------
* BPX1SLP THE SLEEP CALLABLE SERVICE SUSPENDS RUNNING
* OF THE CALLING THREAD (PROCESS) UNTIL THE NUMBER OF
* SECONDS SPECIFIED BY THE PARAMETER SECOND
* HAS ELAPSED, OR UNTIL A SIGNAL IS DELIVERED
* TO THE CALLING THREAD TO INVOKE A SIGNAL-CATCHING
* FUNCTION OR END THE THREAD.
*
*
* INPUT PARAMETER:
* ----- -------------- ---------------
* SLEEPT SLEEP TIME IN SECONDS F / PIC S9(9) BINARY
*
* OUTPUT PARAMETER:
* ----- -------------- ---------------
* RETVAL IF TIMER ELAPSED PRIOR TO F / PIC S9(9) BINARY
* REQUSTED; OTHERWISE 0
*
* SAMPLE CALL FROM COBOL FOR 5 SECONDS:
* COMPUTE SLEEPT = 5
* CALL ASMSUSP
* USING SLEEPT
* , RETVAL
* END-CALL
*
R1 EQU 1 ADRESSLIST
R3 EQU 3 WORK REGISTERER
RBASE EQU 11 BASE REGISTER
R14 EQU 14 RETURN TO CALLER
R15 EQU 15
DFA002 CEEENTRY MAIN=NO,NAB=NO,BASE=RBASE,AUTO=SLDSAL
*
MVC PARMLIST(PARMLL),0(R1) ADDRESS PARAMETER LIST
L R3,SLTADDR
MVC SLEEPT,0(R3)
*
CALL BPX1SLP,(SLEEPT,RETVAL)
L R3,RETADDR
MVC 0(L'RETVAL,R3),RETVAL
CEETERM , RETURN TO CALLER
SLEEPT DS F
RETVAL DS F
LTORG
PPA CEEPPA ,VER=03,REL=01,MOD=00 PROGRAMM PROLOG AREA
SPACE 3 ------------------------------
CEECAA , MAPPING OF COMMON ANCHOR AREA
CEEDSA , MAPPING FOR DYNAMIC SAVE AREA
**** VARIABLES **************************************
PARMLIST DS 2A
ORG PARMLIST
SLTADDR DS A
RETADDR DS A
ORG
PARMLL EQU *-PARMLIST
SLDSAL EQU *-CEEDSA
*
END
|
have not done asm for 10 years,
so if any of the asm guys see a problem,
please post any changes that may be needed.
thx |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
Thanks, Dick,
I examined <Language Environment reference> and found callable service CEEDLYM might do this.
I'm testing on CEEDLYM. if it works, I want to use it. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
NO - You DO NOT want to use it.
You are trying to get around a poor design issue by using a worse solution.
Somethin you (and many others) need to learn is that just because a "thing" can be done - often it SHOULD NOT be done.
As i have mentioned before, you are creating a nightmare. . . Both for running and subsequent maintenance. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Dejunzhu said -
Quote: |
but I want this function in COBOL program which is not supposed to be run in CICS region. |
You should be able to isolate this function by comparing the valid APPLID's (where this function can be run) with the current APPLID and take action. To obtain the APPLID of the current region, issue the CICS ASSIGN API.
Issuing a DELAY in CICS is not good programming practice and you need to consider an alternative, such as, writing a TDQ message to CSMT/CSSL (include, amongst other fields, the USERID from the ASSIGN API), issuing a WRITE OPERATOR message (optional, check with operations first) and terminating the task. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Bill,
I believe this is so some batch job can hang aroung "waiting" . . .
d |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Dick,
So, this might be a Client/Server arrangement?
This should be easy enough to determine by checking all the valid target APPLID's in the Client program and bypass linking to the Server program.
If he's using a DPL to the Server program in the target region, the target APPLID is a required keyword/value.
Sometimes, he doesn't make things too clear or maybe it's me, slowly losing it in my older years? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Bill,
From what i can tell (there have been many posts that reflect that the design is terribly flawed), this is an attempt to get around having locking/timeout issues between batch and online.
I'd shudder to guess what will happen if another layer (c/s) is implemented with no expertise also . . .
d |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
An alternate approach which worked out fine in my case
what you could do is execute stuff when the db2 resources are available so before you runn your program you could have a step doing -DIS with the output you can proceed doing different things
Experts will that do any good? |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
hi, experts,
below is what I want to do :
when mode is changed from online to batch, the first thing is to wait online process complete, and then take copy against master tables.
so, how to determine if all transaction has been completed? there is a table , let's say, transaction status table. When a transaction start, it will register in the table, and record the status as 'IN PROCESS', when the transaction ends, it will update the record in the status table to 'SUCCESS' or 'FAILED'.
so, I have to check the status all the time, untill there is no more transaction that is in 'IN PROCESS' status. To do this, when I check it and determined not all transactions have completed, I have to wait for some seconds and check it again. During this wait process, I have to hang on the check-program. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
what a horrible waste of time and resource..
the topic is going down the path ... how to write Your own scheduling system
or better towards utter stupidity, like many of the topics from the same TS
it might be locked very shortly |
|
Back to top |
|
|
|