View previous topic :: View next topic
|
Author |
Message |
oerdgie
New User
Joined: 22 Nov 2007 Posts: 64 Location: Germany
|
|
|
|
Hi,
we unload different DB2 tables with DSNTIAUL.
In JCL, the unload files (SYSREC00) have no LRECL in DCB Parameter, because each unload another table causes a different length.
Is it possible to copy (i.e. with DFSORT) each record from an unload file (i.e. from position 3 until end of record) in another file without specified length ?
The RECFM of an unload file is FB.
Thanks for help in advance |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
If any of SORT output datasets has no DCB attributes defined (either in DD, or in DSCB), then SORT utility assigns DCB parameters based on the first of output record created.
If DCB parameters are already defined, they must match the attributes of the output records. |
|
Back to top |
|
|
oerdgie
New User
Joined: 22 Nov 2007 Posts: 64 Location: Germany
|
|
|
|
I like to copy the unload file, using SORT, like this :
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(3,???) <- Length of the record I don't know
/*
The copied records should start in pos. 3.
Is there a trick, to tell SORT : take the rest of the record without specifying the number of Bytes ? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
oerdgie,
What is in the first 2 bytes? Is there something that requires it to be removed?
As an alternative, you could also try modifying the SELECT sql to strip off the first 2 bytes while writing into the unload output itself, instead of having to run it through sort again. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
Don’t create unneeded problems by yourself. Use RECFM=VB in all your steps, starting from unloading DB2 |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
oerdgie wrote: |
Is there a trick, to tell SORT : take the rest of the record without specifying the number of Bytes ? |
Only with RECFM=VB |
|
Back to top |
|
|
oerdgie
New User
Joined: 22 Nov 2007 Posts: 64 Location: Germany
|
|
|
|
Thanks for help, problem ist solved !
SORT works when SORTIN has RECFM=VB |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
oerdgie wrote: |
Thanks for help, problem ist solved !
SORT works when SORTIN has RECFM=VB |
You could still keep the unload output as a VB data set, but you might not need an additional sort step to remove the first 2 bytes. |
|
Back to top |
|
|
|