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
 

 

Issue in SORT CARD having both INCLUDE, STOPAFT and OUTFIL
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Issue in SORT CARD having both INCLUDE, STOPAFT and OUTFIL
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    Post subject: Reply to: Issue in SORT CARD having both INCLUDE, STOPAFT an
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    Post subject: Reply to: Issue in SORT CARD having both INCLUDE, STOPAFT an
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: 1288
Location: Chennai, India

PostPosted: Thu Aug 07, 2008 4:09 pm    Post subject: Reply to: Issue in SORT CARD having both INCLUDE, STOPAFT an
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: 1288
Location: Chennai, India

PostPosted: Thu Aug 07, 2008 4:30 pm    Post subject: Reply to: Issue in SORT CARD having both INCLUDE, STOPAFT an
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

Senior Member


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

PostPosted: Thu Aug 07, 2008 5:53 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Aug 07, 2008 6:03 pm    Post subject:
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    Post subject: Reply to: Issue in SORT CARD having both INCLUDE, STOPAFT an
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: 2158
Location: @my desk

PostPosted: Thu Aug 07, 2008 10:21 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Aug 08, 2008 1:06 pm    Post subject:
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: 216
Location: India

PostPosted: Fri Aug 08, 2008 2:29 pm    Post subject: Reply to: Issue in SORT CARD having both INCLUDE, STOPAFT an
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

Senior Member


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

PostPosted: Fri Aug 08, 2008 2:53 pm    Post subject:
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: 216
Location: India

PostPosted: Fri Aug 08, 2008 3:05 pm    Post subject: Reply to: Issue in SORT CARD having both INCLUDE, STOPAFT an
Reply with quote

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

Senior Member


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

PostPosted: Fri Aug 08, 2008 3:50 pm    Post subject:
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: 2158
Location: @my desk

PostPosted: Fri Aug 08, 2008 4:02 pm    Post subject:
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: 216
Location: India

PostPosted: Fri Aug 08, 2008 4:43 pm    Post subject: Reply to: Issue in SORT CARD having both INCLUDE, STOPAFT an
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: 2158
Location: @my desk

PostPosted: Fri Aug 08, 2008 5:03 pm    Post subject:
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: 216
Location: India

PostPosted: Fri Aug 08, 2008 5:39 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Aug 08, 2008 5:44 pm    Post subject:
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 Moderator


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

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

All of the DFSORT books are available online from:

www.ibm.com/systems/support/storage/software/sort/mvs/srtmpub.html

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:

http://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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

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 DFHRESPONSE returns issue divated CICS 3 Wed Nov 02, 2016 6:32 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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