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

SORT Trailer Count - LRECL Output controlled by Input (?)


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

New User


Joined: 29 Aug 2017
Posts: 2
Location: US

PostPosted: Tue Aug 29, 2017 8:57 pm
Reply with quote

I have a Sort improvement I would like to make ,
Requirement: Input (25 bytes) SORTOF3 (80 bytes)
//STEP0A2 EXEC PGM=SORT
//SORTIN DD dsn=filename ( lrecl=25)
//SORTOUT DD DSN=fileout (lrecl=25)
//SORTOF2 DD DSN=fileof2 (lrecl=25)
//SORTOF3 DD DSN=fileof3 ( need this to be 80 )
//SYSIN DD *
SORT FIELDS=(1,25,CH,A)
SUM FIELDS=NONE
OUTFIL FILES=(OUT)
OUTFIL FILES=(2)
OUTFIL FILES=(3),REMOVECC,NODETAIL,
TRAILER1=(1:'I000000002000000001000',COUNT=(M11,LENGTH=15),43C' ')

This fails with :
ICE222A 0 25 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 80 BYTE LRECL FOR SORTOF3

How can I convert :
OUTFIL FILES=(3),REMOVECC,NODETAIL,
TRAILER1=(1:'I000000002000000001000',COUNT=(M11,LENGTH=15),43C' ')

To:
OUTFIL FILES=(3),REMOVECC,NODETAIL,
Replacing the trailer1 with a statement
USING Outrec or Build so the output LRECL = 80

Why:
All I need Is to count the number of record in sortin…. Output format as shown, question is can I do it in the same step or do I have to add another step and then
I could alter the input using INREC to go up to 80 and then use trailer1 for sortof3,
( this changes sortof2 and sortout to be 80 which is no good, that is why I would have to add another step, seriously ?)
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2569
Location: NYC,USA

PostPosted: Tue Aug 29, 2017 10:07 pm
Reply with quote

Welcome!!
Please make a use of code tags.
Code:
//STEP0A2 EXEC PGM=SORT
 //SORTIN DD dsn=filename ( lrecl=25)
 //SORTOUT DD DSN=fileout (lrecl=25)
 //SORTOF2 DD DSN=fileof2 (lrecl=25)
 //SORTOF3 DD DSN=fileof3 ( need this to be 80 )
 //SYSIN DD *
 SORT FIELDS=(1,25,CH,A)
 SUM FIELDS=NONE
 OUTFIL FILES=(OUT)
 OUTFIL FILES=(2)
 OUTFIL FILES=(3),REMOVECC,NODETAIL,OUTREC=(80X),
 TRAILER1=(1:'I000000002000000001000',COUNT=(M11,LENGTH=15))
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 925
Location: Maryland

PostPosted: Tue Aug 29, 2017 10:39 pm
Reply with quote

amorante wrote:
All I need Is to count the number of record in sortin…. Output format as shown, question is can I do it in the same step or do I have to add another step and then I could alter the input using INREC to go up to 80 and then use trailer1 for sortof3, (this changes sortof2 and sortout to be 80 which is no good, that is why I would have to add another step, seriously ?)

What prevents you from doing this in one step??
I do not see any reason for that yet.

Did you get any error, or what?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2569
Location: NYC,USA

PostPosted: Wed Aug 30, 2017 12:56 am
Reply with quote

The one I posted above is already working fine with OUTREC.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Wed Aug 30, 2017 1:00 am
Reply with quote

amorante, Show the actual Job that you submitted (or want to modify) with DISP and DCB parameters for the output files.

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

New User


Joined: 29 Aug 2017
Posts: 2
Location: US

PostPosted: Wed Aug 30, 2017 3:17 am
Reply with quote

Rohit approach is the correct one, thank you Rohit
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 Very Large Sort failed - Seeking reco... DFSORT/ICETOOL 5
No new posts Date conversion using SORT SYNCSORT 4
No new posts Record count of RECFM=U tape file DFSORT/ICETOOL 17
No new posts Which SORT utility can improve the Pe... DFSORT/ICETOOL 16
No new posts Using sort on VB records based on off... DFSORT/ICETOOL 6
Search our Forums:

Back to Top