Hi All,
I have a card, it contains 30 records. I want to use only particular records for particular steps by using sort utility with control cards.
30 records(ps file) for eg see below:
rec1
rec2
rec3
rec4
rec5
rec6
rec7
rec8
rec9
rec10
rec11
rec12
rec13
rec14
rec15
rec16
rec17
rec18
rec19
rec20
rec21
rec22
rec23
rec24
rec25
rec26
rec27
rec28
rec29
rec30
step01 exec pgm=sort
sysin dd *
stopaft=27
/*
step02 exec pgm=sort
sysin dd *
skiprec=02,stopaft=27
/*
now I am having a problem with step03
step03 exec pgm=sort
sysin dd *
skiprec=02,stopaft=25,skiprec=02,stopaft=01
/*
But I want bold records should be Ignored for step03 see below.
rec1
rec2
rec3
rec4
rec5
rec6
rec7
rec8
rec9
rec10
rec11
rec12
rec13
rec14
rec15
rec16
rec17
rec18
rec19
rec20
rec21
rec22
rec23
rec24
rec25
rec26
rec27
rec28
rec29
rec30
Please suggest me a solution. Thanks.
Regards,
Venky.
Regarding control cards
Moderators: Frank Yaeger, DikDude, Moderator Group
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
I do not really understand what exactly you want to do, however I'll make an edicated guess from this:
With STOPAFT, SORT(DFSort) actually stops reading the records when the STOPAFT count is satisfied, so, for your example, only 27 records will be read, whereas with ENDREC, (DF)SORT reads all of the records. So STOPAFT is actually more efficient but I doubt if we can use them the way you show.
Haing said that, either you use SUBSET operator or use RRN (bot for ICETOOL), if the function of your SORT-product supports it. For example, Look here: http://publib.boulder.ibm.com/infocente ... a40155.htm
First the sytax is not categorically wrong, it won't work the way it is written. However, if I take inference form it -- you want to skip first 2 records then stop at 25, start again and skip next 2 records and stop-after=01? What does that mean?now I am having a problem with step03Code: Select all
step03 exec pgm=sort sysin dd * skiprec=02,stopaft=25,skiprec=02,stopaft=01 /*
With STOPAFT, SORT(DFSort) actually stops reading the records when the STOPAFT count is satisfied, so, for your example, only 27 records will be read, whereas with ENDREC, (DF)SORT reads all of the records. So STOPAFT is actually more efficient but I doubt if we can use them the way you show.
Haing said that, either you use SUBSET operator or use RRN (bot for ICETOOL), if the function of your SORT-product supports it. For example, Look here: http://publib.boulder.ibm.com/infocente ... a40155.htm
Regards,
Anuj
Anuj
Venky, it would help if you specify WHICH sort program you use - DFSORT or SYNCSORT or some other. Do NOT look at the PGM=sortprogramname as this may be an alias - look at the messages produced by the sort program: a) they will mention the program name and b) ICE messages indicate DFSORT and WER messages indicate SYNCSORT.
Regards
Nic
Nic
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page