Page 1 of 2

How do you compile/bind using rexx or in USS?

PostPosted: Tue Nov 21, 2017 6:43 pm
by chong_zhou
Hi guys, I'm a beginner to MF and am self-studying HLASM, so I need to write a lot of test program for practise.

Sometimes I have to recompile/rebind the program very frequently, so doing it with JCL is quite inconvenient, because I have to switch to SDSF and 'press-press-...-press' enter key in order to watch the progress and read logs.

Is there a way to compile/bind it in foreground instead of submitting job? Some thing like the C89/C99 frontend tools?

I know the 'as' command, but I only found a very brief introduction for it in IBM's knowledge center. And after compiling the asm source code, I do not know what command I can use to bind the object files.

Thank you guys for your help in advance!

Re: How do you compile/bind using rexx or in USS?

PostPosted: Tue Nov 21, 2017 7:21 pm
by enrico-sorichetti
a proper JOB card with the NOTIFY clause will let You know when the job has finished :mrgreen:

Re: How do you compile/bind using rexx or in USS?

PostPosted: Tue Nov 21, 2017 7:58 pm
by steve-myers
For many years I've used a CLIST in straight TSO to allocate the data sets and run HLASM. I do not use USS at all. After the compile I use the regular LINK command to link the module.

For each project I usually custom write a CLIST, which usually looks like this -
proc 0
control list
sasm xxx options
if &lastcc <= 4 then +
 do
  listdsi xxx.load
  if &lastcc = 0 then cleard xxx.load
  alloc f(syslib) shr reus da(load)
  link xxx load(xxx(xxx))
  link xxx test
  freesys
  free f(syslib)
 end


The first link command builds an executable module without the TEST command symbols. The second link builds the module with TEST command symbols.

The CLEARD command is a private command to delete all members and "compress" the data set; it's faster than deleting and reallocating the data set.

FREESYS frees all SYSnnn (where nnn is numerics) DD statements; LINK leaves a bunch of them behind.

The SASM CLIST also depends on a private command. This command is comparable to CALL *(module) but it has the capability of calling the module with a DD list to use alternate DDnames; the command has a number of pre-designated DD names - like ASMDD for the Assembler.

The LOAD library allocated before the LINK commands contains library routines that many of my programs use. I could use LIB('myuserid.LOAD') in the link commands, but this seems to work a little better for me

Re: How do you compile/bind using rexx or in USS?

PostPosted: Wed Nov 22, 2017 10:45 pm
by willy jensen
I have 3 ISPF edit macros: ASM, LINK and ASML for doing assembly, linkedit or both of the edited data.
The edited data is copied to a temporary dataset, so no need to save in between changes.
Options and directives are in the assembly source as comments.
The list can be shown in the same ISPF screen, or in a new screen.

The macros are fairly big, so I would rather not upload them here. Instead they can be found as 'ASML' here: http://harders-jensen.com/wjtech/programs.html
Documentation is in the macros.

Re: How do you compile/bind using rexx or in USS?

PostPosted: Thu Nov 23, 2017 12:27 pm
by enrico-sorichetti
while compiling and running things in the foreground ( terminal TSO session ) is technically feasible
everybody should remember that company/organisation practices and standards might frown about it

Re: How do you compile/bind using rexx or in USS?

PostPosted: Fri Nov 24, 2017 1:46 am
by prino
steve-myers wrote:The CLEARD command is a private command to delete all members and "compress" the data set; it's faster than deleting and reallocating the data set.

Does it handle PDSE's?

Re: How do you compile/bind using rexx or in USS?

PostPosted: Fri Nov 24, 2017 5:52 am
by steve-myers
PDSEs? No. CLEARD could be altered for the purpose fairly easily, but since I have no need for it, and it's never been published, it's not worth my time. An unpleasant side effect is the data set would have to be allocated DISP=OLD.

Re: How do you compile/bind using rexx or in USS?

PostPosted: Fri Nov 24, 2017 4:44 pm
by willy jensen
PDS86 program from cbttape.org file 182 can clear a PDSE (command: FIX RESET).
And do almost anything you can think of doing for / to a PDS/E.

Re: How do you compile/bind using rexx or in USS?

PostPosted: Fri Dec 01, 2017 5:10 pm
by chong_zhou
willy jensen wrote:I have 3 ISPF edit macros: ASM, LINK and ASML for doing assembly, linkedit or both of the edited data.
The edited data is copied to a temporary dataset, so no need to save in between changes.
Options and directives are in the assembly source as comments.
The list can be shown in the same ISPF screen, or in a new screen.

The macros are fairly big, so I would rather not upload them here. Instead they can be found as 'ASML' here: http://harders-jensen.com/wjtech/programs.html
Documentation is in the macros.


Thank you very much Willy. I will try your 'macro' to see if it works for me. (I saw they are actually REXX script)

Re: How do you compile/bind using rexx or in USS?

PostPosted: Fri Dec 29, 2017 12:08 pm
by steve-myers
Well, it only took 27 years (and at least 3 failed starts, 1 for AsmH and 2 for High Level Asm) but I now have a usable TSO command processor to run the High Level Assembler in the TSO environment without the benefit of a CLIST or Rexx EXEC. This is far superior to the HLASM command in CBT file 300. Details of the planned feature set are still in development and I'm undecided if I will publish it. PM me if you're interested.