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 

copying a particular length of record in file

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


Joined: 17 Dec 2002
Posts: 53
Topics: 14
Location: BengaLuru

PostPosted: Mon Dec 23, 2002 3:33 pm    Post subject: copying a particular length of record in file Reply with quote

Hi..

Could anybody let me know how I can copy a particular length
of a file VB format to a FB format.

To make it more clear, suppose I have a VB file with record structure like..

Code:

01 WS-1
  05 WS-2   X(5).
  05 WS-3   X(30).
  05 WS-4   S9(4) COMP.
  05 WS-5   X(50).
  05 WS-6   S9(9)V9(2) COMP-3.



I want to copy only the part of the record between 6 and 88., ie.,
from WS-3 to WS-5 to a FB file.

Any suggestions? Question Rolling Eyes
_________________
If you're not failing every now and again, it's a sign you're not doing anything very innovative.
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Dec 23, 2002 3:50 pm    Post subject: Reply with quote

Vallishar,

The following DFSORT jcl will give you the results.This jcl also works with syncsort.Since your input file is vb , your actual record starts from position 5( the first 4 bytes is RDW).We also need the parm CONVERT to convert a VB file to FB Format.

Code:

//STEP0100 EXEC PGM=ICEMAN
//*               
//SYSOUT   DD  SYSOUT=*               
//SORTIN   DD  DSN=YOUR INPUT VBFILE,
//             DISP=SHR             
//SORTOUT  DD  DSN=YOUR OUTPUT FBFILE,     
//             DISP=(NEW,CATLG,DELETE),               
//             UNIT=SYSDA,               
//             SPACE=(CYL,(X,Y),RLSE)             
//SYSIN    DD  *     
  SORT FIELDS=COPY               
  OUTFIL CONVERT,OUTREC=(10,30,  * WS-3 STARTS AT 10 & LENGTH OF 30   
                         40,2,   * WS-4 STARTS AT 40 & LENGTH OF 2         
                         42,50)  * WS-5 STARTS AT 42 & LENGTH OF 50   
                         
/*


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Dec 23, 2002 4:54 pm    Post subject: Reply with quote

Vallishar,

Kolusu's DFSORT job should do the trick. Note that since you want to copy contiguous fields, you could actually do that with the following simpler OUTFIL statement:

Code:

  OUTFIL CONVERT,OUTREC=(10,82)


However, the OUTFIL statement Kolusu shows is useful for documenting the fields involved.

For more information on using DFSORT to convert from VB to FB, see the "How can I convert a VB data set to an FB data set? " Ask Professor Sort item at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/professor_sort/

For more information on using DFSORT to convert from FB to VB, see the "How can I convert an FB data set to a VB data set? " Ask Professor Sort item at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/professor_sort/
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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