Regarding control cards

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
venky
Active Member
Posts: 50
Joined: Sat May 12, 2012 10:13 pm

Regarding control cards

Post by venky » Tue Aug 14, 2012 2:01 am

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.

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Tue Aug 14, 2012 8:19 am

Is there some reason you did not post this in the part of the forum for SORT topics?

Simply OMIT the records you do not want?

What are these records and how will they be used once selected?
Have a good one

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Aug 14, 2012 1:17 pm

I do not really understand what exactly you want to do, however I'll make an edicated guess from this:
now I am having a problem with step03

Code: Select all

step03 exec pgm=sort 
sysin dd * 
skiprec=02,stopaft=25,skiprec=02,stopaft=01 
/*
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?

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

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Tue Aug 14, 2012 1:31 pm

duplicate due to response times
Last edited by NicC on Tue Aug 14, 2012 1:33 pm, edited 1 time in total.
Regards
Nic

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Tue Aug 14, 2012 1:32 pm

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

Post Reply

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



Other References
Mainframe Tools and others