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

Can't specify a dataset to SORT SYSIN?


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

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Tue Nov 05, 2013 1:01 pm
Reply with quote

I tried to use a dataset as input parameter of SORT, as below:
Code:
//STEP6    EXEC PGM=SORT                           
//SYSOUT DD SYSOUT=A                               
//SORTIN DD DISP=(OLD,DELETE),DSN=&&TMP           
//SORTOUT DD DSN=&&NUM,                           
// DISP=(,PASS),DCB=(LRECL=72,RECFM=FB,BLKSIZE=0),
// SPACE=(CYL,(1,1)),UNIT=SYSDA                   
//SYSIN DD *                                       
  OUTREC FIELDS=(C'  SORT FIELDS=COPY')           
  SORT FIELDS=COPY                                 
/*                                                 
//*************************************************
//*                                               
//STEP7    EXEC PGM=SORT                           
//SYSOUT DD SYSOUT=A                               
//SORTIN DD DISP=SHR,DSN=DS.LD@RATE.TEST   
//SORTOUT DD DUMMY                                 
//*SORTOUT DD SYSOUT=*                             
//OUTPUT  DD DISP=OLD,DSN=DS.TEST           
//SYSIN   DD DISP=(OLD,DELETE),DSN=&&NUM           
//                                                 


but SORT program abended with below error message:
Code:
********************************* TOP OF DATA **********************************
1ICE751I 2 C5-K76982 C6-K90026 DA-K69255                                       
0ICE805I 1 JOBNAME: CBD0000J , STEPNAME: STEP7                                 
 ICE802I 0 BLOCKSET     TECHNIQUE IN CONTROL                                   
 ICE185A 0 AN S001  ABEND WAS ISSUED BY DFSORT, ANOTHER PROGRAM OR AN EXIT (PHASE   0)
******************************** BOTTOM OF DATA ********************************


I cannot understand why this happen,
Can somebody please help me on this ?

Thanks.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Nov 05, 2013 1:13 pm
Reply with quote

First, there is no need to supply an LRECL for SORTOUT. SORT will do that for you.

Second, why specify an LRECL of 72? It should be 80.

Third why not post the full sysout (rhetorical for now)?

To get the data to LRECL 80, specify a blank for column 80. This will "pad" the intervening bytes from the previous that you specify with the fill character, a blank.

I assume that you only have one record on your input file. This example also gives you a choice: a Control Card which will always work; failure in the event of multiple inputs. Choose the best match for your task.

Code:
//STEP6    EXEC PGM=SORT                           
//SYSOUT DD SYSOUT=A                               
//SORTIN DD DISP=(OLD,DELETE),DSN=&&TMP           
//SORTOUT DD DSN=&&NUM,                           
// DISP=(,PASS),DCB=(LRECL=72,RECFM=FB,BLKSIZE=0),
// SPACE=(CYL,(1,1)),UNIT=SYSDA                   
//SYSIN DD *                                       
  OPTION COPY,STOPAFT=1
  INREC BUILD=(C'  SORT FIELDS=COPY',80:X)           
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Nov 05, 2013 2:07 pm
Reply with quote

Do you not need to specify the RECFM and LRECL for a DD DUMMY output

And why bother running the sort step if the output is DUMMY ???
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Nov 05, 2013 2:14 pm
Reply with quote

RECFM and LRECL will be supplied by SORT.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Nov 05, 2013 8:38 pm
Reply with quote

why do you need to create a temp dataset with just SORT FIELDS=COPY? As Bill and expat pointed out your sysin dataset should have an lrecl of 80. Check this link which explains in detail about it

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca60/2.5.3
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Wed Nov 06, 2013 6:39 am
Reply with quote

thanks, bill.

I changed according to your suggestion, it works fine.
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top