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: 447
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: 388
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: 2448
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: 388
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: 388
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: 2448
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 Joining 2 records to 1 using Sort cmuncan DFSORT/ICETOOL 1 Sat Dec 08, 2018 8:53 am
This topic is locked: you cannot edit posts or make replies. DFSORT output in CSV for data spans i... hiravibk DFSORT/ICETOOL 3 Tue Nov 13, 2018 7:55 pm
No new posts Writing multiple records into a CSV r... hiravibk DFSORT/ICETOOL 2 Wed Nov 07, 2018 2:35 pm
No new posts Can records in IMS/DB be related usin... SRICOBSAS IMS DB/DC 2 Fri Oct 19, 2018 3:53 pm
No new posts Anyone know how to copy Unix files? John Poulakos JCL & VSAM 7 Wed Oct 10, 2018 12:57 am

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