Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problems about using sort to generate a report

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Problems about using sort to generate a report
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: 757
Location: Germany

PostPosted: Mon Dec 22, 2008 3:42 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Problems about using sort to generate a report
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us