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

Copy records with unknown LRECL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 64
Location: Germany

PostPosted: Tue Jul 24, 2018 7:50 pm
Reply with quote

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
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Tue Jul 24, 2018 8:09 pm
Reply with quote

You can look at LIKE parameter.

https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.ieab600/xddlike.htm

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

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Tue Jul 24, 2018 9:19 pm
Reply with quote

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
View user's profile Send private message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 64
Location: Germany

PostPosted: Tue Jul 24, 2018 11:29 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jul 24, 2018 11:40 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Wed Jul 25, 2018 12:53 am
Reply with quote

Don’t create unneeded problems by yourself. Use RECFM=VB in all your steps, starting from unloading DB2
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Wed Jul 25, 2018 5:21 am
Reply with quote

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
View user's profile Send private message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 64
Location: Germany

PostPosted: Wed Jul 25, 2018 2:35 pm
Reply with quote

Thanks for help, problem ist solved !

SORT works when SORTIN has RECFM=VB
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jul 25, 2018 9:00 pm
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts Use Copy Utility DB2 7
No new posts To Omit records based n SORT condition DFSORT/ICETOOL 6
No new posts OpenPGP Decryption job getting LRECL ... IBM Tools 7
Search our Forums:

Back to Top