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

Merging 3 records into 1 record


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

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Fri Mar 11, 2011 2:08 am
Reply with quote

Hi All,

I was trying to merge 3 records into one record.I used the approach mention by Ronald in
ibmmainframes.com/viewtopic.php?t=53716&highlight=111x
but when I am using it, it is giving error INVALID DATA SET ATTRIBUTES SPECIFIED SORTIN LRECL. Lrecl of my input dataset is 80.I overrided it with 240 as I have 3 records.

THe post was related to syncsort. Can we override the LRECL in DFSORT.

Thanks.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Mar 11, 2011 2:17 am
Reply with quote

If you have the latest DFSORT PTF (Oct, 2010), you can actually use the RESIZE operator of DFSORT's ICETOOL to do this kind of thing quite easily without having to mess with the LRECL. For details and examples, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242

However, if you don't have that PTF, you can override the LRECL with DFSORT. I would have to see your actual JES log (JCL, messages) to help you figure out what you did wrong.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Fri Mar 11, 2011 2:55 am
Reply with quote

Two reasons that come to mind that might cause this error using the technique I suggested are:
a) the input file RECFM is V or VB (the technique will NOT work for Variable Length files).
b) if SORTIN was a concatenation of files and you did NOT override the LRECL on EACH of the files in the concatenation

Without seeing the JCL, the File attributes (obtainable via ISPF 3.4), and the JES log, it is difficult to guess what actually caused the error. Obfuscate DSN's, data, etc. that are proprietary/ personal/rivate, as necessary.
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Fri Mar 11, 2011 3:06 am
Reply with quote

Code:
//JK2     EXEC PGM=SORT                                               
//SYSOUT  DD SYSOUT=*                                                 
//DFSMSG  DD SYSOUT=*                                                 
//SORTIN  DD DSN=AAA.BBBBB.CCCCC(RAHUL4),DISP=SHR,             
//           DCB=(RECFM=FB,LRECL=240)                                 
//SORTOUT DD DSN=AAA.BBBBB.CCCC.INPUT,DISP= (NEW,CATLG,DELETE),
//           UNIT=SYSDA,DCB=(RECFM=FB,LRECL=80)                       
//SYSIN DD *                                                         
 SORT FIELDS=COPY                                                     
 OUTREC FIELDS=(60,10,X,35,2,X,115,2,X,195,2,43X)                     
 END                                                                 
/*                                                                   


Error
Code:
           SORT FIELDS=COPY                                     
           OUTREC FIELDS=(60,10,X,35,2,X,115,2,X,195,2,43X)     
           END                                                 
ICE043A 3 INVALID DATA SET ATTRIBUTES SPECIFIED SORTIN   LRECL 
ICE751I 0 C5-K51706 C6-K51706 C7-K51706 C8-K51706 E7-K51706     
ICE052I 3 END OF DFSORT                                         
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Mar 11, 2011 3:29 am
Reply with quote

the only drawback of using the LRECL trick is that it will not work if the blocksize is not multiple of both LRECL' s

an lrecl of 80 and the optimum blksize of 27920 will give 349 records per block

and since 349 is prime any <pseudo reblocking> will fail
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Fri Mar 11, 2011 3:46 am
Reply with quote

Enrico, I believe that you have exposed the probable cause.
My fault for not having mentioned the blksize caveat in the prior thread, and in this one.

As an aside, I created an 80 byte dataset containing 6 records (which ended up being blocked at 27920, just as you surmised) and the subsequent SORT failed with the same error indicated by rgupta71. I then re-created the SORTIN dataset with a blksize of 480 and the sort worked like a charm.
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Fri Mar 11, 2011 5:16 am
Reply with quote

Thanks Enrico and Ronald.
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Fri Mar 11, 2011 8:31 pm
Reply with quote

I changed the blocksize
For sortin
Code:
DCB=(RECFM=FB,LRECL=240,BLKSIZE=2400)

For sortout
Code:
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800) 


Below error is coming
Code:
0 EXCP ACCESS METHOD USED FOR SORTOUT                               
0 EXCP ACCESS METHOD USED FOR SORTIN                                 
5 I/O ERROR, DD SORTIN  , DEV A83E, ECB 41, CSW 0C40, SENSE 0000     
1 EF-K49534 F0-K30362 E8-K51706                                     
0 END OF DFSORT


Thanks.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Fri Mar 11, 2011 10:24 pm
Reply with quote

If an input dataset RECFM is FB, the LRECL can only be overridden as long as the existing BLKSIZE is an exact multiple of the revised LRECL, since LRECL is really just a "logical" attribute - that is, LRECL stands for LOGICAL record length. For example, a BLKSIZE of 400 could contain either 4 100-byte LOGICAL records, or 5 80-byte LOGICAL records, or 8 50-byte LOGICAL records, or 10 40-byte LOGICAL records, etc.

However, an input dataset's BLKSIZE is a "physical" attribute, and it can NOT be successfully overridden. The actual size of every block of an FB dataset must be equal to the (implicit or explicit) BLKSIZE except for the LAST block in the dataset, which can be a "short" block. But whether an FB dataset's block is "standard" or "short", it must always be an exact multiple of the LRECL (whether implicit or explicit).

If your input dataset BLKSIZE is not a multiple of your override LRECL, then the dataset must be reblocked to a BLKSIZE that IS a multiple of your override LRECL before you can use the LRECL override technique. Perhaps the easiest way to do this is by copying/reblocking the original dataset with an IEBGENER step, as follows (note, in a very many shops, a straightforward IEBGENER copy step (i.e. SYSIN is DUMMY) invokes the SORT product under the covers):

Code:
//STEP     EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=your.input.dataset,DISP=SHR
//SYSUT2   DD DSN=your.reblocked.dataset,UNIT=DISK,DISP=(,PASS),
//            DCB=(RECFM=FB,LRECL=newLRECL,BLKSIZE=n*newLRECL),
//            SPACE=(???)   
//SYSIN    DD DUMMY
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Fri Mar 11, 2011 10:48 pm
Reply with quote

Thanks Ronald for your time.
I got the results and also got some concepts about BLKSIZE.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top