Page 1 of 1

can i use the different length for the sortin and sortout

PostPosted: Mon Oct 03, 2016 3:46 pm
by arya_starc
Hi All,

Can I pass the sortin and Sortout of different length.
example:-
consider this scenario

I having SORTIN is of length 35 but after sorting operation I get the output in length 37.
as I am using outfil and using TOT operation so the field length is increased, can anyone tell is it possible?

Re: can i use the different length for the sortin and sortou

PostPosted: Mon Oct 03, 2016 3:54 pm
by enrico-sorichetti
can anyone tell is it possible?

a Yes/No question deserves a Yes/No answer

Yes - it is possible - how ... search the forum, gazillions of examples

Re: can i use the different length for the sortin and sortou

PostPosted: Mon Oct 03, 2016 4:04 pm
by arya_starc
enrico-sorichetti wrote:
can anyone tell is it possible?

a Yes/No question deserves a Yes/No answer

Yes - it is possible - how ... search the forum, gazillions of examples


I am using trailer in the sort control card
Below is my sort controlcard

  SORT FIELDS=(1,2,ZD,A)                                                
  OUTFIL REMOVECC,                                                      
  TRAILER1(1:1C'TOTAL',                                                
          11:TOT=(11,9,SFF,EDIT=(I,II,III,III),LENGTH=12),              
           24:TOT=(20,16,SFF,EDIT=(II,III,III,III,III),LENGTH=18))      
 


I got max cc 16 with below message as I given the input record length of 35 and I having the sortout file of length 41

ICE201I 0 RECORD TYPE IS F - DATA STARTS IN POSITION 1                          
ICE805I 1 JOBNAME: ZTHTSORT , STEPNAME: STEP010                                
ICE802I 0 BLOCKSET     TECHNIQUE IN CONTROL                                    
ICE143I 0 BLOCKSET     SORT  TECHNIQUE SELECTED                                
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5650-ZOS, Z/OS DFSORT V2R1  - 17:31 ON MON OC
            SORT FIELDS=(1,2,ZD,A)                                              
            OUTFIL REMOVECC,                                                    
            TRAILER1(1:1C'TOTAL',                                              
                    11:TOT=(11,9,SFF,EDIT=(I,II,III,III),LENGTH=12),            
                     24:TOT=(20,16,SFF,EDIT=(II,III,III,III,III),LENGTH=18))    
ICE222A 0 35 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 41 BYTE LRECL FOR SORTOUT
ICE751I 0 C5-I21470 C6-BASE   C7-K96411 C8-I25275 E4-BASE   E7-I22412          
ICE052I 3 END OF DFSORT                                                        

 

Re: can i use the different length for the sortin and sortou

PostPosted: Mon Oct 03, 2016 4:57 pm
by Aki88
Hello,

Quoting Mr. Boyo's reponse to your last post on this forum wherein you pointed out TRAILER1 worked without BUILD:

BillyBoyo wrote:That is because your records present to OUTFIL are at least 36 bytes long. If your OUTFIL records are shorter than the HEADERn/TRAILERn output, you get a run-time failure.


Now, this is where BUILD is actually helpful- it helps you Build your output in the desired format; Change your OUTFIL to below code, and see what happens:


OUTFIL REMOVECC,BUILD=(1,35,6X),
 


Note: There are other ways of doing this too, for example tweaking the data with INREC and so on.

Re: can i use the different length for the sortin and sortou

PostPosted: Tue Oct 04, 2016 1:06 am
by arya_starc
Aki88 wrote:Hello,

Quoting Mr. Boyo's reponse to your last post on this forum wherein you pointed out TRAILER1 worked without BUILD:

BillyBoyo wrote:That is because your records present to OUTFIL are at least 36 bytes long. If your OUTFIL records are shorter than the HEADERn/TRAILERn output, you get a run-time failure.


Now, this is where BUILD is actually helpful- it helps you Build your output in the desired format; Change your OUTFIL to below code, and see what happens:


OUTFIL REMOVECC,BUILD=(1,35,6X),
 


Note: There are other ways of doing this too, for example tweaking the data with INREC and so on.

Thanks a lot..i start to read the DFSORT as i am deeply impressed by the various functions of DFSORT.

Re: can i use the different length for the sortin and sortou

PostPosted: Tue Oct 04, 2016 10:42 am
by BillyBoyo
Start with the Getting Started Guide.