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 

join data earlier from a File with new contents

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


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Fri Dec 22, 2006 4:04 am    Post subject: join data earlier from a File with new contents Reply with quote

I have a File A with contents ABCD.I have one more step which executes SORT step and SORTOUT routes to File A with some output say PQRS.What happens is the contents of FILE A are overwritten if DISP=SHR is given and in the output i get PQRS.But i want in the output FILE A the original contents + blank (SPACE ) + new Sort step output .
For example i want the ouput as :
Code:
ABCD PQRS
in a single line not in two lines with (MOD concept).
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Fri Dec 22, 2006 6:02 am    Post subject: Reply with quote

I think you need to post the code you are using. It obviously needs a small change, which would be fairly easy for a contributor to supply, but you can't expect to receive a complete solution starting from scratch.
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Fri Dec 22, 2006 11:37 am    Post subject: Reply with quote

yadav2005,

Sounds like you're trying to join fields from two records. The SPLICE technique discussed in the "Join fields from two files record-by-record" Smart DFSORT Trick at:

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

might be what you need.

If you need more specific help, show the records in each input file and the record or records you expect for output. Give the starting position, length and format of the relevant fields. Give the RECFM and LRECL of the input files.
_________________
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
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Fri Dec 22, 2006 11:54 am    Post subject: Reply with quote

Thank You Frank for your response.

Initially File A is 160 bytes (LRECL and RECFM = FB) and it has data from position 1 - 4 value 'ABCD' and remaining blanks and has only 1 Record.Now the Sort Step produces new output 'PQRS' in position 1 - 4 and File A has now data as 'PQRS' and has only 1 record.But i want the output in File A as starting from Pos 1.
Code:
ABCD PQRS
I hope i am clear in my question.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Fri Dec 22, 2006 12:46 pm    Post subject: Reply with quote

Hmmm ... that's not what I originally thought you were doing.

If you're saying that you have a 160-byte input record like this:

ABCD

and you want to produce a 160-byte output record like this:

ABCD PQRS

then you can use this DFSORT job:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/160)
//SORTOUT DD DSN=...  output file (FB/160)
//SYSIN DD *
   OPTION COPY
   INREC OVERLAY=(6:C'PQRS')
/*

_________________
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
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Fri Dec 22, 2006 1:04 pm    Post subject: Reply with quote

Frank,

My requirement is like this:

In first step i am generating File A from another File say X which will always produce a single record say 'ABCD' in pos 1 - 4
In second step File A is again being used to generate a output from a File say Y and it will always produce a single record say 'PQRS' in pos 1 - 4.In either of the steps FILE A is the output.What i want in the output FILE A is
Code:
ABCD PQRS

I hope i am clear in my question.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Fri Dec 22, 2006 3:44 pm    Post subject: Reply with quote

I don't know how you're "generating" these records. Are you using DFSORT or some other utility? What do the generating steps look like? If you want to use FileA as the only output file for both generating steps, then you need to change the generating steps to do what you want.

If you want to use DFSORT for this, then you can have your generating steps put the two generated records in a temp data set (use MOD for the temp data set) and then use the temp data set as input to the following DFSORT/ICETOOL job to get the output record you want in FileA:

Code:

...  create temp ds
//S1 EXEC PGM=ICETOOL                                               
//TOOLMSG DD SYSOUT=*                                               
//DFSMSG DD SYSOUT=*                                               
//IN DD DSN=...  temp ds with ABCD and PQRS records
//OUT DD DSN=...  output fileA                                                   
//TOOLIN DD *                                                       
SPLICE FROM(IN) TO(OUT) ON(161,1,CH) -                             
  WITH(6,4) USING(CTL1)                 
/*                           
//CTL1CNTL DD *                                                     
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(161:C'A',162:SEQNUM,1,ZD)),     
        IFTHEN=(WHEN=(162,1,ZD,EQ,+2),OVERLAY=(6:1,4))             
  OUTFIL FNAMES=OUT,BUILD=(1,160)                                   
/*


You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use INREC with SPLICE. If you don't have April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
_________________
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