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

Issue in SORT CARD having both INCLUDE, STOPAFT and OUTFIL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sasanka
Warnings : 1

New User


Joined: 18 Jan 2008
Posts: 34
Location: India

PostPosted: Thu Aug 07, 2008 3:43 pm
Reply with quote

When I try to execute the following JCL, it gives MAXCC = 16
JCL is mentioned below ----

Code:
                         
//S005U   EXEC PGM=SORT                                     
//SORTIN   DD  DSN=A333.TEST.FILE,DISP=SHR                 
//SORTOF01 DD  DSN=A333.TEST.OUTFILE,                       
//             DISP=(,CATLG,DELETE),                       
//             UNIT=3390,                                   
//             SPACE=(TRK,(02,2),RLSE)       
//SYSIN    DD  *                                     
  OUTFIL FILES=01,INCLUDE COND=(11,1,CH,EQ,C'0')     
  STOPAFT=05                                         
/*                             
//SYSOUT   DD  SYSOUT=*                             
//*           


The contents of input file A333.TEST.FILE are

Code:

----+----1----+----2
H F  PPG  4 BLM     
H M PPG  0 EHF     
H F  LIV   1 TAY     
H F LIV    0 TAY     
H F LIV    4 CAN     
H F BLM   4 BLM       
H M SSF   1 GPF     
H F STG   4 GPF     
H M BLM   4 LIV     
H F HFH    0 HFH     
H M SSF   0 FRL     
H M SSF   0 TDC     
H F LKS    4 LKS     
H M NVI   0 EBL     
H M NVI   4 EBL     
H M NVI   0 OFP
H M GPF   B HFH
H M HFH   B HFH
H F BLM   4 EBL


But in the SYSOUT message shows,
SYSIN :
OUTFIL FILES=01,INCLUDE COND=(11,1,CH,EQ,C'0')
*
STOPAFT=05
*
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

If I use the following sort-card it also gives MAXCC = 16
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(11,1,CH,EQ,C'0')
OUTFIL FILES=01
STOPAFT=05
/*
If I use this above sort-card, message comes in SYSOUT is

SYSIN :
SORT FIELDS=COPY
INCLUDE COND=(11,1,CH,EQ,C'0')
OUTFIL FILES=01
STOPAFT=05
*
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

Please anybody help me in solving it.

Thanks,
sasanka
Back to top
View user's profile Send private message
ashok_srivatsav
Currently Banned

New User


Joined: 29 Jun 2007
Posts: 15
Location: India, Bangalore

PostPosted: Thu Aug 07, 2008 3:45 pm
Reply with quote

try this


SORT FIELDS=COPY,STOPAFT=5
OUTFIL FILES=1,INCLUDE COND=(11,1,CH,EQ,C'0')


OR


SORT FIELDS=COPY,STOPAFT=5
OUTFIL FILES=1,INCLUDE=(11,1,CH,EQ,C'0')
Back to top
View user's profile Send private message
ashok_srivatsav
Currently Banned

New User


Joined: 29 Jun 2007
Posts: 15
Location: India, Bangalore

PostPosted: Thu Aug 07, 2008 3:52 pm
Reply with quote

this works.


SORT FIELDS=COPY,STOPAFT=5
OUTFIL FILES=01,INCLUDE=(11,1,CH,EQ,C'O')
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Aug 07, 2008 4:09 pm
Reply with quote

Could you guys please use the code tag while posting the code?
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Aug 07, 2008 4:30 pm
Reply with quote

Sasanka,

Quote:
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT


The control card statements should not start from column 1. Code accordingly and it would work.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Aug 07, 2008 5:53 pm
Reply with quote

Hi,

I think STOPAFT can't be used with OUTFIL; further when I tried the input data posted there was no such data in the input which can "map" to the conditon to select those records which have "0" at position 11.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Aug 07, 2008 6:03 pm
Reply with quote

Hi,

I was right in both the above assumptions, try this JCL
Code:
//S005U EXEC PGM=SORT
//*                   
//SORTIN DD *         
H F PPG 4 BLM         
H M PPG 0 EHF         
H F LIV 1 TAY         
H F LIV 0 TAY         
H F LIV 4 CAN         
H F BLM 4 BLM         
H M SSF 1 GPF         
H F STG 4 GPF         
H M BLM 4 LIV         
H F HFH 0 HFH         
H M SSF 0 FRL         
H M SSF 0 TDC         
H F LKS 4 LKS         
H M NVI 0 EBL         
H M NVI 4 EBL         
H M NVI 0 OFP         
H M GPF B HFH         
H M HFH B HFH         
H F BLM 4 EBL         
/*                                                 
//SORTOF01 DD SYSOUT=*                             
//*                                                 
//SYSIN DD *                                       
  OPTION COPY                                       
  OUTFIL FILES=01,ENDREC=5,INCLUDE=(9,1,CH,EQ,C'0')
/*                                                 
//SYSUDUMP DD SYSOUT=*                             
//SORTMSG DD SYSOUT=*                               
//SYSOUT DD SYSOUT=*                               
//SYSPRINT DD SYSOUT=*                             
//*                                                 


And by the way there is no need of SORT work files, you just copy the data...why would you use them, should I ask ?
Back to top
View user's profile Send private message
ashok_srivatsav
Currently Banned

New User


Joined: 29 Jun 2007
Posts: 15
Location: India, Bangalore

PostPosted: Thu Aug 07, 2008 6:19 pm
Reply with quote

sasank

What is the LRECL of your input?



Ashok
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Aug 07, 2008 10:21 pm
Reply with quote

Hello sasanka,

If you still want to use STOPAFT, you may try this out.

Code:
//SYSIN DD *
  INCLUDE COND=(9,1,CH,EQ,C'0')                                       
  SORT FIELDS=COPY,STOPAFT=5                                   
  OUTFIL FILES=01
/*


Thanks,
Arun
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Aug 08, 2008 1:06 pm
Reply with quote

Arun,

With the above SORT card, output would contain five records & will stop after that, With the above SORT card it'll try to scan the whole input, so the output with the given input would be:
Code:
H M PPG 0 EHF
H F LIV 0 TAY
H F HFH 0 HFH
H M SSF 0 FRL
H M SSF 0 TDC

while with my sort card input will be searched upto fifth record & the records matching to the sort card will be put into output & they would be:
Code:
H M PPG 0 EHF
H F LIV 0 TAY

I think TS would like to use your SORT card, umm...but.. hmmm..I've nothing to say now..icon_neutral.gif
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Fri Aug 08, 2008 2:29 pm
Reply with quote

Hi Anuj really interesting point from you.
Can you please let me know is ENDREC / STOPAFT that is responsible for this??
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Aug 08, 2008 2:53 pm
Reply with quote

Hi Sri,

Yes it's because of them -

ENDREC=n parameter is used to specify the record number, n, of the last record to be processed by the OUTFIL specification in effect. All records after the specified record will be ignored for the OUTFIL group. The record number is determined by the sequence of records presented for OUTFIL processing. So, with my SORT only first five records of input were searched.

STOPAFT=n (a decimal number) sorts/copies at most n records. And so there are total 5 records in the output when Arun's card is used.

If we dont use any of them, output would contain below seven records in the output for the given input:
Code:
H M PPG 0 EHF
H F LIV 0 TAY
H F HFH 0 HFH
H M SSF 0 FRL
H M SSF 0 TDC
H M NVI 0 EBL
H M NVI 0 OFP


Hope this helps..
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Fri Aug 08, 2008 3:05 pm
Reply with quote

Thank you Anuj..It sounds good.. icon_biggrin.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Aug 08, 2008 3:50 pm
Reply with quote

Hopefully I had been helpful..
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Aug 08, 2008 4:02 pm
Reply with quote

In addition to Anuj's points, here is the sequence by which the above control statements are executed.

Code:
                       INCLUDE/OMIT
                            |
                            |
            SORT FIELDS=COPY,SKIPREC/STOPAFT
                            |
                            |
        ________________OUTREC ______________
        |                                    |
        |                                    |
OUTFIL FILES=01,                        OUTFIL FILES=02,
STARTREC/ENDREC                         STARTREC/ENDREC


Thanks,
Arun
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Fri Aug 08, 2008 4:43 pm
Reply with quote

Hi Arun thanks for your reply.I too has seen this somewhere but i do not remember the source.Could you please share the source path(link)if you have any from where you got this.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Aug 08, 2008 5:03 pm
Reply with quote

Hello Sri,

Do you have a SYNCSORT manual? It has the Data Utility Processing Sequence which describes the same in a simple and easily understandable manner.

Thanks,
Arun
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Fri Aug 08, 2008 5:39 pm
Reply with quote

arcvns wrote:
Hello Sri,

Do you have a SYNCSORT manual? It has the Data Utility Processing Sequence which describes the same in a simple and easily understandable manner.

Thanks,
Arun


I do not have SYNCSORT as we use DFSORT.Could you please share that document.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Aug 08, 2008 5:44 pm
Reply with quote

Hi,
sri_mf wrote:
I do not have SYNCSORT as we use DFSORT.Could you please share that document.
No, thay can't be shared via the forums as they are copyright material. The functions we are talking about here are well documneted in DFSORT Manuals as well, take a look there.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Aug 08, 2008 8:51 pm
Reply with quote

All of the DFSORT books are available online from:

Use [URL] BBCode for External Links

You can find a Figure showing the order in which functions are processed by DFSORT in "z/OS DFSORT Application Programming Guide". Here's a link to that Figure:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/FIGSTMTSEQ?SHELF=&DT=20060615185603&CASE=&ScrollTOP=FIGSTMTSEQ#FIGSTMTSEQ
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Mon Aug 11, 2008 12:25 pm
Reply with quote

Thank you Anuj and Frank icon_biggrin.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top