Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

CLIST FOR CHECKING COBOL STANDARDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
anoop_pv

New User


Joined: 25 Feb 2006
Posts: 2

PostPosted: Fri Feb 08, 2008 6:52 pm    Post subject: CLIST FOR CHECKING COBOL STANDARDS
Reply with quote

Hi all,

I have one cobol pgm which can be used for checking the cobol standards. I want to use a clist prog for invocking the program and list down the coding errors, but the problem now is this clist code is not working. I have attached all the clist codes I'm using ......... if anybody can help me on this asap...........pls help it's very urjent


the pgm works like if we type COBCHECK IT WILL LIST DOWN THE ERRORS AT SPECIFIC LINES AND WE CAN CHANGE & SAVE



COBCHECK

ISREDIT MACRO (LEVEL)

/*
/* CHECKS A PROGRAM TO SEE IF ERROR LOGGING IS CODED CORRECTLY
/*

/* CONTROL FLUSH MSG LIST CONLIST SYMLIST

SET XAMSGLVL = 1
IF &LEVEL = THEN GOTO CHNGCHK
IF &SUBSTR(1:3,&LEVEL) = ERR THEN SET XAMSGLVL = 3
IF &SUBSTR(1:3,&LEVEL) = WAR THEN SET XAMSGLVL = 2

CHNGCHK:-
ISREDIT (DATACHNG) = DATA_CHANGED
IF &DATACHNG = YES THEN +
DO
WRITE YOU MUST SAVE THE SOURCE BEFORE RUNNING THIS CLIST
EXIT
END
/* OBTAIN MEMBER NAME
ISREDIT (PROGNAME) = MEMBER

/* OBTAIN DATASET NAME
ISREDIT (DWLIB) = DATASET

ISPEXEC VPUT (PROGNAME DWLIB XAMSGLVL) PROFILE
COBCHKPR
ISREDIT COBCHKMS

CONTROL NOMSG
DELETE &PROGNAME..MSGLIST
CONTROL MSG

EXIT




COBCHKPR

PROC 0 TEST

/*
/* CHECKS A PROGRAM TO SEE IF ERROR LOGGING IS CODED CORRECTLY
/*

/* CONTROL FLUSH MSG LIST CONLIST SYMLIST
ISPEXEC VGET (PROGNAME DWLIB XAMSGLVL) PROFILE

CONTROL NOMSG
FREE ATT(CRATTR)
DELETE TEMP.SYSIN
DELETE &PROGNAME..MSGLIST
FREE F(CR2)
CONTROL MSG
SYSIN: -
SET &LIST = TEMP.SYSIN
ATTRIB CRATTR BLKSIZE(19040) LRECL(80) RECFM(F B)
ALLOC DA(&LIST) DD(CR2) USING(CRATTR) NEW REUSE -
SPACE (1 1) TRACKS
OPENFILE CR2 OUTPUT
SET CR2 = &PROGNAME
PUTFILE CR2
SET CR2 = &XAMSGLVL
PUTFILE CR2
CLOSFILE CR2
FREE F(CR2)
RUNPROG: -
ALLOC FILE(SYSIN) DA(TEMP.SYSIN) SHR REUSE
ALLOC FILE(UT01) DA('&DWLIB(&PROGNAME)') SHR
ALLOC FILE(UT11) DA(&PROGNAME..MSGLIST) USING(CRATTR) NEW REUSE -
SPACE (5 5) TRACKS

CALL 'ALCHEML.XAPR1.##.B.LOADLIB(PXUCOBCK)'

CONTROL NOMSG
FREE F(SYSIN)
FREE F(UT01)
FREE F(UT11)
DELETE TEMP.SYSIN
FREE ATT(CRATTR)
CONTROL MSG

EXIT



COBCHKMS


/*
/* EDIT MACRO - DISPLAY ERROR LOGGING MESSAGES IN SOURCE
/*
ISREDIT MACRO

ISREDIT (MAXLINE) = LINENUM .ZLAST

ERROR +
DO
SET RCODE=&LASTCC
IF &RCODE = 400 THEN SET EOF = EOF
RETURN
END

ISREDIT RESET

SET EOF =
SET RCODE = 0

/* CONTROL FLUSH MSG LIST CONLIST SYMLIST
ISPEXEC VGET (PROGNAME) PROFILE

SET COLHDR1 = &STR(----+----1----+----2----+----3----+----4)
SET COLHDR2 = &STR(----+----5----+----6----+----7)
SET COLHDRST = &STR(&COLHDR1&COLHDR2)

OPENLIST: -
ALLOC FILE(CR1) DA(&PROGNAME..MSGLIST) SHR

OPENFILE CR1 INPUT

SET CURRLN = 0
LOOP: -
GETFILE CR1

IF &EOF = EOF THEN GOTO THEEND

SET LINENUM = &SUBSTR(1:6,&CR1)

SET ERRMSG = &SUBSTR(9:80,&CR1)

IF &LINENUM = 0 THEN +
DO
ISREDIT LINE_AFTER &LINENUM = INFOLINE (ERRMSG)
GOTO LOOP
END

IF &LINENUM = 999999 THEN +
DO
ISREDIT LINE_AFTER &MAXLINE = MSGLINE (ERRMSG)
GOTO LOOP
END

ISREDIT LINE_BEFORE &LINENUM = MSGLINE (ERRMSG)

IF &SYSINDEX(COL,&ERRMSG) ¬= 0 THEN SET COLHDR = Y
ELSE SET COLHDR = N

IF &LINENUM = &CURRLN THEN SET COLHDR = N

IF &COLHDR = Y THEN +
ISREDIT LINE_BEFORE &LINENUM = INFOLINE (COLHDRST)

SET CURRLN = &LINENUM

GOTO LOOP

THEEND:-
SET ERRMSG = &STR(USE L MSGLINE TO FIND NEXT MESSAGE)
ISREDIT LINE_BEFORE 1 = INFOLINE (ERRMSG)
ISREDIT LOCATE FIRST SPECIAL
CLOSFILE CR1
FREE F(CR1)
EXIT
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Feb 08, 2008 7:04 pm    Post subject:
Reply with quote

A couple of points ..........

1) This may be urgent to you, but certainly not to anyone else who contributes to the forum, so please do not use urgent in your thread or title.

2) In what way is the CLIST not working, Has it been changed recently.

3) What have you done to trace the point / reason of failure.

4) Try not to use attachments in your posts, as I, like many other users of this forum am not permitted to open them, so if they contained critical information - I and many others can not read it.
Back to top
View user's profile Send private message
anoop_pv

New User


Joined: 25 Feb 2006
Posts: 2

PostPosted: Sat Feb 09, 2008 3:03 pm    Post subject: Reply to: CLIST FOR CHECKING COBOL STANDARDS
Reply with quote

for COBCHECK i' getting an error like macro level error & the error message is like incorrect usage &LEVEL
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us