Sort jcl - report writer queries using OUTREC

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
jathampy
Member
Posts: 22
Joined: Sat Sep 26, 2009 4:02 pm
Location: software engineer

Sort jcl - report writer queries using OUTREC

Post by jathampy » Mon Mar 29, 2010 11:24 pm

I have the following questions relate to Sort reports

Q1
I am using the following SORT to create a report. However the date is displayed as 29-03-2010 in the report. Instead my requirement is to display the date as 29-MAR-2010 in the report. Is there any date format that displays the month name ?.

SORT FIELDS=COPY
OUTFIL HEADER1=(52:'BDCN999A - PRODUCT CODE 114138'),
HEADER2=(1:DATE=(DM4-),
51:'PRODUCED BY BRANCH SYSTEMS - MIS',
110:'PAGE ',PAGE,/,
1:'----------------------------------------',
41:'----------------------------------------',
81:'---------------------------------------',
120:'-------------',/,
1:'BRANCH',
17:'TILL',
31:'RECEIPT',
49:'PRODUCT',
67:'PLANNING',
86:'EMP',
110:'QTY',
126:'PRICE',/,
67:'GROUP',
86:'NO',/,
1:'----------------------------------------',
41:'----------------------------------------',
81:'---------------------------------------',
120:'-------------'),
TRAILER1(1:'END OF REPORT'),
OUTREC=(1:1,4,17:5,2,31:7,4,49:11,6,67:17,4,
86:21,10,110:31,3,PD,M0,LENGTH=4,
126:34,4,PD,EDIT=(IIT.TTS),SIGNS=(,,,-))

Q2 I tried the above jcl using ICETOOL display operator and I couldn't find any Edit pattern similar to EDIT=(IIT.TTS). I would like to know the edit pattern or pre-defined edit masks similar to EDIT=(IIT.TTS) which can be used in display operator.

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Tue Mar 30, 2010 4:08 am

Q1. With INREC, you can use DATE=(DM4-) to put the dd-mm-yyyy date at the end of the record and convert the mm to 'mon' with CHANGE. Then you can use the resulting constant in your header. If you want me to show you how to do this, tell me the RECFM and LRECL of your input file.

Q2. Not sure I understand your question here. Are you looking for an Mn edit mask equivalent to EDIT=(IIT.TTS),SIGNS=(,,,-)? If so, why? You can just use EDIT=(IIT.TTS),SIGNS=(,,,-).
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

jathampy
Member
Posts: 22
Joined: Sat Sep 26, 2009 4:02 pm
Location: software engineer

Post by jathampy » Tue Mar 30, 2010 5:19 am

Thanks Frank for your Quick Response.

Q1: The input file record format is FB and the LRECL is 110.It would be great if you can show me how to pass the date constant to Header2.

Q2.Initially I was trying my requirement using DISPLAY operator of ICETOOL instead of SORT report writer. However I was not able to find out the equivalent edit pattern EDIT=(IIT.TTS) used in ON field of DISPLAY operator. I tried using
HEADER('PRICE') ON(34,4,PD,E'999.99S') and HEADER('PRICE') ON(34,4,PD,C6)
and both are not giving the expected results similar to EDIT=(IIT.TTS). Hence I would like to know the edit pattern similar to EDIT(IIT.TTS) that can be used in ON field of DISPLAY operator.

skolusu
Member
Posts: 43
Joined: Sat Jul 26, 2008 12:38 am

Post by skolusu » Tue Mar 30, 2010 9:24 pm

jathampy,

Here is a job which would convert the date into a month name and write it on the header2

Code: Select all

//SYSIN    DD *                                               
  SORT FIELDS=COPY                                            
  OUTREC OVERLAY=(132:DATE1,                                  
                  136,2,CHANGE=(3,C'01',C'JAN',C'02',C'FEB',  
                                  C'03',C'MAR',C'04',C'APR',  
                                  C'05',C'MAY',C'06',C'JUN',  
                                  C'07',C'JUL',C'08',C'AUG',  
                                  C'09',C'SEP',C'10',C'OCT',  
                                  C'11',C'NOV',C'12',C'DEC')) 
  OUTFIL REMOVECC,                                            
  OUTREC=(1:1,4,17:5,2,31:7,4,49:11,6,67:17,4,                
          86:21,10,110:31,3,PD,M0,LENGTH=4,                   
         126:34,4,PD,EDIT=(IIT.TTS),SIGNS=(,,,-)),            
  HEADER1=(52:'BDCN999A - PRODUCT CODE 114138'),              
  HEADER2=(01:138,2,'-',140,3,'-',132,4,                      
           51:'PRODUCED BY BRANCH SYSTEMS - MIS',             
           110:'PAGE ',PAGE,/,                                
           01:131'-',/,                                       
           01:'BRANCH',                                       
           17:'TILL',                                         
           31:'RECEIPT',                                      
           49:'PRODUCT',                                      
           67:'PLANNING',                                     
           86:'EMP',                                          
          110:'QTY',                                          
          126:'PRICE',/,                                      
           67:'GROUP',                                        
           86:'NO',/,                                         
           01:131'-'),                                        
  TRAILER1(1:'END OF REPORT')                                 
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Tue Mar 30, 2010 9:46 pm

I would like to know the edit pattern similar to EDIT(IIT.TTS) that can be used in ON field of DISPLAY operator.
Oh, now I understand what you want. Unfortunately, DISPLAY does NOT have an equivalent for that edit pattern so you're better off using OUTFIL.
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

jathampy
Member
Posts: 22
Joined: Sat Sep 26, 2009 4:02 pm
Location: software engineer

Post by jathampy » Tue Mar 30, 2010 10:35 pm

Thanks Frank and Kolusu for your help.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others