by DonHopkins | 2025-05-26 07:47:00+00:00
JCL! My mom could do that. Fortunately she's safely and blissfully retired, so AI can't take her jerbs.

https://en.wikipedia.org/wiki/Job_Control_Language

>"the worst computer programming language ever devised by anybody, anywhere" -Fred Brooks

(Obviously when he said that, Fred hadn't been exposed to bash yet!)

"Please write a JCL script to orchestrate the release of my AI startup company's AI powered shop assistant from github. Did I mention that we use AI?"

//********************************************************************* //* M O L I N A I R E L E A S E P I P E L I N E * //* * //* Product : AVATAR-SHOP-ASSISTANT * //* Company : Aluxian / Molin AI * //* Purpose : Tag, publish and attach artefacts to GitHub * //********************************************************************* //AVTREL JOB (AC),'MOLIN AI',CLASS=A,MSGCLASS=X,JOBPARM=TIME=1440,TYPRUN=HOLD // REGION=0M //SET PRJ=MOLINAI,APP=AVATAR,TAG=v3.1.0,TOK=ghp_FAKE,REPO=aluxian/avatar //SET WS=/opt/molin/ws //MUSE PROC GIT=/usr/lpp/git4z/bin/git4z,CURL=/usr/lpp/bear/bin/curlbear,SHA= //ENV SET PATH=/usr/lpp/git4z/bin:/bin HOME=/home/molin //SHA EXEC PGM=BPXBATCH,PARM='PGM &GIT rev-parse HEAD' //STDOUT DD DSN=&&S,UNIT=SYSDA,SPACE=(CYL,1),DISP=(,PASS) //IFTAG IF (&SHA ¬= ' ') THEN //TAG EXEC PGM=BPXBATCH,PARM='PGM &GIT tag -a &TAG &SHA -m &TAG' // ELSE //TAG EXEC PGM=BPXBATCH,PARM='PGM &GIT tag -a &TAG -m &TAG' // ENDIF //PUSH EXEC PGM=BPXBATCH,PARM='PGM &GIT push origin &TAG',COND=(4,LT) //JSON EXEC PGM=IEBGENER //SYSUT1 DD * {"tag_name":"&TAG","name":"Avatar &TAG","generate_release_notes":true} /* //SYSUT2 DD DISP=(NEW,CATLG),DSN=&&PAY(0),UNIT=SYSDA,SPACE=(TRK,1) //SYSIN DD DUMMY //ESDS EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DEFINE CLUSTER(NAME(&&E) RECORDSIZE(255 255) KEYS(1 0) REUSE SPEED) - DATA(NAME(&&E.DATA)) REPRO INFILE(P) OUTDATASET(&&E.DATA) IF MAXCC>4 THEN SET MAXCC=0 /* //P DD DISP=SHR,DSN=&&PAY(0) //POST EXEC PGM=BPXBATCH, // PARM='PGM &CURL -sS -X POST https://api.github.com/repos/&REPO./releases // -H Authorization:\ Bearer\ &TOK -H Accept:\ application/vnd.github+json // --data-binary\ @DD:EJSON' //EJSON DD DISP=SHR,DSN=&&E.DATA //STDOUT DD DSN=&&R,UNIT=SYSDA,SPACE=(TRK,1),DISP=(,PASS) //RID EXEC PGM=IKJEFT01 //SYSTSPRT DD DSN=&&ID,UNIT=SYSDA,SPACE=(TRK,1),DISP=(,PASS) //SYSTSIN DD * alloc fi(r) da('&&R') shr execio * diskr r (stem x. finis do i=1 to x.0 if pos('"id"',x.i)>0 then parse var x.i '"id":' id ',' . if id¬='' then say strip(id); leave end /* //* BLDL fix — after the ‘Q3-FY24 LLA purge’ when an ill-advised UPDATE to //* SYS1.LINKLIB nuked the BLDLRES chain, froze LLA, and threw half the //* plex into S047s until Ops spent nine hours baby-sitting a cold-start IPL. //COPY EXEC PGM=IEBCOPY //SYSUT1 DD DISP=SHR,DSN=&&R //SYSUT2 DD DSN=&PRJ..G.&APP..R(&TAG),DISP=(NEW,CATLG), // SPACE=(CYL,(1,1,1)),DSORG=PO //UPL EXEC PGM=BPXBATCH, // PARM='PGM &CURL -sS -X POST // https://uploads.github.com/repos/&REPO./releases/$(cat &&ID)/assets?name=shop.jar // -H Authorization:\ Bearer\ &TOK -H Content-Type:\ application/java-archive // --data-binary\ @&WS/&APP/dist/shop.jar' //STDENV DD DUMMY //PEND //GO EXEC MUSE