MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Copy a file from Middle

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sankar narayanan
Beginner


Joined: 16 Oct 2007
Posts: 29
Topics: 12

PostPosted: Fri Apr 25, 2008 5:01 am    Post subject: Copy a file from Middle Reply with quote

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......... Laughing
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Apr 25, 2008 10:53 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
sankar narayanan
Beginner


Joined: 16 Oct 2007
Posts: 29
Topics: 12

PostPosted: Wed Apr 30, 2008 12:32 am    Post subject: Reply with quote

Hi

I tried the above syntax. The output was:
Code:
********************************
AIZAZ                           
RANJAN                         
RAMA                           
********************************

But it was not my excpeted output. Embarassed


My expected output should be:
Code:
VINAY                                           
AIZAZ



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....
Code:
DDD
EEE
FFF
GGG


Let me whether this can be approched thru simple JCL with any utilities. bonk
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Apr 30, 2008 4:48 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group