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
 

 

Can't specify a dataset to SORT SYSIN?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Can't specify a dataset to SORT SYSIN?
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Nov 05, 2013 1:13 pm    Post subject: Reply to: Can't specify a dataset to SORT SYSIN?
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: 8593
Location: Back in jolly old England

PostPosted: Tue Nov 05, 2013 2:07 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Nov 05, 2013 2:14 pm    Post subject: Reply to: Can't specify a dataset to SORT SYSIN?
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    Post subject:
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

http://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    Post subject:
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    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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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