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

jcl-stop condition


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

New User


Joined: 08 Mar 2005
Posts: 62
Location: Basildon

PostPosted: Fri Aug 05, 2005 8:05 pm
Reply with quote

hello guys i have a problem can any body give solution for that it should be only on jcl not in cobol

i have a vsam esds file which has record like this


aaaaa 3
xabaaaa 53
fcxaaaaaa 534
xaaaaa 53
vaaeaaa67766
avaaaa6676
eeeee end of day record--------
eaaaaa 53
vaaeaaa67766
avaaaa6676


i want to copy the records from the above file and put it another vsam esds file but the condition

is the should top copying if it finds letter e in the first char of the record
and it has to copy the records until it finds the letter e.


can any body give solution for this since
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sun Aug 07, 2005 8:25 pm
Reply with quote

In private notes, we established that rsshanmugam wants to copy up to but not including the first record with an 'e' in position 1. Here's a DFSORT job that will do that. It generates an OPTION STOPAFT=n statement with n equal to the relative record number of the target record minus 1. In the above example, n=7-1=6. Note that it will actually generate an OPTION STOPAFT=n statement for each record with an 'e' in position 1, but DFSORT will only use the first one and ignore the others as duplicate control statements.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
aaaaa 3
xabaaaa 53
fcxaaaaaa 534
xaaaaa 53
vaaeaaa67766
avaaaa6676
eeeee end of day record--------
eaaaaa 53
vaaeaaa67766
avaaaa6676
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
 COPY FROM(IN) USING(CTL1)
 COPY FROM(IN) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:SEQNUM,8,ZD)
  OUTFIL FNAMES=CTL2CNTL,REMOVECC,
    INCLUDE=(1,1,CH,EQ,C'e'),
    OUTREC=(C' OPTION STOPAFT=',81,8,ZD,SUB,+1,M11,LENGTH=8,80:X)
/*
//CTL2CNTL DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)
Back to top
View user's profile Send private message
stalin.i@gmail.com

New User


Joined: 18 Apr 2005
Posts: 8
Location: chennai

PostPosted: Tue Aug 09, 2005 10:34 pm
Reply with quote

hai frank,
i am rssshanmugam's teammate. first of all i would like to thank you for your response.

the JCL abends with maxcc 16 when i used this

Code:

  INREC OVERLAY=(81:SEQNUM,8,ZD)
            $


i changed it to

Code:

  INREC FIELDS=(1:1,80,81:SEQNUM,8,ZD)


and the JCL works well. now i want to know

1. why overlay is not working. we r using DFSORT version 14 (not sure)?

2. what should i do if the file is varying length type?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Aug 09, 2005 10:51 pm
Reply with quote

Quote:
1. why overlay is not working. we r using DFSORT version 14 (not sure)?


You need z/OS DFSORT V1R5 PTF UQ95213 or DFSORT R14 PTF UQ95213 (Dec, 2004) to use DFSORT's new OVERLAY feature. The syntax error indicates you don't have this PTF installed. Ask your System Programmer to install it (it's free).

Quote:
2. what should i do if the file is varying length type?


You can use this variation of the DFSORT job for VB records:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file (VB)
//OUT DD SYSOUT=*
//TOOLIN DD *
 COPY FROM(IN) USING(CTL1)
 COPY FROM(IN) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC BUILD=(1,5,6:SEQNUM,8,ZD)
  OUTFIL FNAMES=CTL2CNTL,REMOVECC,
    VTOF,
    INCLUDE=(5,1,CH,EQ,C'e'),
    OUTREC=(C' OPTION STOPAFT=',6,8,ZD,SUB,+1,M11,LENGTH=8,80:X)
/*
//CTL2CNTL DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)
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 How to give complex condition in JCL . CLIST & REXX 30
No new posts selectively copy based on condition DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. Control-m JOB executing even when the... Compuware & Other Tools 6
No new posts Dynamic condition checks COBOL Programming 5
No new posts Extract 2 more lines below line that ... DFSORT/ICETOOL 2
Search our Forums:

Back to Top