Joined: 02 Dec 2002 Posts: 151 Topics: 3 Location: Perth, Western Australia
Posted: Fri Jan 10, 2003 6:36 am Post subject:
There is no REXX code for JEM. The driver is in assembler, the scripts are in COBOL (used to be), and the ISPF interface is CLIST... _________________ Dave Crayford
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri Jan 10, 2003 6:58 am Post subject:
Nila,
Yes you need to check your jcl for syntax errors. JEM is a good tool but it is a TOOL from diversified software. Your shop should buy it.It seems that your shop does not have JEM. So ask around your co-workers as to which tool they use to check the syntax errors.If none of the tools exist then you can use TYPRUN Parameter to check the syntax.
Joined: 02 Dec 2002 Posts: 151 Topics: 3 Location: Perth, Western Australia
Posted: Fri Jan 10, 2003 7:37 am Post subject:
JEM works by smoke and mirrors, it's not really that flash. It uses JES2 services and exits to execute JCL in a dummy initiator and then sets traps and parses the output. OK, you can tailor it and it's a good product but that's just about all the smarts it has.
I liked it, but I didn't like the COBOL scripts (even though they had a rule builder). They should have used REXX...
You can write your own REXX edit macros to emulate some of JEMs features. What exactly do you want to do? I'm sure we can help you... _________________ Dave Crayford
Joined: 02 Dec 2002 Posts: 70 Topics: 19 Location: California
Posted: Fri Jan 10, 2003 9:24 pm Post subject:
Nila,
Try JSCAN if you have it your shop. _________________ Venkataramana
-- Good judgement comes from experience, and often experience comes from bad judgement.
Joined: 03 Dec 2002 Posts: 114 Topics: 0 Location: Sydney, Australia
Posted: Mon Jan 13, 2003 5:59 pm Post subject:
Nila,
I doubt that anyone would supply the code as it's a little more than trivial (now I've thrown the gauntlet down ).
How about tying the following. Run the JCL using TYPRUN=SCAN, place the JESJCL output into a dataset, this will resolve the symbolics and expands the procedure. EDIT the dataset and use X ALL followed by F 'DSN=' ALL, followed by F 'DSNAME=' ALL to find all the encoded dataset names. You can then convert the DSN=.... statements into LISTC statements and then use this dataset as input to IDCAMS to check that the datasets exist. You might want to run a sort before the IDCAMS to eliminate duplicates.
While undertaking this you would be able to work out additional edit commands that could assist (e.g. X 'DSN=&&' to get rid of temporary datasets). _________________ Regards,
Mike.
Joined: 14 Jan 2003 Posts: 13 Topics: 0 Location: Morgan Hill, CA,USA
Posted: Wed Jan 15, 2003 11:58 pm Post subject:
HI Nila
JEM is one of a few Edit Macros that are part of JOB/SCAN. Besides using it for JCL Validation, you can also enforce site specific JCL standards. There are other Edit Macros available for JCL reformatting/alignment, and for making JCL Changes. Using either JEM (Edit Mode) or JSCAN (Browse/View Mode), you can have the PROCS expanded as long as the Procedure libraries are defined in the JOB/SCAN PARMLIB library, in member JSOPT02 (default member shipped). If you would like more information about JOB/SCAN from Diversified Software, please forward me an Email at doug.berg@diversifiedsoftware.com
Joined: 02 Dec 2002 Posts: 151 Topics: 3 Location: Perth, Western Australia
Posted: Thu Jan 16, 2003 8:47 am Post subject:
Without wasting too many cluons it's pretty easy to knock up a quick and dirty REXX. It will take a bit more engineering to resolve symbolics and check data set dispostions etc... But it's a start
Code:
/* REXX check for invalid data set names and uncataloged data sets */
address ISREDIT
"MACRO"
"(USERSTAT) = USER_STATE"
"FIND 'DSN=' FIRST"
do while rc = 0
"(JCLLINE) = LINE .ZCSR"
"(ROW,COL) = CURSOR"
parse var jclline 'DSN=' dsn ',' .
/* don't handle symbolics or temporary datsets (yet) */
if left(dsn,1) <> '&' then do
dsn = strip(dsn)
call msg 'OFF'
call listdsi "'"strip(dsn)"'"
select
when sysreason = 1 then do
"LINE_BEFORE "row" = INFOLINE '"dsn" - Invalid dataset name'"
"LINE_BEFORE 1 = INFOLINE '"row": "dsn" - Invalid dataset name'"
end
when sysreason = 5 then do
"LINE_BEFORE "row" = INFOLINE 'Dataset "dsn" not cataloged'"
"LINE_BEFORE 1 = INFOLINE '"Row": Dataset "dsn" not cataloged'"
end
otherwise nop
end
end
"FIND 'DSN=' NEXT"
end
/***************************** REXX ***********************************/
/* */
/* THIS REXX PROGRAM IS INTENDED TO EXPAND THE PROC */
/* */
/* ----> MIBOY MATHEW */
/**********************************************************************/
00000_START_RTN:
"ISREDIT MACRO NOPROCESS"
IF RC > 0 THEN
DO
"%MACROERR"
EXIT
END
DO UNTIL PRC_EXPND_ENDED = 'Y'
CALL 30000_CREATE_OUTPUT
IF PRC_EXPND_ENDED = 'N' THEN CALL 70000_TEMP_OUTPUT
ELSE
DO
CALL 35000_PROC_ORDER
CALL 71000_WRITE_OUTPUT
END
END
DO CNT1 = 1 TO LASTLINE
SELECT
WHEN POS(' EXEC ',PROCLINE.CNT1) > 0 &,
SUBSTR(PROCLINE.CNT1,1,3) ^= '//*' &,
SUBSTR(PROCLINE.CNT1,1,3) ^= '//!' &,
POS(' PGM=',PROCLINE.CNT1) = 0 THEN
DO
IF EXEC_FOUND = 'Y' THEN CALL 34000_END_MSG
TEMPNAME = WORD(PROCLINE.CNT1,3)
COMMA = SUBSTR(TEMPNAME,LENGTH(TEMPNAME),1)
PRCCOMMA = POS(",",TEMPNAME)
IF PRCCOMMA > 0 THEN PROCNAME = SUBSTR(TEMPNAME,1,PRCCOMMA-1)
ELSE PROCNAME = TEMPNAME
CALL 31000_ALLOC_AND_READ_RTN
CALL 33000_START_MSG
OUTCNT = OUTCNT + 1
OUTPUT.OUTCNT = '//!'||,
SUBSTR(PROCLINE.CNT1,3,LENGTH(PROCLINE.CNT1)-2)
IF COMMA ^= ',' THEN CALL 32000_EXPAND_PROC
ELSE PROC_FOUND = 'Y'
PRC_EXPND_ENDED = 'N'
EXEC_FOUND = 'Y'
END
WHEN PROC_FOUND = 'Y' &,
SUBSTR(PROCLINE.CNT1,1,3) ^= '//*' THEN
DO
OUTCNT = OUTCNT + 1
OUTPUT.OUTCNT = PROCLINE.CNT1
TEMPNAME = WORD(PROCLINE.CNT1,2)
COMMA = SUBSTR(TEMPNAME,LENGTH(TEMPNAME),1)
IF COMMA ^= ',' THEN
DO
PROC_FOUND = 'N'
CALL 32000_EXPAND_PROC
END
END
WHEN POS(' EXEC ',PROCLINE.CNT1) > 0 &,
SUBSTR(PROCLINE.CNT1,1,3) ^= '//*' &,
SUBSTR(PROCLINE.CNT1,1,3) ^= '//!' &,
EXEC_FOUND = 'Y' &,
POS(' PGM=',PROCLINE.CNT1) > 0 THEN
DO
CALL 34000_END_MSG
OUTCNT = OUTCNT + 1
OUTPUT.OUTCNT = PROCLINE.CNT1
END
OTHERWISE
DO
OUTCNT = OUTCNT + 1
OUTPUT.OUTCNT = PROCLINE.CNT1
END
END
END
IF EXEC_FOUND = 'Y' THEN CALL 34000_END_MSG
RETURN
31000_ALLOC_AND_READ_RTN:
"ISPEXEC CONTROL DISPLAY LOCK"
"ISPEXEC DISPLAY PANEL(EXNDJCLS)"
PROCLIB_FOUND = 'N'
DO CNT2 = 1 TO PRCALLOC_CNT
EXPND_LIB = PRCALLOC.CNT2
LIBRARY = PRCALLOC.CNT2"("PROCNAME")"
IF SYSDSN("'"LIBRARY"'") = 'OK' THEN
DO
PROCLIB_FOUND = 'Y'
LEAVE
END
END
IF PROCLIB_FOUND = 'N' THEN RETURN
"ALLOCATE FILE(PROCDD) DA('"LIBRARY"') SHR REU"
IF RC ^= 0 THEN DO
ZEDLMSG = "ERROR IN ALLOCATING COPYBOOK " LIBRARY ", RC : ",
RC
"ISPEXEC SETMSG MSG(ISRZ001)"
EXIT CODE(12)
END
REXX to do substitutes for the symbolics in a PROC
Code:
/***************************** REXX ***********************************/
/* */
/* THIS REXX PROGRAM IS INTENDED TO EXPAND THE PROC */
/* */
/* ----> MIBOY MATHEW */
/**********************************************************************/
00000_START_RTN:
"ISREDIT MACRO NOPROCESS"
IF RC > 0 THEN
DO
"%MACROERR"
EXIT
END
"ISREDIT (CURRLINE) = LINENUM .ZCSR"
"ISREDIT (CURRDATA) = LINE .ZCSR"
FRSTWORD = SUBSTR(CURRDATA,1,3)
TEMPWORD = WORD(CURRDATA,3)
IF LENGTH(TEMPWORD) > 0 THEN
COMMA = SUBSTR(TEMPWORD,LENGTH(TEMPWORD),1)
ELSE
RETURN
DO WHILE COMMA = "," |,
FRSTWORD = '//*'
IF FRSTWORD = '//*' THEN CALL 32000_CAPTURE_NEXT_LINE
ELSE
DO
CALL 31000_GET_PARAM_ON_LINE
CALL 32000_CAPTURE_NEXT_LINE
END
END
/*TRACE I*/
"ISREDIT FIND '&' ALL"
DO WHILE RC = 0
"ISREDIT (CURRLINE,CURRCOL) = CURSOR"
"ISREDIT (CURRDATA) = LINE .ZCSR"
IF SUBSTR(CURRDATA,1,3) ^= '//*' THEN CALL 41000_SUBS_LINE
"ISREDIT RFIND"
END
DO CNT1 = CURRCOL TO LENGTH(CURRDATA)
CURRCHAR = SUBSTR(CURRDATA,CNT1,1)
SELECT
WHEN END_OF_AMPERSAND = 'N' THEN
DO
IF POS(CURRCHAR,DELIMIT) > 0 THEN
DO
IF LENGTH(PROCPARM.SUBCHAR) = 0 THEN
TEMPLINE = TEMPLINE||'@'||SUBCHAR
ELSE
TEMPLINE = TEMPLINE||PROCPARM.SUBCHAR
IF CURRCHAR ^= '.' & CURRCHAR ^= '&' THEN
TEMPLINE = TEMPLINE||CURRCHAR
IF CURRCHAR = '&' THEN CNT1 = CNT1 - 1
SUBCHAR = ''
END_OF_AMPERSAND = ''
END
ELSE SUBCHAR = SUBCHAR||CURRCHAR
END
WHEN CURRCHAR = '&' THEN
DO
IF CNT1 < LENGTH(CURRDATA) &,
SUBSTR(CURRDATA,CNT1+1,1) = '&' THEN
DO
CNT1 = CNT1 + 1
TEMPLINE = TEMPLINE||'@@'
END
ELSE
DO
END_OF_AMPERSAND = 'N'
NOTELINE = 'Y'
END
END
OTHERWISE
TEMPLINE = TEMPLINE||CURRCHAR
END
END
IF NOTELINE = 'Y' THEN
"ISREDIT LINE_AFTER .ZCSR = DATALINE '"TEMPLINE"'"
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum