Page 1 of 1

Convert fixed-length input records to variable-length output

Posted: Wed Oct 23, 2024 1:45 pm
by xcspg3
Hi, I can't find the reason why the output records are not written correctly and yet it all seems very simple to me

SORTIN => Record format . . . : VB Record length . . . : 1025
SORTOUT => Record format . . . : FB Record length . . . : 12

Input record

Code: Select all

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 021000001351791m   430352 <2424 %000000 ð004518 æ0565951  SRL    0 §DUBB
       FFFFFFFFFFFFFFF9103FFFFFF04FFFF06FFFFFF08FFFFFF09FFFFFFF00EDD4401F07CECC
       0210000013517914C0C4303520C24240C0000000C0045180C05659511C293001C01C4422
------------------------------------------------------------------------------
000002 021000002310513kð  600000 <2278 %000000 ð001784 æNO-PREV  CO     0 §BUSS
       FFFFFFFFFFFFFFF9803FFFFFF04FFFF06FFFFFF08FFFFFF09DD6DDCE00CD44401F07CEEE
       0210000023105132C0C6000000C22780C0000000C0017840C56079551C360001C01C2422
 


Output record

Code: Select all

=COLS> ----+----1--                                                            
****** ***************************** Top of Data ******************************
351791 000001351791                                                            
       FFFFFFFFFFFF                                                            
       000001351791                                                            
------------------------------------------------------------------------------
310513 000002310513                                                            
       FFFFFFFFFFFF                                                            
       000002310513                                                            


Jcl

Code: Select all

//S10      EXEC PGM=ICEMAN                
//SYSOUT   DD SYSOUT=*                    
//SORTIN   DD DISP=SHR,DSN=...    
//SORTOUT  DD DSN=...,            
//            DISP=(NEW,CATLG,DELETE),    
//            SPACE=(TRK,(1,1,),RLSE,,),  
//            RECFM=FB,LRECL=12            
//SYSIN    DD *                            
 SORT FIELDS=COPY                          
 INCLUDE COND=(05,03,CH,EQ,C'021')        
 OUTFIL OUTREC=(08,12),CONVERT            
//*                                        
 


Can someone help me?
Thanks

Re: Convert fixed-length input records to variable-length ou

Posted: Wed Oct 23, 2024 2:33 pm
by xcspg3
Sorry, the correct title is "Convert fixed-length input records from variable-length output", "from" and not "to"

Re: Convert fixed-length input records to variable-length ou

Posted: Wed Oct 23, 2024 5:48 pm
by sergeyken
Please, present here THE FULL LOG OF MESSAGES produced by SORT.

I believe, you get exactly what is defined by your statements. What is wrong?

Re: Convert fixed-length input records to variable-length ou

Posted: Wed Oct 23, 2024 5:59 pm
by sergeyken
SORT considered every V-format record including its RDW (starting from position 1).
ISPF and almost all other tools do consider V-format records only as their data-part. The position 1 for ISPF is equivalent to position 5 for SORT.

Re: Convert fixed-length input records to variable-length ou

Posted: Thu Oct 24, 2024 2:04 pm
by xcspg3
Hi, maybe the reason is the input data set, after I changed it in edit the problem disappeared. If you look at the sortout you will be able to see the line number is not the progressive 1,2,... but it is wrong and this then creates problems in subsequent processing. Fixed issue with new input allocation.

Re: Convert fixed-length input records to variable-length ou

Posted: Wed Oct 30, 2024 1:09 pm
by sergeyken
My impression is: you do not read the answers.

If so, there is no reason to ask questions.