IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to merge same layout datasets ?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Mon Jan 16, 2006 11:07 am
Reply with quote

Hi All,
Can I using the system program SORT to merge the serial same layout datasets to one ,if can , how to do ?


Regards,
Thanks,

LinkinPark.
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 308
Location: Vizag / US

PostPosted: Mon Jan 16, 2006 11:36 am
Reply with quote

Try this one , this is SYNCSORT

Code:
//JOB STATEMENT
//MERGE1 EXEC PGM=SYNCSORT
//*
//SORTIN01 DD DSN=SALES91,DISP=(OLD,KEEP)
//*
//SORTIN02 DD DSN=SECOND>DATASET,DISP=(OLD,KEEP)
//*
//SORTOUT DD DSN=OUTPUT>DATASET,
//*
//SYSIN DD *
MERGE FIELDS=COPY
/*


Thanks,
Gau
Back to top
View user's profile Send private message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Mon Jan 16, 2006 11:50 am
Reply with quote

Hi Gautam512,

I found a demo that type the statement " RECORD TYPE=F,LENGTH=225 "

under the line " MERGE FIELDS=COPY ", what's meaning of this ,

if I wanna inculde the sort codition , I just type

//JOB STATEMENT
//MERGE1 EXEC PGM=SYNCSORT
//*
//SORTIN01 DD DSN=SALES91,DISP=(OLD,KEEP)
//*
//SORTIN02 DD DSN=SECOND>DATASET,DISP=(OLD,KEEP)
//*
//SORTOUT DD DSN=OUTPUT>DATASET,
//*
//SYSIN DD *
MERGE FIELDS=COPY
SORT FIELDS=(4,19,CH,A)
INCLUDE COND=(898,1,CH,LE,C'2')

will be ok ?
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 308
Location: Vizag / US

PostPosted: Mon Jan 16, 2006 12:02 pm
Reply with quote

HI,

Did u mention the DCB parameters for the output file , otherwise , u have to give it in the SYSIN.
One more thing is ,
i think we can use both merge and sort in one sysyin

like

Code:
//SYSIN DD * 7
MERGE FIELDS=(4,19,CH,A)
RECORD TYPE=V,LENGTH=(100,,20)
INCLUDE COND=(898,1,CH,LE,C'2')
/*
Back to top
View user's profile Send private message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Mon Jan 16, 2006 12:16 pm
Reply with quote

Hi Gautam512,

I type the frist demo u gave, show me the JCL error .
return code is 16,
"SORTIN NOT DEFINED"

need ur more explanations,

Regards,
Thanks,

LinkinPark
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 308
Location: Vizag / US

PostPosted: Mon Jan 16, 2006 12:25 pm
Reply with quote

Try this one, u cud have posted in DFSORT Forum.....

Code:
//JOB STATEMENT
//*                                                       
//STEP001  EXEC  PGM=SYNCSORT                             
//SORTIN01   DD DSN=INPUT.FILENAME1,DISP=SHR     
//SORTIN02   DD DSN=INPUT.FILENAME2,DISP=SHR         
//SORTOUT  DD DSN=OUTPUT.FILENAME,     
//            DISP=(NEW,CATLG,DELETE),                   
//            DCB=*.SORTIN,                               
//            SPACE=(CYL,(30,30),RLSE)     
//SRTMSG   DD SYSOUT=*                                   
//SYSOUT   DD SYSOUT=* 
//SYSIN DD * 7
MERGE FIELDS=(4,19,CH,A)
INCLUDE COND=(898,1,CH,LE,C'2')
/*   


Thanks,
Gau
Back to top
View user's profile Send private message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Mon Jan 16, 2006 12:40 pm
Reply with quote

Hi Gautam512,
error message :

INVALID REFERBACK '*.SORTIN' DETECTED -- (J)12

It's realy hard to me ..

Regards&Thanks,

LinkinPark
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 308
Location: Vizag / US

PostPosted: Mon Jan 16, 2006 12:43 pm
Reply with quote

HI,

As the input file layout is same as the out put sa i used the

*.SORTIN

change it to

DCB=*.SORTIN01

Thanks,
Gau
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Jan 16, 2006 10:54 pm
Reply with quote

LinkinPark wrote
Quote:
Can I using the system program SORT to merge the serial same layout datasets to one ,if can , how to do ?


You need to give more details.

SORT means to create an output data set by combining two or more data sets on one or more keys. The data sets DO NOT have to already be in order by the keys.

MERGE means to create an output data set by combining two or more data sets on one or more keys. The data sets DO have to already be in order by the keys.

COPY means to create an output data set by combining two or more data sets one after the other without regard to a key.

Which are you trying to do? SORT, MERGE or COPY? The job you need is different for each one.

What is the RECFM and LRECL of each input file?

If you're trying to do a SORT or MERGE, what is the position, length and format of the key or keys in each input file?

This is pretty basic stuff, so you're obviously not familiar with DFSORT and DFSORT's ICETOOL. I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Tue Jan 17, 2006 11:52 am
Reply with quote

Hi all ,

Thanks for ur helps,

Hi Frank Yaeger,

I have downloaded and read the document , it provide me lots of knowledges , I appreciate u very much .question more , How can i get the document about others ,e.g. IEFBR14 ,EZTPA00 document ?

Regards&Thanks,

LinkinPark
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 17, 2006 10:10 pm
Reply with quote

Quote:
How can i get the document about others ,e.g. IEFBR14 ,EZTPA00 document ?


I suspect IEFBR14 is too simple to have any documentation.

As for documentation on other utilities/products, you'll need to have somebody else help you with that.
Back to top
View user's profile Send private message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Thu Jan 19, 2006 9:45 am
Reply with quote

Code:
//STEP001  EXEC  PGM=SORT,COND=EVEN               
                         
//SORTIN01 DD  DSN=S1.KE,DISP=SHR
//SORTIN02 DD  DSN=S2.KE,DISP=SHR
//SORTOUT1 DD  DSN=LJPVPJ1.UJPJ1J5.OUTP.MLOUT1,   
//SORTOUT2 DD DSN=LJPVPJ1.UJPJ1J5.OUTP.MLOUT2,                                           
//SYSIN DD *                                                         
  MERGE FIELDS=(4,19,CH,A)                                           
  OUTFIL FNAMES=SORTOUT1,INCLUDE=(26,2,ZD,EQ,01)
  OUTFIL FNAMES=SORTOUT2,INCLUDE=(26,2,ZD,EQ,02)


looking through my code , I wanna merge two datasets and output two datasets according to coditions respectively. after running , dateset sortout1 and sortout2 only contain the S2 records ,why?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jan 19, 2006 8:32 pm
Reply with quote

I don't know anything about what your input records look like, so all I can do is guess that your conditions only INCLUDE records from S2, that is, only S2 has records where 26,2,ZD is 01 or 02.
Back to top
View user's profile Send private message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Fri Jan 20, 2006 5:40 am
Reply with quote

Hi Frank Yaeger,
The input records S1.KE&S2.KE have same layout and position 26 legth 2 is 01 or 02 or 03 or 04 .....and so on ..
what I mean is make sure the output sortout01 including "01" from both S1.KE and S2.KE, output sortout2 including "02" from both S1.KE and S2.Ke..

Regars&Thanks,

LinkinPark
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Jan 20, 2006 5:59 am
Reply with quote

As I said, if you only got records from S2, then only S2 has 01 or 02 as a 2-byte ZD value in 26-27. I don't understand what else you expect me to tell you.

If you want to see how many records in S1 and S2 have each 2-byte ZD value, you can run the following DFSORT/ICETOOL job. If a value does not appear with its count, it means its not in that file (e.g. if you don't see 3 with a count, then 3 does not appear in the file). That will either prove that only S2 has 1 and 2 as a 2-byte ZD value in positions 26-27, or that position 26-27 does not actually have what you think it does.

Code:

//STEP1 EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//S1 DD  DSN=S1.KE,DISP=SHR
//S2 DD  DSN=S2.KE,DISP=SHR
//SHOWS1 DD SYSOUT=*
//SHOWS2 DD SYSOUT=*
//TOOLIN DD *
OCCUR FROM(S1) LIST(SHOWS1) ON(26,2,ZD) ON(VALCNT) BLANK
OCCUR FROM(S2) LIST(SHOWS2) ON(26,2,ZD) ON(VALCNT) BLANK
/*
Back to top
View user's profile Send private message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Fri Jan 20, 2006 6:37 am
Reply with quote

Hi Frank Yaeger,

tell u my requirement:
S1.KE and S2.KE have same layout :
e.g
S1.KE
----------------
NAME ID
----------------
0 1 26 2
----------------
A 01
B 02
C 01
D 02
E 03
F 04
S2.KE
----------------
NAME ID
----------------
0 1 26 2
----------------
G 01
H 02
I 01
J 02
K 03
L 04
and after sort
make sure
dateset sortout1 include following records which only ID=01
----------------
NAME ID
----------------
0 1 26 2
----------------
A 01
C 01
G 01
I 01
sortout2 include following records which only ID=02

.............................................

that's all

Regards&Thanks
LinkinPark.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Jan 20, 2006 7:01 am
Reply with quote

Please use ubb code tags around your data, or repost in the DFSORT Forum so I can do it for you.
Back to top
View user's profile Send private message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Fri Jan 20, 2006 8:03 am
Reply with quote

Hi Frank Yaeger,

tell u my requirement:
S1.KE and S2.KE have same layout :
e.g
S1.KE
----------------
NAME ID
----------------
0 1 26 2
----------------
A 01
B 02
C 01
D 02
E 03
F 04
S2.KE
----------------
NAME ID
----------------
0 1 26 2
----------------
G 01
H 02
I 01
J 02
K 03
L 04
and after sort
make sure
dateset sortout1 include following records which only ID=01
----------------
NAME ID
----------------
0 1 26 2
----------------
A 01
C 01
G 01
I 01
sortout2 include following records which only ID=02

.............................................

that's all

Regards&Thanks
LinkinPark]
Code:
Code:
Code:
Back to top
View user's profile Send private message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Fri Jan 20, 2006 8:05 am
Reply with quote

Hi All

sorry , it's my fault that press the worry button
....
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Jan 20, 2006 9:50 pm
Reply with quote

Please post in the DFSORT Forum so I can fix things up for you if necessary. As the Moderator of the DFSORT Forum, I have edit authority for that Forum. I don't have edit authority for this Forum.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
This topic is locked: you cannot edit posts or make replies. Merge 2 input files based on the reco... JCL & VSAM 2
No new posts Merge 2 input files after sort SYNCSORT 14
No new posts Merging 2 datasets into one DFSORT/ICETOOL 1
No new posts Merge files with a key and insert a b... DFSORT/ICETOOL 6
Search our Forums:

Back to Top