Discussion:
This program has no errors, but prints nothing
gmella2030
2012-02-09 01:40:42 UTC
Permalink
Hello!

Can some of the ASM gurus here tell me what's wrong with this program that prints nothing even though it assembles, link edit and execute with no errors? I tried everything I know, but I don't know why it doesn't print the answer which is "sub1 called" I suspect the JCL is the culprit, but it looks all right to me :(

//EDIT JOB (001) ,MELLA, CLASS=A, MSGLEVEL=(2,0)
//STEP1 EXEC ASMFC,PARM=(NODECK,LOAD)
//ASM.SYSGO DD DSN=&LOADSET,UNIT=SYSSQ,SPACE=(80,(100,50)),
// DISP=(MOD,PASS)
//ASM.SYSIN DD *
PRINT NOGEN
CSECT
EDIT STM 14,12,12(13)
BALR 12,0
USING *,12
**********SAVE REGISTERS****************************
LR 4,13
LA 13,SAVE
B OVER
SAVE DS 18F
OVER ST 13,8(4)
ST 4,4(13)
********************************************************
OPEN (PRINTER,(OUTPUT))
LA 1,ADDRLIST
L 15,ADDRSUB1
BALR 14,15
MVC OUT(1),=C' '
MVC OUT+1(132),OUT
MVC OUT+10(10),MSG
PUT PRINTER,OUT
*
* PRINT 'END OF PROCESSING'
MVC OUT(1),=C' '
MVC OUT+1(132),OUT
MVC OUT+10(17),LINE
PUT PRINTER,OUT
*
CLOSE (PRINTER,LEAVE)
*
*************RELOAD ORIGINAL VALUES IN REGISTERS*********************
L 13,4(13)
LM 14,12,12(13)
BR 14
********************************************************
ADDRSUB1 DC V(SUB1)
ADDRLIST DC A(MSG)
MSG DS CL10
*
*
* PRINTER AREA
OUT DS CL133
LINE DC C'END OF PROCESSING'
PRINTER DCB BLKSIZE=133,DDNAME=OUTDATA,DEVD=DA,LRECL=133,MACRF=PM, X
OPTCD=U,RECFM=FA,DSORG=PS
END
// EXEC ASMFCLG
//ASM.SYSIN DD *
SUB1 START 0
STM 14,12,12(13)
BALR 12,0
USING *,12
MVC 0(11,1),=C'SUB1 CALLED'
LM 14,12,12(13)
BR 14
END
//GO.OUTDATA DD SYSOUT=A
//
somitcw
2012-02-09 02:04:18 UTC
Permalink
Post by gmella2030
Hello!
Can some of the ASM gurus here tell me what's wrong
with this program that prints nothing even though it
assembles, link edit and execute with no errors?
I tried everything I know, but I don't know why it
doesn't print the answer which is "sub1 called"
I suspect the JCL is the culprit, but it looks all
right to me :(
//EDIT JOB (001) ,MELLA, CLASS=A, MSGLEVEL=(2,0)
//STEP1 EXEC ASMFC,PARM=(NODECK,LOAD)
//ASM.SYSGO DD DSN=&LOADSET,UNIT=SYSSQ,SPACE=(80,(100,50)),
// DISP=(MOD,PASS)
//ASM.SYSIN DD *
PRINT NOGEN
CSECT
EDIT STM 14,12,12(13)
BALR 12,0
USING *,12
**********SAVE REGISTERS****************************
LR 4,13
LA 13,SAVE
Code is not reentrant.
Post by gmella2030
B OVER
SAVE DS 18F
OVER ST 13,8(4)
ST 4,4(13)
********************************************************
OPEN (PRINTER,(OUTPUT))
LA 1,ADDRLIST
L 15,ADDRSUB1
BALR 14,15
MVC OUT(1),=C' '
MVC OUT+1(132),OUT
MVC OUT+10(10),MSG
PUT PRINTER,OUT
*
* PRINT 'END OF PROCESSING'
MVC OUT(1),=C' '
MVC OUT+1(132),OUT
MVC OUT+10(17),LINE
PUT PRINTER,OUT
*
CLOSE (PRINTER,LEAVE)
*
*************RELOAD ORIGINAL VALUES IN
REGISTERS*********************
L 13,4(13)
LM 14,12,12(13)
BR 14
********************************************************
ADDRSUB1 DC V(SUB1)
ADDRLIST DC A(MSG)
MSG DS CL10
*
*
* PRINTER AREA
OUT DS CL133
LINE DC C'END OF PROCESSING'
PRINTER DCB
BLKSIZE=133,DDNAME=OUTDATA,DEVD=DA,LRECL=133,MACRF=PM, X
OPTCD=U,RECFM=FA,DSORG=PS
The last line of the PRINTER DCB does not start in
column 16.
Post by gmella2030
END
// EXEC ASMFCLG
//ASM.SYSIN DD *
SUB1 START 0
STM 14,12,12(13)
BALR 12,0
USING *,12
MVC 0(11,1),=C'SUB1 CALLED'
Register 1 does not have the address of "MSG".
It has the address of "ADDRLIST" which has the
address of MSG.

Before the MVC, you need to add: L 1,0(,1)
Post by gmella2030
LM 14,12,12(13)
BR 14
END
//GO.OUTDATA DD SYSOUT=A
Should be SYSOUT=*
Post by gmella2030
//
scott
2012-02-09 02:09:31 UTC
Permalink
Post by gmella2030
Hello!
Can some of the ASM gurus here tell me what's wrong with this program that prints nothing even though it assembles, link edit and execute with no errors? I tried everything I know, but I don't know why it doesn't print the answer which is "sub1 called" I suspect the JCL is the culprit, but it looks all right to me :(
//EDIT JOB (001) ,MELLA, CLASS=A, MSGLEVEL=(2,0)
//STEP1 EXEC ASMFC,PARM=(NODECK,LOAD)
//ASM.SYSGO DD DSN=&LOADSET,UNIT=SYSSQ,SPACE=(80,(100,50)),
// DISP=(MOD,PASS)
//ASM.SYSIN DD *
PRINT NOGEN
CSECT
EDIT STM 14,12,12(13)
BALR 12,0
USING *,12
**********SAVE REGISTERS****************************
LR 4,13
LA 13,SAVE
B OVER
SAVE DS 18F
OVER ST 13,8(4)
ST 4,4(13)
********************************************************
OPEN (PRINTER,(OUTPUT))
LA 1,ADDRLIST
L 15,ADDRSUB1
BALR 14,15
MVC OUT(1),=C' '
MVC OUT+1(132),OUT
MVC OUT+10(10),MSG
PUT PRINTER,OUT
*
* PRINT 'END OF PROCESSING'
MVC OUT(1),=C' '
MVC OUT+1(132),OUT
MVC OUT+10(17),LINE
PUT PRINTER,OUT
*
CLOSE (PRINTER,LEAVE)
*
*************RELOAD ORIGINAL VALUES IN REGISTERS*********************
L 13,4(13)
LM 14,12,12(13)
BR 14
********************************************************
ADDRSUB1 DC V(SUB1)
ADDRLIST DC A(MSG)
MSG DS CL10
*
*
* PRINTER AREA
OUT DS CL133
LINE DC C'END OF PROCESSING'
PRINTER DCB BLKSIZE=133,DDNAME=OUTDATA,DEVD=DA,LRECL=133,MACRF=PM, X
OPTCD=U,RECFM=FA,DSORG=PS
END
// EXEC ASMFCLG
//ASM.SYSIN DD *
SUB1 START 0
STM 14,12,12(13)
BALR 12,0
USING *,12
MVC 0(11,1),=C'SUB1 CALLED'
LM 14,12,12(13)
BR 14
END
//GO.OUTDATA DD SYSOUT=A
//
Get rid of devd=da, and optcd=u, for starters. On the close
(printer,leave) change it to close printer. If this is running on a
non-production system, use wto's to trace. You can also use the snap
macro to periodically take snap dumps.
somitcw
2012-02-09 02:27:47 UTC
Permalink
Post by gmella2030
Hello!
Can some of the ASM gurus here tell me what's wrong
with this program that prints nothing even though it
assembles, link edit and execute with no errors?
I tried everything I know, but I don't know why it
doesn't print the answer which is "sub1 called"
I suspect the JCL is the culprit, but it looks all
right to me :(
//EDIT JOB (001) ,MELLA, CLASS=A, MSGLEVEL=(2,0)
//STEP1 EXEC ASMFC,PARM=(NODECK,LOAD)
//ASM.SYSGO DD DSN=&LOADSET,UNIT=SYSSQ,SPACE=(80,(100,50)),
// DISP=(MOD,PASS)
- - - remainder snipped - - -

Does ASMFCLG expect DSN=&LOADSET or DSN=&&OBJSET ?
Did you check the linkedit list to insure that the
main program even linked?
halfmeg
2012-02-10 02:15:10 UTC
Permalink
Post by somitcw
Post by gmella2030
Hello!
Can some of the ASM gurus here tell me what's wrong
with this program that prints nothing even though it
assembles, link edit and execute with no errors?
I tried everything I know, but I don't know why it
doesn't print the answer which is "sub1 called"
I suspect the JCL is the culprit, but it looks all
right to me :(
//EDIT JOB (001) ,MELLA, CLASS=A, MSGLEVEL=(2,0)
//STEP1 EXEC ASMFC,PARM=(NODECK,LOAD)
//ASM.SYSGO DD DSN=&LOADSET,UNIT=SYSSQ,SPACE=(80,(100,50)),
// DISP=(MOD,PASS)
- - - remainder snipped - - -
Does ASMFCLG expect DSN=&LOADSET or DSN=&&OBJSET ?
Did you check the linkedit list to insure that the
main program even linked?
As you mentioned in a prior post the 2nd line of the PRINTER DCB DD statement was off. Yahoo may have mangled but if not the assembly would have gotten:

EDIT STEP1 ASM IFOX00 RC= 0012

due to mnotes because of the out of place 2nd line:

62 PRINTER DCB BLKSIZE=133,DDNAME=OUTDATA,DEVD=DA,LRECL=133,MACRF=PM, X
OPTCD=U,RECFM=FA,DSORG=PS
63+ 12,*** IHB052 DSORG OMITTED
64+ 12,*** IHB066 INCONSISTENT OPERAND

...

STMT ERROR CODE MESSAGE ASM 0201 02.30 02/10/12

63 IFO197 *** MNOTE ***
64 IFO197 *** MNOTE ***

NUMBER OF STATEMENTS FLAGGED IN THIS ASSEMBLY = 2
HIGHEST SEVERITY WAS 12

Fixing the 2nd line gets rid of the bad assembly but produces no expected output due to missing main program in the LINK.

NAME ORIGIN LENGTH NAME LOCATION NAME LOCATION NAME LOCATION NAME LOCATION
SUB1 00 23


ENTRY ADDRESS 00

TOTAL LENGTH 28
****GO DOES NOT EXIST BUT HAS BEEN ADDED TO DATA SET

This is caused by use of 2 assembly procs without passing the output of the 1st to be included in the LINK step of the 2nd.

Adding to the JCL like so:

//LKED.SYSLIN DD DSN=&LOADSET,DISP=(OLD,DELETE)
// DD DSN=&&OBJSET,DISP=(OLD,DELETE)

before the line:

//GO.OUTDATA DD SYSOUT=A

gives :

78 EDIT STEP1 ASM IFOX00 RC= 0000
78 EDIT ASM IFOX00 RC= 0000
78 EDIT LKED IEWL RC= 0000
78 EDIT GO PGM=*.DD RC= 4056


NAME ORIGIN LENGTH NAME LOCATION NAME LOCATION NAME LOCATION NAME LOCATION
$PRIVATE 00 1D1
SUB1 1D8 23




LOCATION REFERS TO SYMBOL IN CONTROL SECTION LOCATION REFERS TO SYMBOL IN CONTROL SECTION
C8 SUB1 SUB1
ENTRY ADDRESS 00

TOTAL LENGTH 200
****GO DOES NOT EXIST BUT HAS BEEN ADDED TO DATA SET
AUTHORIZATION CODE IS 0.


CALLED
END OF PROCESSING

It does print out part of the expect result.

Phil
gmella2030
2012-02-11 06:24:43 UTC
Permalink
Thank you, Phil! the PRINTER DCB is ok because I tried your suggestion, the LKED before the //GO.OUTDATA...., and it worked! :) It printed the expected output. It is the way YAHOO formats the printed text here that would make you think you made an error.

So my JCL book is wrong and you are right! :) The authors (Gary B. Shelly and Thomas J. Cashman) of the book titled: "OS JOB CONTROL LANGUAGE"(June,1981), did NOT include the JCL statements you suggested when discussing how to compile, link edit, and execute two BAL source programs.

Now the next task is to find out why the text returned by the subroutine was mutilated. The calling program was supposed to print "SUB1 CALLED", but it only printed " CALLED" even though MSG was defined with sufficient storage space to accommodate the string "SUB1 CALLED"

Here's the listing again as an example for the folks here who want to write ASM programs calling ASM subroutines and thank you, again, Phil for your help.

//MAINSUB JOB (001) ,MELLA, CLASS=A, MSGLEVEL=(2,0)
//STEP1 EXEC ASMFC,PARM.ASM=(NODECK,LOAD)
//ASM.SYSGO DD DSN=&LOADSET,UNIT=SYSSQ,SPACE=(80,(200,50)),
// DISP=(MOD,PASS)
//ASM.SYSIN DD *
PRINT NOGEN
CSECT
EDIT STM 14,12,12(13)
BALR 12,0
USING *,12
**********SAVE REGISTERS****************************
LR 4,13
LA 13,SAVE
B OVER
SAVE DS 18F
OVER ST 13,8(4)
ST 4,4(13)
********************************************************
OPEN (PRINTER,(OUTPUT))
MVC OUT(1),=C' '
MVC OUT+1(132),OUT
MVC OUT+10(8),=C'MAINLINE'
PUT PRINTER,OUT
*
MVC OUT(1),=C' '
MVC OUT+1(132),OUT
LA 1,ADDRLIST
L 15,ADDRSUB1
BALR 14,15
MVC OUT+10(11),MSG
PUT PRINTER,OUT
*
* PRINT 'END OF PROCESSING'
MVC OUT(1),=C' '
MVC OUT+1(132),OUT
MVC OUT+10(17),LINE
PUT PRINTER,OUT
*
CLOSE (PRINTER,LEAVE)
*
*************RELOAD ORIGINAL VALUES IN REGISTERS*********************
L 13,4(13)
LM 14,12,12(13)
BR 14
********************************************************
ADDRSUB1 DC V(SUB1)
ADDRLIST DC A(MSG)
MSG DS CL11
*
*
* PRINTER AREA
OUT DS CL133
LINE DC C'END OF PROCESSING'
PRINTER DCB BLKSIZE=133,DDNAME=OUTDATA,DEVD=DA,LRECL=133,MACRF=PM, X
OPTCD=U,RECFM=FA,DSORG=PS
END
//STEP2 EXEC ASMFCLG
//ASM.SYSIN DD *
SUB1 START 0
STM 14,12,12(13)
BALR 12,0
USING *,12
ST 13,SAV+4
LA 13,SAV
MVC 0(11,1),=C'SUB1 CALLED'
L 13,SAV+4
LM 14,12,12(13)
BR 14
SAV DS 18F
END
/*
//LKED.SYSLIN DD DSN=&LOADSET,DISP=(OLD,DELETE)
// DD DSN=&&OBJSET,DISP=(OLD,DELETE)
//GO.OUTDATA DD SYSOUT=A
//
Post by halfmeg
Post by somitcw
Post by gmella2030
Hello!
Can some of the ASM gurus here tell me what's wrong
with this program that prints nothing even though it
assembles, link edit and execute with no errors?
I tried everything I know, but I don't know why it
doesn't print the answer which is "sub1 called"
I suspect the JCL is the culprit, but it looks all
right to me :(
//EDIT JOB (001) ,MELLA, CLASS=A, MSGLEVEL=(2,0)
//STEP1 EXEC ASMFC,PARM=(NODECK,LOAD)
//ASM.SYSGO DD DSN=&LOADSET,UNIT=SYSSQ,SPACE=(80,(100,50)),
// DISP=(MOD,PASS)
- - - remainder snipped - - -
Does ASMFCLG expect DSN=&LOADSET or DSN=&&OBJSET ?
Did you check the linkedit list to insure that the
main program even linked?
EDIT STEP1 ASM IFOX00 RC= 0012
62 PRINTER DCB BLKSIZE=133,DDNAME=OUTDATA,DEVD=DA,LRECL=133,MACRF=PM, X
OPTCD=U,RECFM=FA,DSORG=PS
63+ 12,*** IHB052 DSORG OMITTED
64+ 12,*** IHB066 INCONSISTENT OPERAND
...
STMT ERROR CODE MESSAGE ASM 0201 02.30 02/10/12
63 IFO197 *** MNOTE ***
64 IFO197 *** MNOTE ***
NUMBER OF STATEMENTS FLAGGED IN THIS ASSEMBLY = 2
HIGHEST SEVERITY WAS 12
Fixing the 2nd line gets rid of the bad assembly but produces no expected output due to missing main program in the LINK.
NAME ORIGIN LENGTH NAME LOCATION NAME LOCATION NAME LOCATION NAME LOCATION
SUB1 00 23
ENTRY ADDRESS 00
TOTAL LENGTH 28
****GO DOES NOT EXIST BUT HAS BEEN ADDED TO DATA SET
This is caused by use of 2 assembly procs without passing the output of the 1st to be included in the LINK step of the 2nd.
//LKED.SYSLIN DD DSN=&LOADSET,DISP=(OLD,DELETE)
// DD DSN=&&OBJSET,DISP=(OLD,DELETE)
//GO.OUTDATA DD SYSOUT=A
78 EDIT STEP1 ASM IFOX00 RC= 0000
78 EDIT ASM IFOX00 RC= 0000
78 EDIT LKED IEWL RC= 0000
78 EDIT GO PGM=*.DD RC= 4056
NAME ORIGIN LENGTH NAME LOCATION NAME LOCATION NAME LOCATION NAME LOCATION
$PRIVATE 00 1D1
SUB1 1D8 23
LOCATION REFERS TO SYMBOL IN CONTROL SECTION LOCATION REFERS TO SYMBOL IN CONTROL SECTION
C8 SUB1 SUB1
ENTRY ADDRESS 00
TOTAL LENGTH 200
****GO DOES NOT EXIST BUT HAS BEEN ADDED TO DATA SET
AUTHORIZATION CODE IS 0.
CALLED
END OF PROCESSING
It does print out part of the expect result.
Phil
somitcw
2012-02-11 08:21:51 UTC
Permalink
Post by gmella2030
Thank you, Phil! the PRINTER DCB is ok because I tried
your suggestion, the LKED before the //GO.OUTDATA....,
and it worked! :) It printed the expected output. It is
the way YAHOO formats the printed text here that would
make you think you made an error.
So my JCL book is wrong and you are right! :)
The book is correct. You used PROCs on a different
system without changing the &LOADSET to &&OBJSET

See post:

http://tech.groups.yahoo.com/group/H390-MVS/message/12693
Post by gmella2030
The authors (Gary B. Shelly and Thomas J. Cashman) of
the book titled: "OS JOB CONTROL LANGUAGE"(June,1981),
did NOT include the JCL statements you suggested when
discussing how to compile, link edit,
The book not including a solution that does not
address the problem is a reasonable thing for the
book to do.
Post by gmella2030
and execute two BAL source programs.
At least one of the programs had more than
"Branch And Link" instructions.

There is also an old acronym of BAL. The S360/20
did not have MACRO libraries so was called Basic as in
there were no MACROs. You still hear the term today
when someone teaches an assembler class that is not
specifically for MVS, DOS/VS, CP, CMS, CICS, or other
systems so no MACROs are taught.

IBM does not call assemblers with MACRO libraries
the name MACRO Assembler. IBM calls assemblers that
handle MACRO libraries the name "Full Assembler".
Post by gmella2030
Now the next task is to find out why the text returned
by the subroutine was mutilated. The calling program
was supposed to print "SUB1 CALLED", but it only printed
" CALLED" even though MSG was defined with sufficient
storage space to accommodate the string "SUB1 CALLED"
Go back to post:

http://tech.groups.yahoo.com/group/H390-MVS/message/12690
Post by gmella2030
Here's the listing again as an example for the folks
here who want to write ASM programs calling ASM
subroutines and thank you, again, Phil for your help.
//MAINSUB JOB (001) ,MELLA, CLASS=A, MSGLEVEL=(2,0)
Spaces in the JOB statement don't always work well.

If viewing output with RPF, QUEUE, OUTPUT, or other
TSO method, the JOB statement could look like:

//HERC01M JOB (001),MAINSUB-MELLA,CLASS=A,MSGLEVEL=(1,1),
// MSGCLASS=C,NOTIFY=HERC01

If trashing the listings to virtual paper, then
MSGCLASS=A is a better trash class.
Post by gmella2030
//STEP1 EXEC ASMFC,PARM.ASM=(NODECK,LOAD)
//ASM.SYSGO DD DSN=&LOADSET,UNIT=SYSSQ,SPACE=(80,(200,50)),
// DISP=(MOD,PASS)
DSN=&LOADSET still does not match PROC=ASMFCLG
but DSN=&&OBJSET would match.
UNIT=SYSSQ does not match PROC=ASMFCLG but
UNIT=&UNT would match. It doesn't need to match
but why not code normal.

The two lines can be copied from PROC=ASMFCLG with
no changes. They should be something like:

//SYSGO DD DSN=&&OBJSET,UNIT=&UNT,SPACE=(80,(200,50)),
// DISP=(MOD,PASS)
Post by gmella2030
//ASM.SYSIN DD *
//ASM.SYSIN DD * line is not required.
Post by gmella2030
PRINT NOGEN
If you are trying to see the full MACRO expansion,
you might want:

PRINT ON,GEN,DATA To see what's happening
Post by gmella2030
CSECT
CSECT name is not specified. Perhaps you meant:

MAINSUB CSECT ,
Post by gmella2030
EDIT STM 14,12,12(13)
BALR 12,0
USING *,12
**********SAVE REGISTERS****************************
LR 4,13
LA 13,SAVE
Program is not reentrant.
Post by gmella2030
B OVER
SAVE DS 18F
OVER ST 13,8(4)
ST 4,4(13)
********************************************************
OPEN (PRINTER,(OUTPUT))
You coded CLOSE without the extra pair of inner
parenthesis, why not code OPEN the same way?
Post by gmella2030
MVC OUT(1),=C' '
MVC OUT+1(132),OUT
MVC OUT+10(8),=C'MAINLINE'
PUT PRINTER,OUT
*
MVC OUT(1),=C' '
MVC OUT+1(132),OUT
LA 1,ADDRLIST
L 15,ADDRSUB1
BALR 14,15
MVC OUT+10(11),MSG
PUT PRINTER,OUT
*
* PRINT 'END OF PROCESSING'
MVC OUT(1),=C' '
MVC OUT+1(132),OUT
MVC OUT+10(17),LINE
PUT PRINTER,OUT
*
CLOSE (PRINTER,LEAVE)
*
*********RELOAD ORIGINAL VALUES IN REGISTERS*************
L 13,4(13)
LM 14,12,12(13)
Return code is not being set.
Perhaps add, SLR R15,R15 about here?
Post by gmella2030
BR 14
********************************************************
ADDRSUB1 DC V(SUB1)
ADDRLIST DC A(MSG)
MSG DS CL11
*
*
* PRINTER AREA
OUT DS CL133
LINE DC C'END OF PROCESSING'
PRINTER DCB
BLKSIZE=133,DDNAME=OUTDATA,DEVD=DA,LRECL=133,MACRF=PM, X
OPTCD=U,RECFM=FA,DSORG=PS
Hard-coding a DCB to force unblocked output is
not a good practice. I would suggest that you allow
blocking. Something like:

PRINTER DCB BLKSIZE=0,DDNAME=OUTDATA,DEVD=DA,LRECL=133,MACRF=PM, X
OPTCD=U,RECFM=FBA,DSORG=PS

Note, the "X" in column 72 will wrapped to the next line.
Post by gmella2030
END
//STEP2 EXEC ASMFCLG
//ASM.SYSIN DD *
//ASM.SYSIN DD * line is not required.
Post by gmella2030
SUB1 START 0
STM 14,12,12(13)
BALR 12,0
USING *,12
ST 13,SAV+4
LA 13,SAV
Instruction to load register 1 with the
address of MSG is still missing.
Post by gmella2030
MVC 0(11,1),=C'SUB1 CALLED'
L 13,SAV+4
LM 14,12,12(13)
Return code is not being set.
Perhaps add, SLR R15,R15 about here?
Post by gmella2030
BR 14
SAV DS 18F
END
/*
//LKED.SYSLIN DD DSN=&LOADSET,DISP=(OLD,DELETE)
// DD DSN=&&OBJSET,DISP=(OLD,DELETE)
Previous two lines were added because the //ASM.SYSGO
was coded strange. Another method would be to fix SYSGO
and delete the previous two lines.
Post by gmella2030
//GO.OUTDATA DD SYSOUT=A
Should be:

//GO.OUTDATA DD SYSOUT=*
Post by gmella2030
//
- - - old notes snipped - - -
gmella2030
2012-02-12 01:04:25 UTC
Permalink
Post by somitcw
Post by gmella2030
Thank you, Phil! the PRINTER DCB is ok because I tried
your suggestion, the LKED before the //GO.OUTDATA....,
and it worked! :) It printed the expected output. It is
the way YAHOO formats the printed text here that would
make you think you made an error.
So my JCL book is wrong and you are right! :)
The book is correct. You used PROCs on a different
system without changing the &LOADSET to &&OBJSET
Well maybe the job would run fine on the system they used or maybe it was an omission when printing the book, but for the program to run fine on my system, Hercules-MVS, I need to include the LKED.SYSLIN before the OUTDATA DD statement, as Phil suggested.
Post by somitcw
Post by gmella2030
The authors (Gary B. Shelly and Thomas J. Cashman) of
the book titled: "OS JOB CONTROL LANGUAGE"(June,1981),
did NOT include the JCL statements you suggested when
discussing how to compile, link edit,
The book not including a solution that does not
address the problem is a reasonable thing for the
book to do.
No! They gave a complete example to illustrate how to compile, link edit and execute a job with two asm source programs.
Post by somitcw
Post by gmella2030
and execute two BAL source programs.
Here's the listing again as an example for the folks
here who want to write ASM programs calling ASM
subroutines and thank you, again, Phil for your help.
//MAINSUB JOB (001) ,MELLA, CLASS=A, MSGLEVEL=(2,0)
Spaces in the JOB statement don't always work well.
But I don't have that problem, otherwise I would've gotten source statement errors
I write my programs using the Visual C++ editor and then run them in the Hercules window using devinit and it all works well.
Post by somitcw
If viewing output with RPF, QUEUE, OUTPUT, or other
//HERC01M JOB (001),MAINSUB-MELLA,CLASS=A,MSGLEVEL=(1,1),
// MSGCLASS=C,NOTIFY=HERC01
If trashing the listings to virtual paper, then
MSGCLASS=A is a better trash class.
Post by gmella2030
//STEP1 EXEC ASMFC,PARM.ASM=(NODECK,LOAD)
//ASM.SYSGO DD DSN=&LOADSET,UNIT=SYSSQ,SPACE=(80,(200,50)),
// DISP=(MOD,PASS)
DSN=&LOADSET still does not match PROC=ASMFCLG
but DSN=&&OBJSET would match.
UNIT=SYSSQ does not match PROC=ASMFCLG but
UNIT=&UNT would match. It doesn't need to match
but why not code normal.
ok, point well taken. I will try your suggestion now
Post by somitcw
The two lines can be copied from PROC=ASMFCLG with
//SYSGO DD DSN=&&OBJSET,UNIT=&UNT,SPACE=(80,(200,50)),
// DISP=(MOD,PASS)
Post by gmella2030
//ASM.SYSIN DD *
//ASM.SYSIN DD * line is not required.
Yes, you are right, it's just an old habit of mine to include ASM.SYSIN in all of my ASM programs.
Post by somitcw
Instruction to load register 1 with the
address of MSG is still missing.
Post by gmella2030
MVC 0(11,1),=C'SUB1 CALLED'
L 13,SAV+4
LM 14,12,12(13)
Good catch! I changed it to:
L 6,0(1)
MVC 0(11,6),=C'SUB1 CALLED'
The whole string was sent back to the main program and this time it printed right! Thank you! :)
Post by somitcw
Return code is not being set.
Perhaps add, SLR R15,R15 about here?
Post by gmella2030
BR 14
SAV DS 18F
END
/*
//LKED.SYSLIN DD DSN=&LOADSET,DISP=(OLD,DELETE)
// DD DSN=&&OBJSET,DISP=(OLD,DELETE)
Previous two lines were added because the //ASM.SYSGO
was coded strange. Another method would be to fix SYSGO
and delete the previous two lines.
Ok, I did that and it also worked :)
Post by somitcw
Post by gmella2030
//GO.OUTDATA DD SYSOUT=A
//GO.OUTDATA DD SYSOUT=*
Yes, like I said before, it's old habit of mine using SYSOUT=A

Thank you very much for your suggestions, they all worked fine. :)
somitcw
2012-02-12 16:04:47 UTC
Permalink
Post by gmella2030
Post by somitcw
Post by gmella2030
Thank you, Phil! the PRINTER DCB is ok because I tried
your suggestion, the LKED before the //GO.OUTDATA....,
and it worked! :) It printed the expected output. It is
the way YAHOO formats the printed text here that would
make you think you made an error.
So my JCL book is wrong and you are right! :)
The book is correct. You used PROCs on a different
system without changing the &LOADSET to &&OBJSET
Well maybe the job would run fine on the system they
used or maybe it was an omission when printing the book,
but for the program to run fine on my system,
- - - remainder snipped - - -

The book was printed fine.

You are expected to adjust JOB statements and data
set names to match the system that you are running on.

There is no way that the book could give examples
for all systems from 1965 until current where the
JOB statements and data set names would match every
implementation.

I hope that later chapters show better coding
techniques like register equates and reentrant code.
Even if the book never shows a better way to code,
the book was correct.
Steve and Grace Bovy
2012-02-14 18:41:02 UTC
Permalink
X64-hercules-svn-7752 ( win server 2008)

I have a souped up machine to run herc on
With 16 gig of memory and an amd Phenom II x6 1055T

Memory is so cheap and I got a great deal at fry's that I could
Not pass up !!

So I am trying to get the x64 version running
I hit the following snag >>

The application has failed to start because its
Side-by-side configuration is incorrect.

Please advise, thanks
somitcw
2012-02-14 19:00:25 UTC
Permalink
Post by Steve and Grace Bovy
X64-hercules-svn-7752 ( win server 2008)
I have a souped up machine to run herc on
With 16 gig of memory and an amd Phenom II x6 1055T
Memory is so cheap and I got a great deal at fry's
that I could Not pass up !!
So I am trying to get the x64 version running
I hit the following snag >>
The application has failed to start because its
Side-by-side configuration is incorrect.
Please advise, thanks
Did you either run Windows Update, install
http://www.microsoft.com/download/en/details.aspx?id=26347
or rename the manifest folder?

halfmeg
2012-02-11 21:39:38 UTC
Permalink
<snip>
So my JCL book is wrong and you are right! :) The authors (Gary B.
Shelly and Thomas J. Cashman) of the book titled: "OS JOB CONTROL
LANGUAGE"(June,1981), did NOT include the JCL statements you
suggested when discussing how to compile, link edit, and execute two
BAL source programs.
<snip>
Your book is probably right for the environment it's authors were running the assemblies on.

I don't have that book, the procs the book is expecting are most likely coded differently, albeit with the same name ( ASMFCL & ASMFCLG ). Even if all the JCL is identical ( your's and the procs ), the default parameters for the assembler/compiler may be genned differently giving different outcomes.

The point is:

Examples from one environment may not work as expected in another environment.

Phil
Steve and Grace Bovy
2012-02-09 04:56:08 UTC
Permalink
I am running herc versiob 5600 x32 on win server 2008 x64

I have wincap and fishes ctci ( his test programs all indicate success )

I have a herc lcs deff e20 bla bla bla

I ipl zos 1.10 and I am quite positive that my tpt parms are correct

I see the herc log say the lcs ports are open and I see the z/os log say
That the lcs link is inited

But I can not ping z/os on the ip address that I assigned in herc and in the

z/os config

The tcpip stack is up and running I can perform internal functions

I am using ibmuser

I can not get at omvs and the sdsf/ps command is not authorized ???

I am quite certain I have used this same config on a windows 7 system
Some time ago

But now I can not get it to work

Any suggestions would be appreciated, thanks

I would also like to figure out how to add additional dasd
Binyamin Dissen
2012-02-09 22:15:07 UTC
Permalink
On Thu, 09 Feb 2012 01:40:42 -0000 "gmella2030" <gmella2030-/***@public.gmane.org> wrote:

:>Can some of the ASM gurus here tell me what's wrong with this program that prints nothing even though it assembles, link edit and execute with no errors? I tried everything I know, but I don't know why it doesn't print the answer which is "sub1 called" I suspect the JCL is the culprit, but it looks all right to me :(

Does it NOT PRINT or NOT PRINT THE EXPECTED RESULTS.

If the former, check the link edit map to see what is going on.

:>//EDIT JOB (001) ,MELLA, CLASS=A, MSGLEVEL=(2,0)
:>//STEP1 EXEC ASMFC,PARM=(NODECK,LOAD)
:>//ASM.SYSGO DD DSN=&LOADSET,UNIT=SYSSQ,SPACE=(80,(100,50)),
:>// DISP=(MOD,PASS)
:>//ASM.SYSIN DD *
:> PRINT NOGEN
:> CSECT
:>EDIT STM 14,12,12(13)
:> BALR 12,0
:> USING *,12
:>**********SAVE REGISTERS****************************
:> LR 4,13
:> LA 13,SAVE
:> B OVER
:>SAVE DS 18F
:>OVER ST 13,8(4)
:> ST 4,4(13)
:>********************************************************
:> OPEN (PRINTER,(OUTPUT))
:> LA 1,ADDRLIST
:> L 15,ADDRSUB1
:> BALR 14,15
:> MVC OUT(1),=C' '
:> MVC OUT+1(132),OUT
:> MVC OUT+10(10),MSG
:> PUT PRINTER,OUT
:>*
:>* PRINT 'END OF PROCESSING'
:> MVC OUT(1),=C' '
:> MVC OUT+1(132),OUT
:> MVC OUT+10(17),LINE
:> PUT PRINTER,OUT
:>*
:> CLOSE (PRINTER,LEAVE)
:>*
:>*************RELOAD ORIGINAL VALUES IN REGISTERS*********************
:> L 13,4(13)
:> LM 14,12,12(13)
:> BR 14
:>********************************************************
:>ADDRSUB1 DC V(SUB1)
:>ADDRLIST DC A(MSG)
:>MSG DS CL10
:>*
:>*
:>* PRINTER AREA
:>OUT DS CL133
:>LINE DC C'END OF PROCESSING'
:>PRINTER DCB BLKSIZE=133,DDNAME=OUTDATA,DEVD=DA,LRECL=133,MACRF=PM, X
:> OPTCD=U,RECFM=FA,DSORG=PS
:> END
:>// EXEC ASMFCLG
:>//ASM.SYSIN DD *
:>SUB1 START 0
:> STM 14,12,12(13)
:> BALR 12,0
:> USING *,12
:> MVC 0(11,1),=C'SUB1 CALLED'
:> LM 14,12,12(13)
:> BR 14
:> END
:>//GO.OUTDATA DD SYSOUT=A
:>//

--
Binyamin Dissen <bdissen-***@public.gmane.org>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.
Tony Harminc
2012-02-10 17:32:49 UTC
Permalink
Can some of the ASM gurus here tell me what's wrong with this program that prints nothing even though it assembles, link edit and execute with no errors?  I tried everything I know, but I don't know why it doesn't print the answer which is "sub1 called"  I suspect the JCL is the culprit, but it looks all right to me
Others have addressed various problems, but may I offer one
suggestion: After you issue an OPEN, check that the DBC(s) you think
you have OPENed are actually open. Usually OPEN will abend if it
fails, but not always. The flag you need is DCBOFOPN in byte DCBOFLGS.

In your case, you could use something like:

LA R5,PRINTER
USING IHADCB,R5
TM DCBOFLGS,DCBOFOPN
BNO OPENFAIL
DROP R5

If you had ASMH or HLASM, you could avoid using the extra register and just do

USING IHADCB,PRINTER

Tony H.
Binyamin Dissen
2012-02-11 23:03:18 UTC
Permalink
On Fri, 10 Feb 2012 12:32:49 -0500 Tony Harminc <tharminc-***@public.gmane.org> wrote:

:>On 8 February 2012 20:40, gmella2030 <gmella2030-/***@public.gmane.org> wrote:

:>> Can some of the ASM gurus here tell me what's wrong with this program that prints nothing even though it assembles, link edit and execute with no errors?  I tried everything I know, but I don't know why it doesn't print the answer which is "sub1 called"  I suspect the JCL is the culprit, but it looks all right to me

:>Others have addressed various problems, but may I offer one
:>suggestion: After you issue an OPEN, check that the DBC(s) you think
:>you have OPENed are actually open. Usually OPEN will abend if it
:>fails, but not always. The flag you need is DCBOFOPN in byte DCBOFLGS.

Unless this is an acceptable condition which will lead to some alternate
action, there really is no need for this check. The first GET or PUT will
abend.

:>In your case, you could use something like:

:> LA R5,PRINTER
:> USING IHADCB,R5
:> TM DCBOFLGS,DCBOFOPN
:> BNO OPENFAIL
:> DROP R5

:>If you had ASMH or HLASM, you could avoid using the extra register and just do

:> USING IHADCB,PRINTER

or

TM DCBOFLGS+PRINTER-IHADCB,DCBOFOPN

--
Binyamin Dissen <bdissen-***@public.gmane.org>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.
Continue reading on narkive:
Loading...