|
View previous topic :: View next topic
|
| Author |
Message |
sashi
New User

Joined: 14 Sep 2005 Posts: 54 Location: Chennai
|
|
|
|
I have 2 files. FILE-1 has 100 records with LRECL=11 and FILE-2 has 100 records with LRECL=200. Both are FB format.
I need to create output file FILE-3 with 1 to 11 position data from FILE-1 and 12 to 211 data from FILE-2. I don’t have any key field in both the files.
In simple terms need to append each record from the FILE-1 to each record in FILE-2.
Ex:
FILE-1
B100407974
B100462036
B100594362
FILE-2
436 2410 164
804 2640 148
479 2605 154
FILE-3
B100407974 436 2410 164
B100462036 804 2640 148
B100594362 479 2605 154
Thanks
Sashi |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8798 Location: Welsh Wales
|
|
|
|
This is a link to the DFSORT smart tricks documentation which has many examples of matching records, including matching records one to one without keys.
Please click HERE to access it.
Because the solution for sort related questions may vary from product to product, please ensure that you state clearly which sort product you are using.
If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.
If the messages start with ICE then your product is DFSORT. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.
If the messages start with WER or SYT then the product is SYNCSORT and should be posted in the JCL forum. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.
Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in you site.
| Code: |
//SORTSTEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY |
|
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
sashi,
With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707, you can use the Joinkeys function like shown below to get the desired results. Since both files don't have a common key we add a SEQNUM at the end of each file using INREC for each file via JNF1CNTL and JNF2CNTL and use that as a key for matching
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=your FB 200 byte file,DISP=SHR
//SORTJNF2 DD DSN=your FB 11 byte file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(201,8,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(12,8,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F2:1,11,F1:1,200)
//JNF1CNTL DD *
INREC OVERLAY=(201:SEQNUM,8,ZD)
//JNF2CNTL DD *
INREC OVERLAY=(12:SEQNUM,8,ZD)
//* |
For complete details on Joinkey functions and the other new functions available with the Nov, 2009 DFSORT PTF, see:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174 |
|
| Back to top |
|
 |
Gursharan Khalsa
New User
Joined: 04 Sep 2007 Posts: 33 Location: Salinas
|
|
|
|
Hi,
I have two files A1 and A2.My requirement is to copy only ACCOUNT field form A1 and paste it to ACCOUNT filed in A2,without making any changes to other fileds in A2.In simple terms I want to replace accounts present in A2 with those present in A1.Both files have different formats,A1 is a VSAM file and A2 is a flat file.
Thanx in advance |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Gursharan Khalsa,
I'm locking this topic.
Please start a new topic for this new question with more information on what you want to do:
Show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Also, indicate if you have the Nov, 2009 DFSORT PTF so I can tell if you can use JOINKEYS or not. To find out if you have the 2009 PTF, follow the instructions at:
ibmmainframes.com//viewtopic.php?t=33389 |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|