|
|
| Author |
Message |
rsshanmugam
Active User
Joined: 08 Mar 2005 Posts: 53 Location: Chennai
|
|
|
|
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 |
|
 |
References
|
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4604 Location: San Jose, CA
|
|
|
|
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 |
|
 |
stalin.i@gmail.com
New User
Joined: 18 Apr 2005 Posts: 8
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4604 Location: San Jose, CA
|
|
|
|
| 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 |
|
 |
|
|
|