chynna_v
New User
Joined: 22 Apr 2005 Posts: 6
|
|
|
|
I'm currently working on a converter code.
what im trying to do is to fix the relative position of a JCL control card assuming that the restart parameter is the last one in the job deck to be converted. For ex.
JOB123 JOB (x,xxxx,XX1234),
CLEANSHEET.PROD,
CLASS=Q,
MSGLEVEL=(1,1),
MSGCLASS=L,
USER=XXXXX,
RESTART=xxxxxxxx.xxxxx
the part of the converter code is
*converter code*
ISREDIT FIND ALL 'RESTART='
SET &CCLAST = &LASTCC
IF (&CCLAST = 0) THEN DO
ISREDIT LINE_AFTER .ZCSR = "//* "
ISREDIT LINE_AFTER .ZCSR = "&JL4"
ISREDIT LINE_AFTER .ZCSR = "&JL3"
ISREDIT LINE_AFTER .ZCSR = "//* "
ISREDIT LINE_AFTER .ZCSR = "&JL2A"
ISREDIT LINE_AFTER .ZCSR = "//* "
ISREDIT LINE_BEFORE .ZCSR = "&JL1"
ISREDIT LINE_BEFORE .ZCSR = "&JL2.,"
ISREDIT FIND ALL ','
END
ELSE DO /* if there is no RESTART parameter found*/
ISREDIT LINE_BEFORE .ZCSR = "&JL1"
ISREDIT LINE_BEFORE .ZCSR = "&JL2"
ISREDIT LINE_BEFORE .ZCSR = "//* "
ISREDIT LINE_BEFORE .ZCSR = "&JL2A"
ISREDIT LINE_BEFORE .ZCSR = "//* "
ISREDIT LINE_BEFORE .ZCSR = "&JL3"
ISREDIT LINE_BEFORE .ZCSR = "&JL4"
ISREDIT LINE_BEFORE .ZCSR = "//* "
END
after converting the results will be...
//*
/*JOBPARM S=200D
//*
//** DATE: CREATED BY:
//** FROM: USER:
//*
//JOB123 JOB (X,Xxxx,XX1234),CLNSHEET,MSGLEVEL=(1,1),
//CLASS=Q,MSGCLASS=L,NOTIFY=&SYSUID,USER=XXXXX,
// RESTART=xxxxxxxx.xxxxx
The problem occurs when there are several JCL that have this format
JOB123 JOB (x,xxxx,xx1234),
CLEANSHEET.PROD,
CLASS=Q,
RESTART=xxxxx.xxxxx,
MSGLEVEL=(1,1),
MSGCLASS=L
The above code (converter code) will produce RESTART with a ",". Since the restart line already has a comma.
//*
/*JOBPARM S=200D
//*
//** DATE: CREATED BY:
//** FROM: USER:
//*
//JOB123 JOB (X,Xxxx,XX1234),CLNSHEET,MSGLEVEL=(1,1),
//CLASS=Q,MSGCLASS=L,NOTIFY=&SYSUID,USER=XXXXX,
// RESTART=xxxxxxxx.xxxxx,
causing a JCL error.
I was thinking to add a line in the code whose function is to check whether or not the last RESTART line has a comma or not, but im still trying to implement it. In the meantime can you please give other suggestions? Thanks! |
|
chynna_v
New User
Joined: 22 Apr 2005 Posts: 6
|
|
|
|
correction
there should be no
"ISREDIT FIND ALL ',' " before END
corrected converter code:
ISREDIT FIND ALL 'RESTART='
SET &CCLAST = &LASTCC
IF (&CCLAST = 0) THEN DO
ISREDIT LINE_AFTER .ZCSR = "//* "
ISREDIT LINE_AFTER .ZCSR = "&JL4"
ISREDIT LINE_AFTER .ZCSR = "&JL3"
ISREDIT LINE_AFTER .ZCSR = "//* "
ISREDIT LINE_AFTER .ZCSR = "&JL2A"
ISREDIT LINE_AFTER .ZCSR = "//* "
ISREDIT LINE_BEFORE .ZCSR = "&JL1"
ISREDIT LINE_BEFORE .ZCSR = "&JL2.,"
END
ELSE DO /* if there is no RESTART parameter found*/
ISREDIT LINE_BEFORE .ZCSR = "&JL1"
ISREDIT LINE_BEFORE .ZCSR = "&JL2"
ISREDIT LINE_BEFORE .ZCSR = "//* "
ISREDIT LINE_BEFORE .ZCSR = "&JL2A"
ISREDIT LINE_BEFORE .ZCSR = "//* "
ISREDIT LINE_BEFORE .ZCSR = "&JL3"
ISREDIT LINE_BEFORE .ZCSR = "&JL4"
ISREDIT LINE_BEFORE .ZCSR = "//* "
END |
|