On Thu, Dec 21, 2017 at 11:31 AM, Jon Perryman <[email protected]> wrote:
> > Paul wrote: did C have dynamic allocation in FOPEN before MVS UNIX.
> Thanks John for pointing out that LE supports dynalloc. It's been many
> years since I've looked at application programming in MVS.
> > Paul wrote: Please explain dynalloc security exposure in programming
> languages.
> In the past is used to be a problem but apparently has become acceptable.
> The security exposure back then was that production analysts reviewed
> production JCL to verify datasets used. Having delivered SAS/C with our
> products, customers would call after an audit about dynalloc. I would tell
> them that as long as they restricted access to our products, then there is
> not an exposure. The idea was that programmers could copy restricted data
> (e.g. payroll, SS numbers, credit cards and ???) to a dataset they owned.
> In C, it may have been a simple mistake. In other languages, it was
> considered willful and intentional because the programmer must do something
> unusual. Back then, some companies did not want programmers to use dynalloc.
> > Paul wrote:Consider portability as justification for using C
> This is motivated reasoning. Does this make you 5 to 10 times more
> productive? How often do you think our programs are relevant to Unix? Very
> few programs we write in HLASM are relevant to Unix (even to VM and VSE).
> MVS is a feature rich operating system when compared to Unix. Case in point
> is Charle's product (SMF). Look at the CBT and you will see the majority do
> not have any relevance to any other environment. Also remember that HLASM
> programmers are much more willing to use other languages than C programmers.
> > Paul wrote: Consider ease of programming as justification for using C
> This is motivated reasoning. Specifically mentioned was C printf function.
> I believe C functions are part of LE. As such, this should be an easy to
> call the LE function from HLASM. It's maybe a 15 line macro to init LE,
> build parm list, call function, destroy environment and return result. The
> programmer would use a macro call something like #LE_CALL PRINTF,('X %s %i
> %f',var1,var2,var3).
> What is it that makes a C programmer say they are more productive
> (especially when they believe they are effective HLASM programmers)?
> Thanks, Jon.
>
>
Full HLASM program which uses LE & the "snprintf()" C subroutine is at:
https://github.com/JohnArchieMckown/miscutil/blob/master/TEXECMVS
=== snip ===
*PROCESS ALIGN,COMPAT(MACROCASE,NOCASE),DXREF,FLAG(ALIGN,CONT,RECORD)
*PROCESS NOFOLD,NOINFO,PC(ON,DATA,GEN,MCALL),RENT,
*PROCESS RA2,NORLD,MXREF,RXREF,USING(MAP,WARN(13))
*PROCESS TYPECHECK(MAGNITUDE,REGISTER)
*WARNING - THIS PROGRAM REQUIRES THE HIGH-LEVEL ASSEMBLER
* AS WELL AS LE/370
* THIS PROGRAM IS RE-ENTRANT.
PUSH PRINT
PRINT NOGEN
IEABRCX DEFINE
IEABRCX ENABLE
EXTRN BPX1EXM
EXTRN SNPRINTF
EXTRN PUTENV
EXTRN GETENV
EXTRN EXITROUT
EXTRN CEEENV Language Environment environment variables
POP PRINT
IAZYREG
SYSSTATE ARCHLVL=2,ASCENV=ANY
TEXECMVS CEEENTRY PPA=TEXECMVS_PPA, X
MAIN=YES, X
AUTO=DSASIZE, X
RMODE=31, X
AMODE=31, X
BASE=R11
DROP R11
LARL R11,KONSTNTS
USING KONSTNTS,R11
USING CEECAA,R12
USING CEEDSA,R13
J GO
GOBACK DS 0H
CEETERM RC=RETURN_CODE, X
MF=(E,CEETERM_BLOCK)
* MODIFIER=MODIFIER
GO DS 0H
L R8,0(,R1)
LH R9,0(,R8)
* WTO 'TEXECMVS IAZXJSAB ENTER',ROUTCDE=11
IAZXJSAB READ, X
WORKID=#WORKID, X
JOBID=#JOBID, X
JOBNAME=#JOBNAME, X
USERID=#USERID, X
EXECST=#EXECST
* WTO 'TEXECMVS IAZXJSAB EXIT',ROUTCDE=11
USING PSA,0
L R1,PSAAOLD
DROP 0
USING ASCB,R1
LH R3,ASCBASID
DROP R1
* WTO 'TEXECMVS SNPRINTF ENTER',ROUTCDE=11
LARL R15,SNPRINTF ADDRESS OF SNPRINTF()
LA R1,CALLX PARM LIST
LHI R0,LFORMAT FORMAT STRING LENGTH
STH R0,WTOMSG INTO WTO PARM LIST
LA R2,WTOMSG+2 WHERE TO PUT STRING
CEEPCALL (15),((2), X
126, YES, A PLAIN NUMBER X
FORMAT, X
(3), ASID VALUE X
#WORKID, X
#JOBID, X
#JOBNAME, X
#USERID),VL,MF=(E,(1))
LA R1,CALLX
MVC 0(LWTOL,R1),WTOL
WTO TEXT=WTOMSG, X
ROUTCDE=11, X
MF=(E,(1))
*
...
WTOL WTO TEXT=,ROUTCDE=11,MF=L
LWTOL EQU *-WTOL
FORMAT DC C'TEXECMVS TEST'
DC C' ASID=%d'
DC C' WORKID=%8.8s'
DC C' JOBID=%8.8s'
DC C' JOBNAME=%8.8s'
DC C' USERID=%8.8s'
LFORMAT EQU *-FORMAT
DC X'00' C end-of-string indicator
...
CEEDSA
* DYNAMIC AREA IS DEFINED HERE.
* THIS IS WITHIN A DSECT, SO NO DATA IS REALLY INITIALIZED
BUFL DS F
#WORKID DS CL8
#JOBID DS CL8
#JOBNAME DS CL8
#USERID DS CL8
#EXECST DS D TOD TIME STAMP
WTOMSG DS H,CL126
CALLX DS 30A
CEETERM_BLOCK CEETERM MF=L
DSASIZE EQU *-CEEDSA
X
=========
--
I have a theory that it's impossible to prove anything, but I can't prove
it.
Maranatha! <><
John McKown