View previous topic :: View next topic
|
Author |
Message |
Suresh Shankarakrishnan
New User
Joined: 11 Jul 2008 Posts: 42 Location: USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Suresh Shankarakrishnan
New User
Joined: 11 Jul 2008 Posts: 42 Location: USA
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Suresh Shankarakrishnan
New User
Joined: 11 Jul 2008 Posts: 42 Location: USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Suresh Shankarakrishnan
New User
Joined: 11 Jul 2008 Posts: 42 Location: USA
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|