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
 

 

BEGIN\END with contains clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: BEGIN\END with contains clause
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

Site Director


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

PostPosted: Tue Nov 02, 2010 8:31 pm    Post subject:
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    Post subject: Re: BEGIN\END with contains clause
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: 6968
Location: porcelain throne

PostPosted: Tue Nov 02, 2010 9:42 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm
No new posts [SQL0029] INTO clause missing from em... HABBIE DB2 2 Fri Sep 04, 2015 3:54 pm
No new posts 3-D Table with nested DEPENDING ON Cl... VivekKhanna COBOL Programming 5 Sat Aug 08, 2015 11:18 pm
No new posts when=group clause: question about the... tuxama DFSORT/ICETOOL 2 Thu Mar 26, 2015 12:51 pm
No new posts Help with WHEN=GROUP,BEGIN= techslam DFSORT/ICETOOL 5 Thu Jul 24, 2014 12:34 pm


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