IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Adding cobol display after every para through rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
akhil_rai

New User


Joined: 15 Jul 2010
Posts: 3
Location: kolkata

PostPosted: Thu Jul 15, 2010 12:49 pm
Reply with quote

Hi all,
I want to add display statement after every para thrugh rexx for cobol program testing.For example

2551-TITULO-SUC.
MOVE 264 TO SIS-NUMER.
MOVE 10 TO SIS-PRG-NP.
MOVE 71 TO CLAVE-RANGO-L100.
MOVE 0 TO CLAVE-NUEVA-L100
for this para I want Rexx to scan from 8th line for a single word ending with a full stop and display "Inside 2551-TITULO-SUC para" So please help me for achieving this.
Back to top
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Thu Jul 15, 2010 12:54 pm
Reply with quote

Hi Akhil,
I'll give some hints,

a) Yoy have to write one edit macro which is needs to execute after opening your cobol code.
b)In the edit macro, you have to read your program and scan each line(you can use the STEM logic).
c) Once you got the Para name you can insert the line in Cobol code.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jul 15, 2010 12:54 pm
Reply with quote

Not too sure that you have described your requiremnt too clearly.
Is it after every PARA that you want to display, or only a selected PARA.
Is there (not being a COBOLER) something that designates a new paragraph in the code.
Please elaborate and give an example of the COBOL code for us non proggies. - Also to use the code tags
Code:
 
[code]  Your code here [/code]
Back to top
View user's profile Send private message
akhil_rai

New User


Joined: 15 Jul 2010
Posts: 3
Location: kolkata

PostPosted: Thu Jul 15, 2010 1:00 pm
Reply with quote

My program is of 1,20,000 lines having at least 400 paras so I want display in every paragraph.I am new to rexx .
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jul 15, 2010 1:08 pm
Reply with quote

bipinpeter wrote:
b)In the edit macro, you have to read your program and scan each line(you can use the STEM logic).
Why bother reading the whole file when ISPF "F" will find what is required. This approach is only used when a file is too large to edit directly in ISPF - although I may tend to use a different approach in that situation.

@ akhil_rai
Please read my previous post and supply the requested information. I DO NOT want the whole code, just enough so that I as a non COBOLER can see how to distinguish a paragraph start / end. As previously explained.
Back to top
View user's profile Send private message
akhil_rai

New User


Joined: 15 Jul 2010
Posts: 3
Location: kolkata

PostPosted: Thu Jul 15, 2010 1:13 pm
Reply with quote

it is a sample two para codes, first 6 colms are for tags seventh column * comments the whole line and from the 8th column the definition of para begins I want to check the flow of whole program through these paras.I have to manually insert display statements after every para.Para declaration ends with a . and it is a single word starting from 8th column.


Code:
209700 2102000-SAMPLE-1.
209800*=====================
209900     IF STATUS = 10 OR 21 OR 40
210000        IF FE-DATE < WKS-DATE
210100           IF VALUE-1 < 20
210200              ADD      1              TO WKS-ACS-2301R
210300              ADD IMPORT         TO WKS-ACS-2301I
210400           ELSE
210500            IF VALUE-1 < 30
210600               ADD      1             TO WKS-ACS-2302R
210700               ADD IMPORTE        TO WKS-ACS-2302I
210800            ELSE
210900             IF VALUE-1 < 40
211000                ADD      1            TO WKS-ACS-2304R
211100                ADD IMPORT       TO WKS-ACS-2304I.
211200
211300     PERFORM                          PARA-1.
211400     MOVE WKS-IMPORTE                 TO IMPORTE.
211500     MOVE 1                           TO WKS-I.
211600     PERFORM                          PARA-2.
211700*
211800 PARA-1.
211900*=======================
212000     IF VIG-STATUS = 20
212100        MOVE DATE-1              TO DATE-2
212200        MOVE PAGO             TO WKS-PAGO.
212300        MOVE 1                        TO A01-STATUS.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jul 15, 2010 1:24 pm
Reply with quote

Do you notice how much easier your code is to read after I applied the code tags previously mentioned.

Click HERE to see an example of a basic REXX / ISPF edit macro to do almost what you want to do.

I know that you will probably have difficulties in understanding the code first time out, so try and understand it and come back with some more questions once you have tried a few things.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jul 15, 2010 1:27 pm
Reply with quote

do a search on member
Anuj Dhawan
who wrote a rexx for this very purpose,
and recently had to provide support to another rookie
who could not manage on his own to accomplish this.

oh, and the next time you post code, use BBcode to perserve the spacing . what you have there is difficult to read,
and one can not tell that only the paragraphs begin in column 8.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jul 15, 2010 4:24 pm
Reply with quote

you can start with this link
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Jul 15, 2010 5:23 pm
Reply with quote

You may also use DISPARA (available at file 357 in CBT).

O.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
Search our Forums:

Back to Top