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

Can DFSORT "chop" variable length records into mul


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

New User


Joined: 07 Feb 2006
Posts: 11

PostPosted: Wed Mar 01, 2006 4:51 am
Reply with quote

Can DFSORT "chop" variable-length records into multiple fixed-length records ? I have written a generic Assembler program to do it but I
wonder if there is a trick to do it with DFSORT.

Sample input:
---------------
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1234567890
...
...

Sample output (output lrecl=4, pad last record with blanks):
--------------------------------------------------------------------
ABCD
EFGH
IJKL
MNOP
QRST
UVWX
YZ
1234
5678
90
...
...
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: Wed Mar 01, 2006 6:23 am
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed your input file had LRECL=32, but the OUTREC parameter can be changed appropriately for other LRECLs.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG   DD  SYSOUT=*
//IN DD DSN=...  input file (VB/32)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=... output file (FB/4)
//TOOLIN   DD    *
COPY FROM(IN) USING(CTL1)
COPY FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
   OUTFIL FNAMES=T1,VTOF,
     OUTREC=(5,4,/,9,4,/,13,4,/,17,4,/,21,4,/,25,4,/,29,4)
/*
//CTL2CNTL DD *
   OMIT COND=(1,4,CH,EQ,C' ')
/*
Back to top
View user's profile Send private message
Joel

New User


Joined: 07 Feb 2006
Posts: 11

PostPosted: Wed Mar 01, 2006 9:17 pm
Reply with quote

Here's my program in case anyone wants it:

Code:

        @GEN1 CHOP                                                     
         OPEN  (SYSUT1,(INPUT),SYSUT2,(OUTPUT))                         
         LH    4,SYSUT2+82                                             
         LA    6,DUMMY                                                 
DO01     GET   SYSUT1                                                   
           LR    5,1                                                   
           LH    9,0(,5)                                               
           LR    0,5                                                   
           LR    2,6                                                   
           LA    1,2(,9)                                               
           LR    3,1                                                   
           CLCL  0,2                                                   
             BE    DO01                                                 
           LR    6,5                                                   
           MVC   RC,=A(1)                                               
           LA    11,2(,5)                                               
DO02       PUT   SYSUT2                                                 
             LR    10,1                                                 
IF01         CR    9,4                                                 
               BNL   ELSE01                                             
               LR    3,9                                               
               B     EIF01                                             
ELSE01         LR    3,4                                               
EIF01        DS    0H                                                   
             LR    0,10                                                 
             LR    2,11                                                 
             LR    1,3                                                 
             MVCL  0,2                                                 
             AR    11,4                                                 
             SR    9,4                                                 
               BP    DO02                                               
               BZ    DO01                                               
           LA    0,0(4,9)                                               
           AR    0,10                                                   
           LPR   1,9                                                   
           ICM   3,B'1000',=C' '                                       
           MVCL  0,2                                                   
           B     DO01                                                   
         @EXODUS                                                       
DUMMY    DC    H'5',CL5'DUMMY'                                         
SYSUT1   DCB   DDNAME=SYSUT1,DSORG=PS,MACRF=GL,EODAD=EXIT               
SYSUT2   DCB   DDNAME=SYSUT2,DSORG=PS,MACRF=PL,RECFM=FB
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 0
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top