JCL errors. I'm pretty sure syntax is correct, but am unsure of how to get this job submitted with no errors - jcl

I'm getting JCL error 838 and the error messages I'm seeing are: "IEFC006I Positional parameters must be specified before keyword parameter" and "IEFC001I Procedure comp was expanded using instream procedure definiti"
This is what I've typed up:
//TSOZA601 JOB 3ES10G10000012,'TSOZA60',MSGCLASS=Q,MSGLEVEL=(1,1),
// NOTIFY=TSOZA60,CLASS=A,REGION=2M
//COMP PROC
//*****
//***** MAKE BACKUP
//*****
//S1 EXEC PGM=IEBCOPY
//SYSPRINT1 DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=TSOZA60.ES10.CNTL
//SYSUT2 DD DISP=(,CATLG),DSN=TSOZA60.ES10.BACK,
// LIKE=TSOZA60.ES10.CNTL
//SYSIN DD DUMMY
//IFOK1 IF (S1.RC=0) THEN
//*****
//***** COMPRESS DATASET
//*****
//S2 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=TSOZA60.ES10.CNTL
//SYSUT2 DD DISP=OLD,DSN=TSOZA60.ES10.CNTL
//SYSIN DD DUMMY
//IFOKEND1 ENDIF
//IFOK2 IF (S2.RC=0) THEN
//*****
//***** COMPRESS SUCCESSFUL, DELETE BACKUP
//*****
//S3 EXEC PGM=IEFBR14
//DD1 DD DISP=(OLD,DELETE),DSN=TSOZA60.ES10.BACK
//IFOKEND2 ENDIF
// PEND
//FINAL EXEC COMP
//S1.SYSUT1 DD DSN=TSOZA60.COPY.CNTL
//S1.SYSUT2 DD DSN=TSOZA60.ES10.BACK
//S2.SYSUT1 DD DSN=TSOZA60.COPY.CNTL
//S2.SYSUT2 DD DSN=TS0ZA60.COPY.CNTL
//S3.DD1 DD DSN=TSOZA60.ES10.BACK

Related

Run step when previous JCL step did not find file

In the following JCL, the HFS path /u/woodsmn/jjk does not exist. It raises a JCL error and does not run the COPYHFS step, nor any other steps. I want it to detect the missing file, and run the FAILIND step.
I suspect MVS raises a JCL error and completely ignores any COND conditions that might apply. I was hoping it raise some failure step condition code and behave that way.
How can I re-write this to execute steps when a PATH does not exist?
//WOODSMN1 JOB (1111),MSGLEVEL=(1,1),CLASS=A,MSGCLASS=H,
// USER=WOODSMN,REGION=1M
//COPYHFS EXEC PGM=IKJEFT01
//INHFS DD PATH='/u/woodsmn/jjk',
// PATHOPTS=(ORDONLY),RECFM=VB,LRECL=255,BLKSIZE=32760
//OUTMVS DD DSN=WOODSMN.TESTDS1,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(1,1)),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=8080)
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
OCOPY INDD(INHFS) OUTDD(OUTMVS) CONVERT(NO)
/*
//*
//NETVIEW EXEC PGM=IEFBR14,COND=(0,EQ,COPYHFS)
//*
//SUCCIND EXEC PGM=IEBGENER,REGION=1M,COND=(0,EQ,NETVIEW)
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD *
Attempt to put file succeeded
/*
//SYSUT2 DD PATHOPTS=(ORDWR,OTRUNC,OCREAT),PATHMODE=SIRWXU,
// PATHDISP=(KEEP,DELETE),
// PATH='/u/woodsmn/TESTDS.SUCCESS'
//SYSIN DD DUMMY
//*
//FAILIND EXEC PGM=IEBGENER,REGION=1M,COND=(0,GT,NETVIEW)
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD *
Attempt to put file failed
/*
//SYSUT2 DD PATHOPTS=(ORDWR,OTRUNC,OCREAT),PATHMODE=SIRWXU,
// PATHDISP=(KEEP,DELETE),
// PATH='/u/woodsmn/TESTDS.FAIL'
//SYSIN DD DUMMY
//
Use BPXBATCH to execute a shell command to test the existence of your directory.
//EXIST001 EXEC PGM=BPXBATCH,PARM='SH test -e /u/woodsmn/jjk'
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
You may have to get a bit more exotic and use the STDPARM DD to pass a `set -o errexit' to get the return code to work exactly as you wish.
Two things to change:
Firstly, run IKJEFT1B instead of IKJEFT01, because the former will end when a command in SYSTSIN ends with a non-zero returncode, and that return code will become the step return code.
Secondly, allocate the z/OS UNIX file with the ALLOC command just before the OCOPY. ALLOC will return with RC=12 if it cannot allocate the file (for whatever reason).
So, your first step should look like this:
//COPYHFS EXEC PGM=IKJEFT1B
//OUTMVS DD DSN=WOODSMN.TESTDS1,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(1,1)),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=8080)
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
ALLOC F(INHFS) PATH('/u/woodsmn/jjk') -
PATHOPTS(ORDONLY) RECFM(V B) LRECL(255) BLKSIZE(32760)
OCOPY INDD(INHFS) OUTDD(OUTMVS) CONVERT(NO)
/*
You can then test the return code from the COPYHFS step as usual. (And btw, you don't need that NETVIEW step, but instead test the return code from the COPYHFS step directly.)
IKJEFT1B, as well as IKJEFT01, and the third variation IKJEFT1Aare described in Appendix A. Executing the terminal monitor program in the manual z/OS TSO/E Customization.

Possible to send email, with an attachment from the Mainframe?

I have the following code:
//******************************************
//PROC01 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSUT1 DD *
RCPT TO:<MAIL#AR.TEST.COM>
DATA
SOME TEXT GOES HERE
Can I attach a dataset/file into the mail? Thanks.
Try something like:
//******************************************
//PROC01 EXEC PGM=IEBGENER
//EMAIL OUTPUT DEST=EMAIL,
// USERDATA=('FILENAME:attachment.txt',
// 'TO:<MAIL#AR.TEST.COM>',
// 'FILEDESC:Sent from MVS'),
// TITLE=('Sent from MVS'),
// MAILFROM=('<YOURMAIL#AR.TEST.COM>'),
// REPLYTO=('<YOURMAIL#AR.TEST.COM>')
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=Z,OUTPUT=*.EMAIL
//SYSUT1 DD DISP=SHR,DSN=<DSNNAME>
or, if you would like the attachment to be a PDF, something like:
//******************************************
//PROC01 EXEC PGM=IEBGENER
//EMAIL OUTPUT DEST=EMAILPDF,
// USERDATA=('FILENAME:attachment.pdf',
// 'TO:<MAIL#AR.TEST.COM>',
// 'PDFPGSIZ=(826,1169)',
// 'PDFFONT=(COURIER,8)',
// 'FILEDESC:Sent from MVS'),
// TITLE=('Sent from MVS'),
// MAILFROM=('<YOURMAIL#AR.TEST.COM>'),
// REPLYTO=('<YOURMAIL#AR.TEST.COM>')
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=Z,OUTPUT=*.EMAIL
//SYSUT1 DD DISP=SHR,DSN=<DSNNAME>
Hope this works for you :)
You should be able to just add card:
// DD DSN=,DISP=SHR
to the end of your existing job. We use this style all the time. Using the OUTPUT card is also an option, as previously noted.

How to write jcl to make dbdgen

I write jcl 4 dbdgen:
//C EXEC PGM=ASMA90,REGION=8M,
// PARM=(OBJECT,NODECK,NODBCS,'SIZE(MAX,ABOVE)')
//SYSIN DD DSN=USER19.DBDSRC(LIBDBD),DISP=SHR
//SYSLIB DD DSN=DFSD10.SDFSMAC,DISP=SHR
//SYSLIN DD UNIT=SYSDA,DISP=(,PASS),
// SPACE=(80,(100,100),RLSE),
// DCB=(BLKSIZE=80,RECFM=F,LRECL=80)
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD UNIT=SYSDA,DISP=(,DELETE),
// SPACE=(CYL,(10,5))
//L EXEC PGM=HEWL,PARM='XREF,LIST',
// COND=(0,LT,C),REGION=120K
//SYSLIN DD DSN=*.C.SYSLIN,DISP=(OLD,DELETE)
//SYSPRINT DD SYSOUT=*
//SYSLMOD DD DISP=SHR,
// DSN=USER19.DBDLIB(LIBDBD)
//SYSUT1 DD UNIT=(SYSDA,SEP=(SYSLMOD,SYSLIN)),
// SPACE=(1024,(100,10),RLSE),DISP=(,DELETE)
And have 8 rc.
I think, that it is problem with asma, am i right?
Have anybody any ideas to repair my programm?>

How to get text in my new member using JCL

I have to make a new member in a JCL. This isn't a problem:
My code:
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD *
//SYSUT2 DD DISP=(NEW,KEEP),UNIT=SYSALLDA,DSN=name.JCL4(MEMBER),
SPACE=(CYL,(1,1,45)),
VOL=SER=DMTU01
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
/*
But I want that my MEMBER1 contains text.
So when I go in JCL4 and I press an e (edit) before MEMBER, I want to see some text like 'Hallo'. Can someone help me to explain how to do this?
If you are creating a new member in an existing JCL dataset, Try:
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD *
Hello
/*
//SYSUT2 DD DSN=name.JCL4(MEMBER),DISP=(SHR,KEEP)
//SYSIN DD DUMMY
/*
The Disp refers to the dataset and not the member. so if the dataset already exists, you do not need to create it !!.
If you want create a new JCL dataset and a member at the same time,
the JCL should be like (where you catlg the dataset)
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD *
Hello
/*
//SYSUT2 DD DSN=name.JCL4(MEMBER),DISP=(NEW,CATLG),
// UNIT=SYSALLDA, should this be sysda ???
// SPACE=(CYL,(1,1,45)),
// VOL=SER=DMTU01
//SYSIN DD DUMMY
/*

UNIDENTIFIED OPERATION FIELD Error in JCL

I tried to run this following JCL program using IBM z/OS
//PAYMENT JOB MSGCLASS=H
//PAYMENT EXEC PGM=PAYMENT,REGION=1024K
// PARM='CSQ1,CARD.PAYMENTS,IND0163.REPLY,IND0163
// 5999.99,"MY PAYMENT"'
//STEPLIB DD DSN=ZOS.CONTEST3.PART2.LOAD,DISP=SHR
// DD DSN=WMQ.V6R0.SCSQLOAD,DISP=SHR
// DD DSN=WMQ.V6R0.SCSQANLE,DISP=SHR
// DD DSN=WMQ.V6R0.SCSQAUTH,DISP=SHR
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
but after submission of the job ,when I'm trying to view the job output using SDSF , I'm getting IEFC605I UNIDENTIFIED OPERATION FIELD on line 3 and 4 !! can anyone tell me what's wrong with my program ...
Try ending lines 2 and 3 with a comma so the JCL reader knows that these lines are not yet complete (ie. continue on the following line).
//PAYMENT JOB MSGCLASS=H
//PAYMENT EXEC PGM=PAYMENT,REGION=1024K, <== continued...
// PARM='CSQ1,CARD.PAYMENTS,IND0163.REPLY,IND0163, <== continued...
// 5999.99,"MY PAYMENT"'
//STEPLIB DD DSN=ZOS.CONTEST3.PART2.LOAD,DISP=SHR
// DD DSN=WMQ.V6R0.SCSQLOAD,DISP=SHR
// DD DSN=WMQ.V6R0.SCSQANLE,DISP=SHR
// DD DSN=WMQ.V6R0.SCSQAUTH,DISP=SHR
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//SYSPRINT DD SYSOUT=*