JCL to get right justified for a Column value



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

JCL to get right justified for a Column value

Postby rjambu » Wed Mar 23, 2011 10:31 pm

Hi,
I need the 20th Column value in the output with 2 char and should be right justified.

Ip file:

123456789|SAMPLE1|20100209|20100801|20100818|20110118||PA||T1|||A|256789.00 |Y|1234|A001|||30000020|TESTDT1|A|SAS|PURES|99|AZ|DT01|USD|01|01|1
222222222|TESTDA1|20100209|20100802|20100818|20101118||OH||T2|||B|33330.00 |Y|1150|A002|||20000010|TESTDT2|B|NONE|TST01|01|NY|DT01|USD|01|01|3


below is the 20th col i/p and required o/p,
I/p required o/p
30000020 20
20000010 10

Below is the JCL i use to do the parsing But not getting the desired result for the 20th column.
//SORTIN   DD  DSN=A.B.C,DISP=SHR   
//SORTOUT  DD  DSN=A.B.D,         
//             UNIT=DISK,SPACE=(TRK,(1,2),RLSE), 
//             DCB=(LRECL=185,BLKSIZE=0,RECFM=FB),
//             DISP=(NEW,CATLG,DELETE)           
//SYSSORT  DD SYSOUT=*                           
//SYSUDUMP DD SYSOUT=*                           
//*
//SYSIN    DD  *                                           
  OPTION COPY                                             
  INREC IFOUTLEN=185,                                     
  IFTHEN=(WHEN=INIT,                                       
       PARSE=(%00=(ENDBEFR=X'6A',FIXLEN=12),               
              %01=(ENDBEFR=X'6A',FIXLEN=12),               
              %02=(ENDBEFR=X'6A',FIXLEN=08),               
              %03=(ENDBEFR=X'6A',FIXLEN=08),               
              %04=(ENDBEFR=X'6A',FIXLEN=08),               
              %05=(ENDBEFR=X'6A',FIXLEN=08),               
             %06=(ENDBEFR=X'6A',FIXLEN=30),                           
             %07=(ENDBEFR=X'6A',FIXLEN=02),                           
             %08=(ENDBEFR=X'6A',FIXLEN=02),                           
             %09=(ENDBEFR=X'6A',FIXLEN=05),                           
             %10=(ENDBEFR=X'6A',FIXLEN=06),                           
             %11=(ENDBEFR=X'6A',FIXLEN=06),                           
             %12=(ENDBEFR=X'6A',FIXLEN=01),                           
             %13=(ENDBEFR=X'6A',FIXLEN=18),                           
             %14=(ENDBEFR=X'6A',FIXLEN=01),                           
             %15=(ENDBEFR=X'6A',FIXLEN=15),                           
             %16=(ENDBEFR=X'6A',FIXLEN=02),                           
             %17=(ENDBEFR=X'6A',FIXLEN=06),                           
             %18=(ENDBEFR=X'6A',FIXLEN=06),                           
             %19=(ENDBEFR=X'6A',FIXLEN=02),                           
             %20=(ENDBEFR=X'6A',FIXLEN=02),                           
             %21=(ENDBEFR=X'6A',FIXLEN=01),                           
             %22=(ENDBEFR=X'6A',FIXLEN=03),                           
             %23=(ENDBEFR=X'6A',FIXLEN=30)),                           
BUILD=(%00,%01,%02,%03,%04,%05,%06,%07,%08,%09,%10,%11,%12,           X
       %13,UFF,PD,LENGTH=9,                                           X
       %14,%15,%16,%17,%18,%19,JFY=(SHIFT=RIGHT),%20,%21,%22,%23)),   
  IFTHEN=(WHEN=INIT,                                                   
  BUILD=(1,147,148,38))                                               
/*
//

rjambu
 
Posts: 27
Joined: Tue Feb 08, 2011 7:59 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL to get right justified for a Column value

Postby Frank Yaeger » Wed Mar 23, 2011 11:04 pm

Just make the following changes:

    ...
    %19=(ENDBEFR=X'6A',FIXLEN=08),             
    ...
      %14,%15,%16,%17,%18,%19,UFF,EDIT=(TT),%20,%21,%22,%23))


Note that you don't need the X's or the second IFTHEN clause.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post