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

Can someone explain me this JCL line by line?


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

New User


Joined: 10 Dec 2015
Posts: 1
Location: usa

PostPosted: Sat Dec 12, 2015 7:22 am
Reply with quote

Code:

//SORTJCL   JOB                                       
//SORTSTEP  EXEC PGM=SORT                             
//SYSOUT    DD SYSOUT=*                               
//SORTOUT   DD SYSOUT=*                               
//SORTWK01  DD SPACE=(CYL,(1,1))                       
//SORTIN    DD DISP=SHR,DSN=Y2015.PUBLIC.DATA(AREACODE)
//SYSIN     DD *                                       
  SORT FIELDS=(6,10,CH,A)                             
//  IF RC = 0 THEN                                     
//COPYSTEP  EXEC PGM=ICEGENER                         
//SYSUT1    DD DISP=SHR,DSN=Y2015.PUBLIC.DATA($005)   
//SYSUT2    DD DISP=SHR,DSN=&SYSUID..P2.OUTPUT($005)   
//SYSOUT    DD SYSOUT=*                               
//SYSPRINT  DD SYSOUT=*                               
//SYSIN     DD DUMMY                                   
//  ELSE                                               
//  ENDIF         



It supposed to read file: 2015.PUBLIC.DATA(AREACODE) , SORT IT AND THEN PLACE RESULTS INTO MYID.p2.OUTPUT($005)

I can see 6 records in JES Logs and correctly sorted file. Can someone help me with this?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Sat Dec 12, 2015 11:20 am
Reply with quote

Welcome but for basic questions please use beginners forum here. also use code tags when adding any code. To know how to use look at top 'Forum Rules'.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Sat Dec 12, 2015 3:31 pm
Reply with quote

I have coded it for you - this time (and stripped off the editor line numbers).

Nothing extreme here. A basic understanding of JCL (see the JCL Reference Manual), sort (see the DFSORT manual) and IEBEGENER (see the utilities manual) is all you need. Links to manuals can be found at the top (the VERY top) of each page of the forum.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Dec 12, 2015 5:46 pm
Reply with quote

Code:
//SORTJCL   JOB                                       
//SORTSTEP  EXEC PGM=SORT                             
//SYSOUT    DD SYSOUT=*                               
//SORTOUT   DD DISP=OLD,DSN=&SYSUID..P2.OUTPUT($005)
//SORTWK01  DD SPACE=(CYL,(1,1))                       
//SORTIN    DD DISP=SHR,DSN=Y2015.PUBLIC.DATA(AREACODE)
//SYSIN     DD *                                       
  SORT FIELDS=(6,10,CH,A)


As you were told elsewhere, if you do the above you will see your data in the member where you expect to see it.

Your copy step, using ICEGENER, which will use a SORT COPY operation when there are no IEBGENER control cards (which there are'nt) is copying an entirely different dataset to where you want the SORTed output.

I do suggest you subscribe to the forum suggested by Rohit in his link above. It is a forum for Mainframe Beginners and Students. Even there you are unlikely to get a line-by-line description. If you consult your SORT manual, your Utilities manual and the JCL Reference you can discover all you need to know. If you still have problems, detail what you understand and what you specifically have a problem with.

If you use the manuals and discover for yourself, it will "stick" better, rather than taking someone's explanation.

You are also probably not learning in isolation, so have a tutor/colleague who should assist you with problems of understanding. It will help them greatly if they know what it is you don't know, so they can target advice and suggestions to cover the things you don't understand.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Sun Dec 13, 2015 8:56 am
Reply with quote

Ok. What I see here is,

First step is to copy the data from member AREACODE to SYSOUT.
And, the Second step is to copy PUBLIC.DATA($005) to P2.OUTPUT($005)

So, the data from First Step is Not going to the Second step.

Now, Second step runs only when we get RC=0 in the First step. The first step will get a RC of 0 only if the data is copied successfully to Sysout. We have to keep in mind that there is a Sort Work file in the first step. So, the workspace for SORT is specified at CYL(1,1).

I believe, this is make sure that AREACODE doesn't have a lot of data. If member AREACODE has an amount of data which can't be handled by Sort Work file of CYL(1,1) then Don't copy data in member $005.

I think Sort work file has an important role to play in this Job.

Bill, please correct me If I am wrong about the role of the Sort work file.

.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Sun Dec 13, 2015 6:50 pm
Reply with quote

Do not be put ogff by people suggesting that you use the beginners forum - I post questions there on topics I know little of or struggle with.

For your "I know a lot about this subject" queries post here, for your "I know little or nothing about this subject" then post them in the other forum.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Sun Dec 13, 2015 8:10 pm
Reply with quote

Very nice and tolerant, Nic.

But his C.V. shows that he knows nothing.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Sun Dec 13, 2015 9:18 pm
Reply with quote

A sort product like IBM's DFSORT or Syncsort is designed to process data containing millions of records, far too many to load into storage. To do this, though in fact it's far more complicated than this simple description, it copies the data to temporary storage specified by DD statements that have DD names that start with SORTWK. With the availability of dynamic allocation, the sort products can estimate the storage requirement for the work data sets and allocate them so the programmer does not need to specify SORTWKxx data sets. After all the input has been loaded into the SORTWKxx data sets it completes the sort and writes the sorted output.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Dec 13, 2015 11:18 pm
Reply with quote

Limiting SORTWK space would be an inaccurate way to limit data processed. How much SORTWK is actuallyused can depend on factors which change from run-to-run. For a record-based limit things like STOPAFT, ACCEPT and their cousins would be accurate.

Dynamic allocation of workspace is generally much more effective at avoiding underallocation/overallocation of workspace (which can impact the current step or other jobs).

If attempting to limit output DDs by space allocation, only give primary and no secondary. That is still a moveable feast generally and even more so with SORT.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon Dec 14, 2015 1:19 am
Reply with quote

Seeing the comments of steve and Bill, they agree that this is not anymore an expert site?
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts rewrite same SAY line CLIST & REXX 8
No new posts DB2 Statistics - Using EXPLAIN and qu... DB2 1
No new posts Merge files with a key and insert a b... DFSORT/ICETOOL 6
Search our Forums:

Back to Top