Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Merging file using DFsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
amitkumar_sindhi

New User


Joined: 20 May 2005
Posts: 8

PostPosted: Tue Jun 28, 2005 12:12 pm    Post subject: Merging file using DFsort
Reply with quote

Hi,

I have two files let say A & B . A contains two filelds say F1 & F2, and
B has certain fields say F3,F4,F5,F6. I want a output dataset which will contain all the values of Field F1,F2 that were present in dataset A, alongwith the corresponding fields F4,F5,F6(if value of F1 = F3)but not F3. e.g.
Dataset A has

Code:

F1      F2
--------------
bus    100
can     40
disp   700


Dataset B has

Code:

F3       F4    F5    F6
--------------------------
bus    100l   32P   0.8
can     40l   13G   0.6
jam    900l   23H   0.2


output dataset should have

Code:

F1      F2      F4    F5    F6
-------------------------------
bus    100    100l   32p   0.8
can     40     40l   13G   0.6
disp   700


Can this be done using any of sort option.

Regards,
Amit
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Jun 28, 2005 9:56 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
bus    100
can     40
disp   700
/*
//IN2 DD *
bus    100l   32P   0.8
can     40l   13G   0.6
jam    900l   23H   0.2
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
 COPY FROM(IN2) TO(T1) USING(CTL1)
 COPY FROM(IN1) TO(T1) USING(CTL2)
 SPLICE FROM(T1) TO(OUT) ON(1,4,CH) WITH(8,3) WITH(81,1) -
   KEEPNODUPS USING(CTL3)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,4,15:8,16,81:C'22')
/*
//CTL2CNTL DD *
  OUTREC FIELDS=(1,80,81:C'11')
/*
//CTL3CNTL DD *
   OUTFIL FNAMES=OUT,OMIT=(81,2,CH,EQ,C'22'),
    OUTREC=(1,80)
/*
Back to top
View user's profile Send private message
amitkumar_sindhi

New User


Joined: 20 May 2005
Posts: 8

PostPosted: Wed Jun 29, 2005 6:21 pm    Post subject:
Reply with quote

Thanks a lot, the above jcl will work fine if there is no dups in
dataset B. But in my case dataset B can have dups values in it like

bus 100l 32l 0.8
bus 200l 31l 0.9
can 40l 13g 0.6
jam 900l 23h 0.2
jam 100l 13h 0.1

and i want all the duplicate occurrences to be in the output datasets
which are there in dataset A(if value of F1 = F3).The output should be.
F1 F2 F4 F5 F6
-------------------------------
bus 100 100l 32p 0.8
bus 100 200l 31p 0.9
can 40 40l 13g 0.6
disp 700

Regards,
Amit
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Wed Jun 29, 2005 8:35 pm    Post subject:
Reply with quote

Quote:
Thanks a lot, the above jcl will work fine if there is no dups in
dataset B. But in my case dataset B can have dups values in it like


Sigh. I gave you the JCL that works for the example you showed me. Then you tell me the JCL doesn't work because you have duplicate records. Why didn't you show that in the example in the first place? I can't read your mind. Please give me all of the details in the future, so I don't have to waste time.

Here's a DFSORT/ICETOOL job that will work with your new example:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
bus    100
can     40
disp   700
/*
//IN2 DD *
bus    100l   32l   0.8
bus    200l   31l   0.9
can     40l   13g   0.6
jam    900l   23h   0.2
jam    100l   13h   0.1
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
 COPY FROM(IN1) TO(T1) USING(CTL1)
 COPY FROM(IN2) TO(T1) USING(CTL2)
 SPLICE FROM(T1) TO(OUT) ON(1,4,CH) KEEPNODUPS -
   WITHALL WITH(15,17) WITH(81,1)  USING(CTL3)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,80,81:C'11')
/*
//CTL2CNTL DD *
  OUTREC FIELDS=(1,4,15:8,16,81:C'22')
/*
//CTL3CNTL DD *
   OUTFIL FNAMES=OUT,OMIT=(81,2,CH,EQ,C'22'),
    OUTREC=(1,80)
/*
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 241
Location: Cincinnati OH USA

PostPosted: Fri Jul 01, 2005 6:17 am    Post subject:
Reply with quote

and nary a whisper of thanks. icon_sad.gif


However, I and countless others thank you Frank for time spent answering questions with incomplete information.


Dave
Back to top
View user's profile Send private message
amitkumar_sindhi

New User


Joined: 20 May 2005
Posts: 8

PostPosted: Fri Jul 01, 2005 10:09 am    Post subject:
Reply with quote

Hi Frank,

First of all i am very sorry for all the mistakes i have made from start till end whether its respect to incomplete requirement provided intially or delay i have made in giving the much deserved thanks to you.
Thanks a lot Frank for all your help and time. The JCL provided by you not only helped me saved my time but i was able to know much more about functionality of ICETOOL.

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

DFSORT Moderator


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

PostPosted: Fri Jul 01, 2005 8:51 pm    Post subject:
Reply with quote

Thanks for the kind words, Dave.

Amit,

I'm glad I could help. Just try to give more complete information the first time for future questions.
Back to top
View user's profile Send private message
pushpagiri

New User


Joined: 07 Jul 2005
Posts: 51

PostPosted: Thu Jul 07, 2005 1:20 pm    Post subject: Re: Merging file using DFsort
Reply with quote

hi,

what does C'11' and C'22' signifies in the OUTREC of solution?

Please help me to know on this.


Regards,

Push.
Back to top
View user's profile Send private message
amitkumar_sindhi

New User


Joined: 20 May 2005
Posts: 8

PostPosted: Thu Jul 07, 2005 1:43 pm    Post subject:
Reply with quote

It will append 11 & 22 at the postion 81 of output record. Used to differntiate from which file the input has come.

Regards,
Amit
Back to top
View user's profile Send private message
pushpagiri

New User


Joined: 07 Jul 2005
Posts: 51

PostPosted: Thu Jul 07, 2005 4:37 pm    Post subject:
Reply with quote

amitkumar_sindhi wrote:
thankz amit for your quick reply.

regards,
push
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us