Need a help in DFSORT
Moderators: Frank Yaeger, Moderator Group
-
- Member
- Posts: 5
- Joined: Thu Mar 18, 2010 8:43 pm
Need a help in DFSORT
Hi,
My Requirement is this
Dataset1: (Column 1-7)
VOLSER1
VOLSER2
VOLSER3
Dataset2: (Column 9-15)
VOLSER1
VOLSER2
VOLSER3
I need a output like this: (Column 1-15)
VOLSER1 VOLSER1
VOLSER2 VOLSER2
VOLSER3 VOLSER3
Can you please help me out with this...Since the lines in the dataset are too large I dont want to do manually.
Regards,
Dinesh
My Requirement is this
Dataset1: (Column 1-7)
VOLSER1
VOLSER2
VOLSER3
Dataset2: (Column 9-15)
VOLSER1
VOLSER2
VOLSER3
I need a output like this: (Column 1-15)
VOLSER1 VOLSER1
VOLSER2 VOLSER2
VOLSER3 VOLSER3
Can you please help me out with this...Since the lines in the dataset are too large I dont want to do manually.
Regards,
Dinesh
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
It's not clear what you want to do. Do you want to combine the 1-7 field from file1 for each record with the 9-15 field from file2 for the corresponding record? That is, VOLSER1 from File1 record 1 with VOLSER1 from File2 record 1, VOLSER2 from File1 record 2 with VOLSER2 from File2 record 2, etc? Or do you want to do something else (what)?
What is the RECFM and LRECL of each input file? What is the starting position and length of each field in the output file (same as input?)?
Please run the following DFSORT job and show me the //SYSOUT messages so I can see what level you're at:
What is the RECFM and LRECL of each input file? What is the starting position and length of each field in the output file (same as input?)?
Please run the following DFSORT job and show me the //SYSOUT messages so I can see what level you're at:
Code: Select all
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN DD *
OPTION COPY
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Member
- Posts: 5
- Joined: Thu Mar 18, 2010 8:43 pm
Hi Frank,
You are correct. I want to combine the 1-7 field from file1 for each record with the 9-15 field from file2 for the corresponding record
Basically I am trying to match record1 in the file1 to record1 in file2 like below
VOLSER1 VOLSER1
But if I do CUT and PASTE I get the output like this:
VOLSER1
VOLSER1
Please provide your valuable info.
Regards,
Dinesh
You are correct. I want to combine the 1-7 field from file1 for each record with the 9-15 field from file2 for the corresponding record
Basically I am trying to match record1 in the file1 to record1 in file2 like below
VOLSER1 VOLSER1
But if I do CUT and PASTE I get the output like this:
VOLSER1
VOLSER1
Please provide your valuable info.
Regards,
Dinesh
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Still not clear. Are you trying to match on the value (e.g. VOLSER1 with VOLSER1) or just record-by-record? Your example shows every value in file1 with a corresponding record with the same value in file2? Is that always the case? What do you want to do if it's not the case? A better input example with more variations and the expected output would help.
Also, as requested in my previous post, please run the DFSORT job and show your //SYSOUT messages.
Also, as requested in my previous post, please run the DFSORT job and show your //SYSOUT messages.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Member
- Posts: 5
- Joined: Thu Mar 18, 2010 8:43 pm
Hi Frank,
I am trying to match record by record.
Here is the SYSOUT message
But I need a output like this
since I have lotsa line I dont want to do this manually (i.e) copy-paste.
Dinesh
I am trying to match record by record.
Here is the SYSOUT message
Code: Select all
VOLSER1
VOLSER2
VOLSER3
VOLSER1
VOLSER2
VOLSER3
Code: Select all
VOLSER1 VOLSER1
VOLSER2 VOLSER2
VOLSER3 VOLSER3
Dinesh
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
I wanted the //SYSOUT messages. What you've shown is not them. I also asked for the RECFM and LRECL which you didn't tell me.Here is the SYSOUT message
At any rate, you can use a DFSORT JOINKEYS job something like this to do what I think you asked for.
Code: Select all
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=... input file1
//IN2 DD DSN=... input file2
//SORTOUT DD DSN=... output file
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(16,8,A),SORTED,NOSEQCK
JOINKEYS F2=IN2,FIELDS=(16,8,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F1:1,7,F2:9,7)
OPTION COPY
OUTFIL BUILD=(1,7,X,8,7)
/*
//JNF1CNTL DD *
INREC OVERLAY=(16:SEQNUM,8,BI)
//JNF2CNTL DD *
INREC OVERLAY=(16:SEQNUM,8,BI)
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Member
- Posts: 5
- Joined: Thu Mar 18, 2010 8:43 pm
Here is the SYSOUT message:
Attributes of input file1:
RECFM - FB
LRECL - 80
Attributes of input file2:
RECFM - FB
LRECL - 80
starting position is 1 and length of each field is 7 in first input file,starting position is 9 and length of each field is 7 in the 2nd input file.
Let me know if you need more info
Regards,
Dinesh
Code: Select all
1ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 23:44 ON FRI MAR 19, 2010 -
0 OPTION COPY
ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E9-K90007 C9-BASE E5-K24705 E7-K24705
ICE193I 0 ICEAM1 ENVIRONMENT IN EFFECT - ICEAM1 INSTALLATION MODULE SELECTED
ICE088I 0 S00462GH.S1 . , INPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE093I 0 MAIN STORAGE = (MAX,6291456,6278238)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6200798,6200798)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,RESET=Y,VSAMEMT=Y,DYNSPC=256
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ERET=RC16 ,MSGDDN=SYSOUT
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=N,DYNALOC=N ,ABCODE=MSG
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=N,STIMER=Y,COBEXIT=COB2
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=Y,DSA=0
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXITCK=S,PARMDDN=DFSPARM ,FSZEST=N
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMIO=N,MOSIZE=MAX
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTOUT
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTIN
ICE751I 1 EF-K10929 F0-Q84357 E8-K24705
ICE090I 0 OUTPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 6, OUT: 6
ICE052I 0 END OF DFSORT
RECFM - FB
LRECL - 80
Attributes of input file2:
RECFM - FB
LRECL - 80
starting position is 1 and length of each field is 7 in first input file,starting position is 9 and length of each field is 7 in the 2nd input file.
Let me know if you need more info
Regards,
Dinesh
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
You don't have the Nov, 2009 PTF so you can't use JOINKEYS.
Here's a DFSORT/ICETOOL job that will do the same thing without the PTF.
Here's a DFSORT/ICETOOL job that will do the same thing without the PTF.
Code: Select all
//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=... input file1
// DD DSN=... input file2
//OUT DD DSN=... output file
//TOOLIN DD *
SPLICE FROM(CON) TO(OUT) ON(16,8,ZD) WITH(9,7) USING(CTL1)
/*
//CTL1CNTL DD *
INREC IFOUTLEN=23,
IFTHEN=(WHEN=(1,1,CH,NE,C' '),OVERLAY=(16:SEQNUM,8,ZD)),
IFTHEN=(WHEN=NONE,OVERLAY=(16:SEQNUM,8,ZD))
OUTFIL FNAMES=OUT,BUILD=(1,15)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Member
- Posts: 5
- Joined: Thu Mar 18, 2010 8:43 pm
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page