Split portion of record data into multiple output records



Split portion of record data into multiple output records

Postby quickfix25 » Sat Nov 19, 2022 10:00 pm

Hello Team,

I am trying to split the input records and create output records by padding first portion of record data (14 bytes) with repeating fixed length data (15 bytes) from remaining portion of the same record. The repeated fixed data starts from column position 16.

Input file layout (FB,LRECL=60):

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6            
****** ***************************** Top of Data ******************************
000001 RECORD DETAIL1 S100NN         S200YN         S300NN                    
000002 RECORD DETAIL2 K400YY         K500NN         K600YN                    
000003 RECORD DETAIL3 P700NN         P800YY         P900NY                    
****** **************************** Bottom of Data ****************************



Trying for output (FB,LRECL=80):
RECORD DETAIL1 S100NN
RECORD DETAIL1 S200YN
RECORD DETAIL1 S300NN
RECORD DETAIL2 K400YY
RECORD DETAIL2 K500NN
RECORD DETAIL2 K600YN
RECORD DETAIL3 P700NN
RECORD DETAIL3 P800YY
RECORD DETAIL3 P900NY


I test ran this jcl and got below output:

//STEP0001 EXEC PGM=ICETOOL                                  
//TOOLMSG  DD  SYSOUT=*                                      
//DFSMSG   DD  SYSOUT=*                                      
//IN       DD  DISP=SHR,DSN=INPUT DATASET,FB,LRECL=60
//OUT      DD  DSN=OUTPUT DATASET,FB,LRECL=80            
//TOOLIN   DD  *                                            
 RESIZE FROM(IN) TO(OUT) TOLEN(15)  USING(CTL1)              
/*                                                          
//CTL1CNTL DD *                                              
 INREC BUILD=(1,60)                                          
/*          



Test Output:
********************************* Top of Data **********************************
RECORD DETAIL1                                                                  
S100NN                                                                          
S200YN                                                                          
S300NN                                                                          
RECORD DETAIL2                                                                  
K400YY                                                                          
K500NN                                                                          
K600YN                                                                          
RECORD DETAIL3                                                                  
P700NN                                                                          
P800YY                                                                          
P900NY                                                                          
******************************** Bottom of Data ********************************


I am trying to hold first portion of record data across the repeated data strings. Appreciate your inputs, thoughts or suggestions.

Regards,
Raja.
quickfix25
 
Posts: 1
Joined: Fri May 13, 2022 11:28 pm
Has thanked: 0 time
Been thanked: 0 time

Return to Site Announcements