MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
sankar narayanan Beginner Joined: 16 Oct 2007 Posts: 29 Topics: 12
Posted: Fri Apr 25, 2008 5:01 am Post subject: Copy a file from Middle
Hi All,
I saw this topic
http://www.mvsforums.com/helpboards/viewtopic.php?t=9037
By using the above JCL will i be able to COPY the record from the middle.
Code: Input:
********************************* Top of Data **
SIVA
RAMA
VINAY
AIZAZ
RANJAN
RAMA
******************************** Bottom of Data
Code: Output:
VINAY
AIZAZ
I hope my question seems funny.........
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri Apr 25, 2008 10:53 am Post subject:
sankar narayanan ,
The following DFSORT JCL will give you the desired results
Code:
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Your input file,
// DISP=SHR
//SORTOUT DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC OVERLAY=(1:SEQNUM,8,ZD,
1,8,ZD,DIV,+2,EDIT=(TTTTTTTT),80:X)
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(' OPTION COPY,SKIPREC=',9,8,80:X)
/*
//STEP0200 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Your input file,
// DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD DSN=&&T1,DISP=SHR
Hope this helps... _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
sankar narayanan Beginner Joined: 16 Oct 2007 Posts: 29 Topics: 12
Posted: Wed Apr 30, 2008 12:32 am Post subject:
Hi
I tried the above syntax. The output was:
Code: ********************************
AIZAZ
RANJAN
RAMA
********************************
But it was not my excpeted output.
My expected output should be:
To be more clear.....I am having an input of say 10 records...
Code: AAA
BBB
CCC
DDD
EEE
FFF
GGG
HHH
III
JJJ
I need to COPY the record from the middle so that my expected output should be as....
Let me whether this can be approched thru simple JCL with any utilities.
Back to top
dbzTHEdinosauer Supermod Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
Posted: Wed Apr 30, 2008 4:48 am Post subject:
sankar narayanan,
your definition of middle is not precise. as you gain more experience in the field of data processing, you will find everything is based on precision.
So, to put a precise definition on 'middle', do you mean:
(total num records / 2) / 2 is skip value
(total num records / 2) is copy value.
if this does not meet your expectations, please correct the formula.
Quote:
Let me whether this can be approched thru simple JCL with any utilities
that is exactly what kolusu provided. simple jcl for a utility called DFSORT. _________________ Dick Brenholtz
American living in Varel, Germany
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum