Subtracting TOD-CLOCK values to get duration.

2007-09-03 Thread Ludmila Koganer
Hi,
I  need to subtract two TOD times to find elapsed time. Currently I convert 
the two TOD times with STCKCONV and determine the elaped time individually, 
and then compute the difference. This works. However I thought I could 
optimize the conversion, a little bit and I was wondering why not subtract the 
two TOD times to begin with.

As I understand TOD time is the number of mic seconds elapsed since midnight 
of 1900-01-01. So when I subtract one TOD value from another the duration 
must be in micro seconds.
For example, TOD1 is X'C0E608EF7409002E'  ===>2007196, 16.59.58,745744
  TOD2 is X'C1E608EF7409002E'  > 2008035, 7.43.04.790160

If I subtract the two TOD values, it is binary as in (x'0100'). If 
I 
convert to a packed decimal value, I get a decimal value of  
72057594037927936. (sign bit not shown here)

Now I can't seem to figure the actual elapsed time based on the derived micro 
seconds. If I just treat the above value as a mic seconds then I end up with 
2284.93 years which is gloriously incorrect while the actual elapsed days are 
204 days ignoring the time part.

I am sure I am missing something here. Can someone please help. 

Regards,
Ludmil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: Calling a AMODE 31 program from AMODE 64

2007-09-04 Thread Ludmila Koganer
I didn't expect that it would trigger so much response. I am just beginning
to learn to code using AMODE 64 and the example I had initially presented
doesn't necessarily   represent any real program. What I wanted to do was to
call a AMODE31 from AMODE64 and the list did provide too many thoughts /
suggestions.
Thanks.
Ludmil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Calling a AMODE 31 program from AMODE 64

2007-08-22 Thread Ludmila Koganer
Can someone please provide me a sample of how to call a AMODE 31 program
(ASM) from a AMODE 64 program (ASM) and pass parameters and get return values.

I am able to BASR to AMODE 31 and execute it but unable to use R1 for
passing parm address. I get a protection exception.

Thanks,
Ludmila

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: Calling a AMODE 31 program from AMODE 64

2007-08-22 Thread Ludmila Koganer
Thanks for the quick response.
OK here is my code.
I have two simple starter programs, PGM64A in AMODE 64 and PGM A in AMODE 31
I need to pass a field CRITDTE to PGMA and return a return value from PGMA.
The code is below.
PGM64A CSECT
PGM64A AMODE 64
PGM64A RMODE 31
BAKR   14,0
LARL13,SAVEAREA
LARL12,PGM64A
USING  PGM64A,12
LGHI15,0
LLGF1,CRITDTE
LLGT15,=V(PGMA)
SAM31
BASR14,15
PR,

CRITDTE  DS CL8
SAVEAREA   DS 0D'0',F'0',C'F1SA'

LTORG
ENDPGM64A.

I can BASR to PGMA no problem. Every time I try to modify the inbound parm,
I get S0C4 / Reson 11. I am not sure where I am coding incorrectly.
Following a few other posts I tried difft combinations of Loaing parm
including LA, LLGT but it is not working. Since if I don't alter the inbound
block  it runs, I am making some glorious mistake on passing the parm. I
cant seem to figure out,.



pgmA is a vsery simple subroutine that only has a 
L3,0(1)
LA   5,UPDTXT
MVC  0(7,3),0(5) ===>Receive inbound value in Reg 3 and update with
the value in updtxt
besides the std prolog and epilog.

Regards,
Ludmil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html