Very good thought, Tony. And exactly my next step. I wasn't sure if you could just copy a UNIX file to a PDSE (I suppose I should have tried), so instead I created a full link directly to the PDSE. And well, it worked! Here's my entire compile/link JCL:
//SWIFTCLK JOB ,'Swift Comp/Link',NOTIFY=&SYSUID,REGION=2000M //*--------------------------------------------------------------------- //COMPILE EXEC PGM=BPXBATCH,PARMDD=PARMSIN //PARMSIN DD * SH /u/dvfjs/swift-4/bin/swiftc -v -c -o /u/dvfjs/lib/fw.o /u/dvfjs/src/fw.swift /* //STDIN DD DUMMY //STDOUT DD SYSOUT=* //STDERR DD SYSOUT=* //STDENV DD DUMMY //*--------------------------------------------------------------------- //LINKEDIT EXEC PGM=LINKEDIT,PARMDD=LINKPARM //LINKPARM DD * AMODE=64,TERM=YES, DYNAM=DLL,ALIASES=NO,UPCASE=NO, LIST=NOIMP,MAP=YES,XREF=YES,INFO=YES, REUS=RENT,EDIT=YES,AC=0,CALL=YES,CASE=MIXED /* //SYSLIB DD DSN='CEE.SCEEBND2',DISP=SHR // DD DSN='CBC.SCCNOBJ',DISP=SHR // DD DSN='SYS1.CSSLIB',DISP=SHR //C8920 DD SPACE=(32000,(30,30)), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200) //C8921 DD DSN='CEE.SCEELIB',DISP=SHR //C8922 DD DSN='CBC.SCLBSID',DISP=SHR //C8923 DD DSN='DVFJS.SWIFT.SCEELIB',DISP=SHR //SYSPRINT DD SYSOUT=* //SYSTERM DD SYSOUT=* //SYSLMOD DD DSN='DVFJS.APPLIB.LOAD',DISP=SHR //SYSDEFSD DD SYSOUT=* //SYSLIN DD * INCLUDE C8920 INCLUDE '/u/dvfjs/lib/fw.o' AUTOCALL '/u/dvfjs/swift-4/lib/swift_static/zos//libswiftCore.a' AUTOCALL '/u/dvfjs/swift-4/lib/swift_static/zos//libswiftLibc.a' AUTOCALL '/u/dvfjs/swift-4/lib/swift_static/zos//libswiftZInit.a' AUTOCALL '/u/dvfjs/swift-4/lib/swift_static/zos//libswiftCore.a' AUTOCALL '/u/dvfjs/swift-4/lib/swift_static/zos//libswiftSwiftOnoneSu- pport.a' AUTOCALL '/u/dvfjs/swift-4/lib/swift_static/zos//libswiftLibc.a' AUTOCALL '/u/dvfjs/swift-4/lib//libc++.a' INCLUDE '/u/dvfjs/swift-4/lib/celqscpp.x' INCLUDE '/u/dvfjs/swift-4/lib/celqs001.x' INCLUDE '/u/dvfjs/swift-4/lib/libkqueue.x' INCLUDE '/u/dvfjs/swift-4/lib/libpthread_workqueue.x' INCLUDE C8921(CELQS001) INCLUDE C8921(CELQS003) INCLUDE C8921(C64) INCLUDE C8922(IOSX64) INCLUDE C8923(BLOCKS) INCLUDE C8923(CELQSCPP) INCLUDE C8923(IXMI58DA) INCLUDE C8923(IXMI58IN) INCLUDE C8923(IXMI58IO) INCLUDE C8923(IXMI58UC) INCLUDE C8923(LIBBSD) INCLUDE C8923(LIBUUID) NAME FW(R) /* And here's my JCL to run the program: //SWIFTFW JOB NOTIFY=&SYSUID,REGION=2000M //EXECFW EXEC PGM=FW //STEPLIB DD DISP=SHR,DSN=DVFJS.APPLIB.LOAD // DD DISP=SHR,DSN=DVFJS.SWIFT.SCEERUN2 //CEEOPTS DD * POSIX(ON) TERMTHDACT(DUMP,,96) /* //FW DD DISP=SHR,DSN=DVFJS.FW // And it works! I had even asked the development team earlier this year if a Swift program would work outside of the UNIX environment and I seem to recall they said no. But it seems to be working, at least for a basic program. So cool! If you want to have some fun with a new compiled (no VM or interpreter required) language, give the Swift for z/OS beta a shot. It's fun! Frank ________________________________ From: IBM Mainframe Discussion List <[email protected]> on behalf of Tony Harminc <[email protected]> Sent: Friday, October 13, 2017 10:39 AM To: [email protected] Subject: Re: fopen DD On 12 October 2017 at 20:40, Paul Gilmartin <[email protected]> wrote: > On Fri, 13 Oct 2017 00:17:40 +0000, Frank Swarbrick wrote: >> >>//SHELL JOB NOTIFY=&SYSUID,REGION=2000M >>//UNIXSH EXEC PGM=BPXBATCH,PARMDD=PARMSIN >>//FW DD DISP=SHR,DSN=DVFJS.FW >>//PARMSIN DD * >>SH /u/dvfjs/src/fw >>/* >>//STDIN DD DUMMY >>//STDOUT DD SYSOUT=* >>//STDERR DD SYSOUT=* >>//STDENV DD DUMMY >>// >> >>Does the Unix environment for BPXBATCH not have access to the JCL DD? >> > Right. BPXBATCH starts a new address space which inherits none of the DDs. > BPXBATSL runs in the job step address space, but has onerous APF > entanglements. > > I don't know that BPXWUNIX is better. > > The cumbersome alternative is to use Rexx; BPXWDYN('alloc dd(FW) ...'), then > address SYSCALL spawn with BPX_SHAREAS=MUST. Details are left as an > exercise for the student. The MVS-OE forum might be helpful. A quite different approach is to simply copy the executable from the UNIX file to a PDSE member, and then run it with EXEC PGM=FW with that PDSE as STEPLIB. I've found this generally works very well for programs that aren't full of UNIXisms such as requiring env vars and such. Tony H. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
