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

BEGIN\END with contains clause


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Deepika Pai

New User


Joined: 13 May 2010
Posts: 7
Location: India

PostPosted: Tue Nov 02, 2010 12:42 pm
Reply with quote

Hello,

I have situation where I have an IFTHEN when=group, BEGIN=(6,6,CH,EQ,C'CALL') and I want to end when it finds a period.But since the position of a period might vary from 6 to 72 in a COBOL program. How I can check for a contains clause in END= clause?

Thanks!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Nov 02, 2010 8:31 pm
Reply with quote

Hello,

Suggest you post some sample "input" source code and how you want your process to work with the sample code.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Nov 02, 2010 9:30 pm
Reply with quote

Deepika Pai wrote:
Hello,

I have situation where I have an IFTHEN when=group, BEGIN=(6,6,CH,EQ,C'CALL') and I want to end when it finds a period.But since the position of a period might vary from 6 to 72 in a COBOL program. How I can check for a contains clause in END= clause?

Thanks!


Which version of cobol lets you code a CALL statement in position 6?

You can use SS format for the variable string search.

Assuming the call statement is always in position 8, the following DFSORT JCL will give you the desired results
Code:

//STEP0100 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                     
       CALL PROG-A.                                 
       DONT TAG THIS LINE                           
       CALL PROG-B                                   
       TAG ME LINE.                                 
       CALL PROG-C                                   
          TAG LINE1                                 
                       TAG LINE2.                   
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                     
  SORT FIELDS=COPY                                   
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(8,4,CH,EQ,C'CALL'),
                END=(8,64,SS,EQ,C'.'),PUSH=(40:ID=2))
//*
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Nov 02, 2010 9:42 pm
Reply with quote

a line in a COBOL source program
(to repeat and paraphrase what is stated in the manuals)
is:
1-6 unused by compiler
7 used by either comment or debug notation
8-71 contains data description entries or procedure division entries
72-80 unused by compiler

1-6 and/or 72-80 can be line numbers depending upon the edit profile usage.

as Kolusu asked, why are you looking in card-column 6 for anything?
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To search DB2 table based on Conditio... DB2 1
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts NOT IN clause in COBOL pgm COBOL Programming 8
No new posts SUSBSCRIPT WITH SIGN IN PIC CLAUSE COBOL Programming 3
No new posts usage of CASE in WHERE clause DB2 10
Search our Forums:

Back to Top