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 

Help on DFSORT

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


Joined: 16 Jul 2010
Posts: 7
Topics: 5

PostPosted: Mon Mar 21, 2011 8:11 am    Post subject: Help on DFSORT Reply with quote

Hi,
I have a requirement where i have two input files of different LRECL.

The output file must have the content of input files as follows
1: 43 content of file1 for first 43 bytes
44:10 content of file2 for the next 10 bytes
54: 6 content file1 for next 6 bytes
60: 9 content of file2 for the next 9 bytes
The content of file1 there after

Please suggest a sort card suggestible for this requirement

Thanks in advance,
veera
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Mar 21, 2011 10:10 am    Post subject: Reply with quote

Veera333,

Is there a key to match the 2 files or is it like creating an output record from picking the contents from 1st record of file 1 with the 1st record of file 2 and 2nd record of file 1 with 2nd record of file 2 and so on...?

Please provide the following details.

1. what is the LRECL and RECFM Of both input and output files.
2. Show us a sample of inputs and desired outputs.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Veera333
Beginner


Joined: 16 Jul 2010
Posts: 7
Topics: 5

PostPosted: Tue Mar 22, 2011 12:53 am    Post subject: Reply with quote

Hi,

There is no matching key. Both the files are sequential and LREC = 1300 for file 1 and LRECL= 500 for file2.

Small correction in my question, i should not create a new output file.I should replace first record content of file1 to first record of file2 in certain positions and second record content of file1 to second record of file2 and so on.

The file1 field from postions 44 to 53 must be replaced with first 10 bytes of file2
The file1 field from postions 60 to 68 must be replaced with field that is loacted at postion 12 to 20 from file2



Example:

Position: 1----------10-----------43---------------------60-------------1300
File1: ABC XYZ 123.....................................................................

File2: 1234567891--456789123----------------------------

Result:

File1: ABC XYZ 123................1234567891.........456789123-----1300
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Mar 22, 2011 11:24 am    Post subject: Reply with quote

Veera333 wrote:
Small correction in my question, i should not create a new output file.I should replace first record content of file1


Veera333,

It is NOT advisable to overwrite the same input which is used as input. Create a temp dataset with the desired output and then copy it back to the input in another step. The following DFSORT JCL will show you how to create the temp file with the contents from both files.

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//INA      DD DSN=Your input FB 1300 lrecl file,DISP=SHR
//INB      DD DSN=Your input FB 0500 lrecl file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                               
  OPTION COPY                                                 
  JOINKEYS F1=INA,FIELDS=(1301,8,A),SORTED,NOSEQCK             
  JOINKEYS F2=INB,FIELDS=(0501,8,A),SORTED,NOSEQCK             
  JOIN UNPAIRED                                               
  REFORMAT FIELDS=(F1:1,43,F2:1,10,F1:54,6,F2:12,9,F1:69,1232)
//JNF1CNTL DD *                                               
  INREC OVERLAY=(1301:SEQNUM,8,ZD)                             
//JNF2CNTL DD *                                               
  INREC OVERLAY=(501:SEQNUM,8,ZD)                             
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
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