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
 

 

Merge datasets of different lengths

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

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Tue Mar 23, 2010 11:40 pm    Post subject: Merge datasets of different lengths
Reply with quote

Seems simple enough, but not able to do this....

1. Dataset 1. Input dataset of LRECL=133 and FB.
2. Dataset 2. Input dataset of LRECL=203 and FB.

Requirement is to simply append second dataset to the the first one. No sort is required.

1. Records from Dataset 2 can be appended to Dataset 1.
2. If Dataset 3 and dataset 4 exist, can these two datasets also be appended to Dataset 1?
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Mar 23, 2010 11:45 pm    Post subject:
Reply with quote

Hello,

What do you mean by "append"?

Showing a bit of sample data may help (both inputs and output).

What do you want as output? You cannot have a FB output file with different lrecls.
Back to top
View user's profile Send private message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Wed Mar 24, 2010 12:01 am    Post subject:
Reply with quote

Append as in, simply copy records at the end or merge the files.
Have listed below examples of input and output.
True, that was my mistake. O/P dataset cannot have the same lrecl as input dataset1.

1. Sample records in Dataset 1 are listed below. lrecl = 133 and FB.

Message from Program A-
1111 aaaa
5555 sssss
3333 www


2. Sample records in Dataset 2 are listed below. lrecl = 203 and FB.

Error records displayed.
11111111111111 ppppppppppppppppppppppppp
22222222222222 yyyyyyyyyyyyyyyyyyyyyyyyy
55555555555555 hhhhhhhhhhhhhhhhhhhhhhhhh


3. Output dataset will be NEW Dataset3. lrecl = 203 and FB.
No sorting required.
O/P records should appear as listed below.



Message from Program A-
1111 aaaa
5555 sssss
3333 www
Error records displayed.
11111111111111 ppppppppppppppppppppppppp
22222222222222 yyyyyyyyyyyyyyyyyyyyyyyyy
55555555555555 hhhhhhhhhhhhhhhhhhhhhhhhh
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 Mar 24, 2010 12:05 am    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. Just be sure to use a MOD data set for //OUT.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/133)
//IN2 DD DSN=...  input file2 (FB/203)
//OUT DD DISP=(MOD,...),DSN=...  output file (FB/203)
//TOOLIN DD *
  COPY FROM(IN1) TO(OUT) USING(CTL1)
  COPY FROM(IN2) TO(OUT)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(203:X)
/*


Quote:
2. If Dataset 3 and dataset 4 exist, can these two datasets also be appended to Dataset 1?


Yes, just add additional COPY operators with INREC statements as needed to pad or truncate to the output length.
Back to top
View user's profile Send private message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Wed Mar 24, 2010 12:56 am    Post subject:
Reply with quote

Thanks Frank.

Maybe I am missing something, the output dataset is not created.
Condition code is zero, and DFSMSG shows the correct number of records in and out for both input datasets.

The JCL is listed below-

Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=PHRD.DATA.EMAIL2.PHR431B0,DISP=SHR
//IN2 DD DSN=PHRD.INMAIN.NOTUNIT.PHR431B0,DISP=SHR
//OUT DD DISP=(MOD),DSN=PHRD.DATA.SS10,
//            UNIT=DISK,
//            DCB=(LRECL=203,BLKSIZE=27811,RECFM=FB),
//            SPACE=(TRK,(50,50),RLSE)
//TOOLIN DD *
  COPY FROM(IN1) TO(OUT) USING(CTL1)
  COPY FROM(IN2) TO(OUT)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(203:X)
/*
Code'd
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Mar 24, 2010 1:24 am    Post subject:
Reply with quote

Hello,

I suspect that the dataset was created and then discarded because no retention was specified and the dataset was PASSed (to the "bit bucket"). . .
Back to top
View user's profile Send private message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Wed Mar 24, 2010 1:39 am    Post subject:
Reply with quote

Thanks Dick.
My mistake, it works now.

I should have changed the disp parameter to (MOD,CATLG,DELETE).

Frank , thanks, it works now.
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 Mar 24, 2010 2:44 am    Post subject:
Reply with quote

You're welcome.

I'll try to remember to show it as DISP=(MOD,...) instead of DISP=MOD in the future. I usually use temporary data sets with DISP=(MOD,PASS) in my testing and I don't like to assume the type of data set somebody is using so I tend to show generic DD info.

I changed my post above to show DISP=(MOD,...).
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
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts DUMP DATASETS VS TRACE DATASETS! lind sh CICS 4 Tue Dec 06, 2016 11:31 pm


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