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
 

 

Can someone explain me this JCL line by line?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Can someone explain me this JCL line by line?
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Sat Dec 12, 2015 11:20 am    Post subject:
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: 1717
Location: UK

PostPosted: Sat Dec 12, 2015 3:31 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Sat Dec 12, 2015 5:46 pm    Post subject: Reply to: Can someone explain me this JCL line by line?
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: 331
Location: USA

PostPosted: Sun Dec 13, 2015 8:56 am    Post subject: Reply to: Can someone explain me this JCL line by line?
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: 1717
Location: UK

PostPosted: Sun Dec 13, 2015 6:50 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Sun Dec 13, 2015 8:10 pm    Post subject:
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 User


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

PostPosted: Sun Dec 13, 2015 9:18 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Sun Dec 13, 2015 11:18 pm    Post subject: Reply to: Can someone explain me this JCL line by line?
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Mon Dec 14, 2015 1:19 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts ISREDIT - Position Cursor on the Comm... Tarique Anwer TSO/ISPF 5 Wed Feb 03, 2016 12:44 pm
No new posts Use Edit Line Command Table with ISPF... Mickeydusaor TSO/ISPF 5 Thu Jan 28, 2016 4:52 pm
No new posts ISPF 3.4, SF line command does not su... Pedro TSO/ISPF 0 Fri Jan 15, 2016 11:09 pm
No new posts retrieve line commands from the data ... Pedro TSO/ISPF 6 Sat Oct 17, 2015 5:41 am


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