View previous topic :: View next topic
Author
Message
sprikitik New User Joined: 29 Jan 2007Posts: 61 Location: Makati City, Philippines
I have 2 files
File 1 :
10001STUDENT1
FILE 2:
10001XXXXXXX
The output that i need is:
10001STUDENT1XXXXXXX
Question is: How can i do this using SYNCSORT?
Back to top
Anuj Dhawan Superior Member Joined: 22 Apr 2006Posts: 6250 Location: Mumbai, India
Back to top
Anuj Dhawan Superior Member Joined: 22 Apr 2006Posts: 6250 Location: Mumbai, India
Hi,
Apologies, that's not the solution, You used very similar 'records' for the inputs, so I goofed up...
Please use the below JCL
Code:
//DFSORT EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
10001STUDENT1
//IN2 DD *
10001XXXXXXX
//TMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT DD sysout=*
//TOOLIN DD *
COPY FROM(IN1) TO(TMP1) USING(CPY1)
COPY FROM(IN2) TO(TMP1) USING(CPY2)
SPLICE FROM(TMP1) TO(OUT) ON(1,5,CH) WITH(14,7)
//CPY1CNTL DD *
OUTREC FIELDS=(1:1,5,6:6,8,14:7X)
/*
//CPY2CNTL DD *
OUTREC FIELDS=(1:1,5,14:6,7)
/*
Quote:
If I'm not mistaken
I was on mistake...
Back to top
sprikitik New User Joined: 29 Jan 2007Posts: 61 Location: Makati City, Philippines
Anuj D. wrote:
Hi,
Apologies, that's not the solution, You used very similar 'records' for the inputs, so I goofed up...
Please use the below JCL
Code:
//DFSORT EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
10001STUDENT1
//IN2 DD *
10001XXXXXXX
//TMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT DD sysout=*
//TOOLIN DD *
COPY FROM(IN1) TO(TMP1) USING(CPY1)
COPY FROM(IN2) TO(TMP1) USING(CPY2)
SPLICE FROM(TMP1) TO(OUT) ON(1,5,CH) WITH(14,7)
//CPY1CNTL DD *
OUTREC FIELDS=(1:1,5,6:6,8,14:7X)
/*
//CPY2CNTL DD *
OUTREC FIELDS=(1:1,5,14:6,7)
/*
Quote:
If I'm not mistaken
I was on mistake...
Hi,
Thanks for the reply..
Will this work for the following example? :
file 1:
10001STUDENT1
10002STUDENT2
file 2:
10001XXXXXXX
output file:
10001STUDENT1XXXXXXX
10002STUDENT2
Thanks!
Back to top
Anuj Dhawan Superior Member Joined: 22 Apr 2006Posts: 6250 Location: Mumbai, India
Hi,
No, it will not; it would work with this type of input instead,
Code:
//IN1 DD *
10001STUDENT1
10002STUDENT2
//IN2 DD *
10001XXXXXXX
10002XXXXXXX
Well, you've posted the same question in DFSORT as well & this time I'm not goofing up.
P.S. : A mild suggestion, unless You've something specific to point out from the previous post, please don't "quote" the previous post, just reply it.
Back to top
Alissa Margulies SYNCSORT Support Joined: 25 Jul 2007Posts: 496 Location: USA
sprikitik,
Try this SyncSort job:
Code:
//SORT1 EXEC PGM=SORT
//SORTJNF1 DD *
10001STUDENT1
10002STUDENT2
//SORTJNF2 DD *
10001XXXXXXX
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(1,5,A)
JOINKEYS FILES=F2,FIELDS=(1,5,A)
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,13,F2:6,7)
SORT FIELDS=COPY
/*
The following output is produced:
Code:
10001STUDENT1XXXXXXX
10002STUDENT2
Back to top
sprikitik New User Joined: 29 Jan 2007Posts: 61 Location: Makati City, Philippines
Hi,
What if i want to write only those records with NO match? How will i do that?
Thanks,
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Quote:
What if i want to write only those records with NO match
Post sample input/output records and what exactly you want to achieve.
Your initial requirement was to extract only matching records.
Thanks,
Arun
Back to top
Escapa Senior Member Joined: 16 Feb 2007Posts: 1399 Location: IL, USA
Hi Alissa Margulies,
I tried jcl posted by you, i got
ICE005A 0 STATEMENT DEFINER ERROR
on control cards.
What does it mean?
does it mean that i dont have syscsort?
here is sort out
Code:
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 07:42 ON TUE
JOINKEYS FILES=F1,FIELDS=(1,5,A)
£
ICE005A 0 STATEMENT DEFINER ERROR
JOINKEYS FILES=F2,FIELDS=(1,5,A)
£
ICE005A 0 STATEMENT DEFINER ERROR
JOIN UNPAIRED
£
ICE005A 0 STATEMENT DEFINER ERROR
REFORMAT FIELDS=(F1:1,13,F2:6,7)
£
ICE005A 0 STATEMENT DEFINER ERROR
SORT FIELDS=COPY
ICE056A 0 SORTIN NOT DEFINED
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E7-K24705
ICE052I 3 END OF DFSORT
Back to top
Aaru Senior Member Joined: 03 Jul 2007Posts: 1287 Location: Chennai, India
Sambhaji,
Quote:
I tried jcl posted by you, i got
ICE005A 0 STATEMENT DEFINER ERROR
on control cards.
What does it mean?
does it mean that i dont have syscsort?
ICE messages indicate that you are using DFSORT and not SYNCSORT. JOINKEYS is for SYNCSORT.
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Sambhaji,
Do a search in DFSORT forum. You'll find lot of examples for file-matching using DFSORT.
Thanks,
Arun
Back to top
Escapa Senior Member Joined: 16 Feb 2007Posts: 1399 Location: IL, USA
thanks Aaru for very quick reply.
how to find whether i have syncsort or not?
Back to top
Aaru Senior Member Joined: 03 Jul 2007Posts: 1287 Location: Chennai, India
Sambhaji,
In case you have the same requirement, Try using the JCL which Anuj had posted which uses ICETOOL (DFSORT).
Post if you face any issue.
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Sambhaji,
ICE messages are issued by DFSORT whereas Syncsort issues WER messages in your SYSOUT. Most of the shops will have only either of these sort products installed.
Thanks,
Arun
Back to top
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10873 Location: italy
Quote:
how to find whether i have syncsort or not?
it has been told zillions times...
look at ( better if You read also ) the sysout of the sort step,
it should be clear what sort product You are using
but, another hint...
if the messages start with
WER that' s SYNCSORT
ICE that' s DFSORT
Back to top
Aaru Senior Member Joined: 03 Jul 2007Posts: 1287 Location: Chennai, India
Sambhaji,
Quote:
how to find whether i have syncsort or not?
You can identify that with the messages that you get from the SORT job.
ICE - Indicates that you are using DFSORT
WER - Indicates that you are using SYNCSORT
Both are competitive products. In your case the messages start with ICE and hence it uses DFSORT. Also the term "dfsort" is also displayed in the spool.
Code:
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 07:42 ON TUE
From Frank's Post:
Quote:
If your site is using DFSORT, then PGM=ICETOOL invokes DFSORT's ICETOOL and you will see ICE messages in TOOLMSG and DFSMSG. If your site is using Syncsort, then PGM=ICETOOL invokes Syncsort's SYNCTOOL (because Syncsort ships ICETOOL as an alias for SYNCTOOL) and you will see SYT messages in TOOLMSG and WER messages in DFSMSG.
Hope this Helps.
Back to top
Please enable JavaScript!