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

Problems about using sort to generate a report


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

New User


Joined: 11 Dec 2008
Posts: 33
Location: China

PostPosted: Mon Dec 22, 2008 3:37 pm
Reply with quote

Hi,everybody

I got a problem about using sort utility to generate a report,here is my situation:
I have a VSAM file with 640 record length.I want to copy some fields to a sequential file,like below:
//STEP010 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=DRCMV.EDQRDEV.EDQSY0F,DISP=SHR
//SORTOUT DD DSN=C210163.OUTFILE(+1),DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(10,10)),DCB=(LRECL=140,BLKSIZE=1400,RECFM=FB)
//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(1:198,44,50:62,8,60:43,7,70:61,1,85:58,3,100:70,3)
/*

But I need a report of these,so i try to these:

//STEP010 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=DRCMV.EDQRDEV.EDQSY0F,DISP=SHR
//OUTFILE DD DSN=C210163.OUTFILE(+2),DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(10,10)),DCB=(LRECL=140,BLKSIZE=1400,RECFM=FBA)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=OUTFILE,LINES=30,
HEADER1=(/,5:'RCMS USER REPORT',25:'PAGE',PAGE,35:DATE=(MD4-),2/,
1:'EMPLOYEE_NAME',50:'USER_ID',60:'RES_ID',
70:'USER_ID_TYPE',85:'RCMS_USER_TYPE',100:'COUNTRY_CODE'),
OUTREC=(1:198,44,50:62,8,60:43,7,70:61,1,85:58,3,100:70,3)
/*

But there is a RC=16,here is the information:

E RECORD TYPE IS F - DATA STARTS IN POSITION 1
0 103 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 140 BYTE LRECL FOR OUTFIL
0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 EE-BASE E9-K90007 E7-K24705
3 END OF DFSORT


Please help me,thanks a lot.

[/img]
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Mon Dec 22, 2008 3:42 pm
Reply with quote

Hi lee_issc !

When using OUTFIL, try to Sub your job without using DCB-LRECL.
Sort will do this for you.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Dec 22, 2008 3:43 pm
Reply with quote

Quote:
ICE222A n BYTE FIXED RECORD LENGTH IS NOT EQUAL TO m BYTE LRECL FOR ddname

Explanation: Critical. The LRECL specified or retrieved for the
fixed-length OUTFIL data set was not equal to the computed length of the
output records for that data set. You cannot use the LRECL value to pad
the OUTFIL records or to truncate the records produced by OUTREC parameter
processing. The values shown in the message are as follows:

- n is the computed length of the output records for the OUTFIL group
- m is the specified or retrieved LRECL of the OUTFIL data set
- ddname indicates the OUTFIL data set for which padding or truncation
was required

Programmer Response: Either let DFSORT set the LRECL to the computed
record length, or use the OUTREC operand of the OUTFIL statement to set
the output record length to the specified LRECL. Remember to allow an
extra byte for OUTFIL report data sets (for the ASA carriage control
character).
Back to top
View user's profile Send private message
lee_issc

New User


Joined: 11 Dec 2008
Posts: 33
Location: China

PostPosted: Mon Dec 22, 2008 8:21 pm
Reply with quote

thanks a lot,UmeySan and also krisprems,two senior member,
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Dec 22, 2008 9:55 pm
Reply with quote

lee_issc,

You really don't need 2 steps to get the desired results. The following DFSORT JCL will give you the desired results


Code:

//STEP0100 EXEC PGM=ICEMAN                       
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD DSN=DRCMV.EDQRDEV.EDQSY0F,
//            DISP=SHR
//FILE1    DD DSN=C210163.OUTFILE(+1),
//            DISP=(NEW,CATLG,DELETE), 
//            UNIT=SYSDA,               
//            SPACE=(TRK,(10,10),RLSE) 
//FILE2    DD DSN=C210163.OUTFILE(+2),
//            DISP=(NEW,CATLG,DELETE), 
//            UNIT=SYSDA,               
//            SPACE=(TRK,(10,10),RLSE) 
//SYSIN    DD *                     
//SYSIN    DD *                     
  SORT FIELDS=COPY 
  INREC FIELDS=(1:198,44,50:62,8,60:43,7,70:61,1,85:58,3,100:70,3,140:X)
                                     
  OUTFIL FNAMES=FILE1               

  OUTFIL FNAMES=FILE2,LINES=30,     
  HEADER1=(/,005:'RCMS USER REPORT',
             025:'PAGE',PAGE,       
             035:DATE=(MD4-),2/,     
             001:'EMPLOYEE_NAME',   
             050:'USER_ID',         
             060:'RES_ID',           
             070:'USER_ID_TYPE',     
             085:'RCMS_USER_TYPE',   
             100:'COUNTRY_CODE')     
/*
Back to top
View user's profile Send private message
lee_issc

New User


Joined: 11 Dec 2008
Posts: 33
Location: China

PostPosted: Tue Dec 23, 2008 11:22 am
Reply with quote

as Skolusu's advise,it doesn't work,

ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE224A 0 FILE1 CANNOT BE USED FOR A REPORT - RECFM WITHOUT 'A' SPECIFIED, OR VSAM DATA SET


what happened?
Back to top
View user's profile Send private message
lee_issc

New User


Joined: 11 Dec 2008
Posts: 33
Location: China

PostPosted: Tue Dec 23, 2008 11:55 am
Reply with quote

thanks all of you,this problem was solved!

ICE224A ddname CANNOT BE USED FOR A REPORT - RECFM WITHOUT ’A’ SPECIFIED, OR VSAM DATA SET

Explanation: Critical. The OUTFIL report specified for the OUTFIL data set associated with ddname cannot be produced because either: v the OUTFIL data set is VSAM, or v the record format specified or retrieved for the OUTFIL data set does not contain ’A’ (ANSI carriage control characters).

System action: The program terminates.

Programmer response: If the OUTFIL data set is VSAM, it cannot be used for a report. If the OUTFIL data set is non-VSAM, take one of the following actions: v Let DFSORT set the RECFM appropriately. v Specify a RECFM that includes ’A’. v Specify the REMOVECC parameter on the OUTFIL statement so ’A’ is not needed in the RECFM.


Thanks UmeySan and also krisprems!

Thanks Skolusu!

Because of your help,I got solve this problem and learned a lot.

Best regards!
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top