Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Copy records with unknown LRECL

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

New User


Joined: 22 Nov 2007
Posts: 58
Location: Germany

PostPosted: Tue Jul 24, 2018 7:50 pm    Post subject: Copy records with unknown LRECL
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: 438
Location: USA

PostPosted: Tue Jul 24, 2018 8:09 pm    Post subject: Reply to: Copy records with unknown LRECL
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

Active User


Joined: 29 Apr 2008
Posts: 340
Location: Maryland

PostPosted: Tue Jul 24, 2018 9:19 pm    Post subject:
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: 58
Location: Germany

PostPosted: Tue Jul 24, 2018 11:29 pm    Post subject:
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: 2386
Location: @my desk

PostPosted: Tue Jul 24, 2018 11:40 pm    Post subject:
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

Active User


Joined: 29 Apr 2008
Posts: 340
Location: Maryland

PostPosted: Wed Jul 25, 2018 12:53 am    Post subject:
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

Active User


Joined: 29 Apr 2008
Posts: 340
Location: Maryland

PostPosted: Wed Jul 25, 2018 5:21 am    Post subject:
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: 58
Location: Germany

PostPosted: Wed Jul 25, 2018 2:35 pm    Post subject: Reply to: Copy records with unknown LRECL
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: 2386
Location: @my desk

PostPosted: Wed Jul 25, 2018 9:00 pm    Post subject: Re: Reply to: Copy records with unknown LRECL
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    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 Need Help to Create 4 Output Records ... satish.ms10 DFSORT/ICETOOL 5 Thu Jul 19, 2018 1:55 am
No new posts INCLUDE 2 conditions to copy in the o... Chiku kumar DFSORT/ICETOOL 10 Tue Jul 03, 2018 7:11 pm
No new posts MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us