Sort Utility in sequential data set



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Sort Utility in sequential data set

Postby Liam_George » Mon Mar 10, 2014 6:16 pm

Hi, i am new to mainframe and need to write a JCL that will sort data ( i can do that part) and write the output to a sequential dataset(part i can't do)

below is my code so far, this can write the output to a partioned dataset but not to a sequential

//MYJCL2 JOB 1,NOTIFY=&SYSUID
//SORT EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&SYSUID..LABS.JCL(AREACODE),DISP=SHR
//SORTOUT DD DSN=&SYSUID..CW.DATA1(AREACODE),DISP=SHR
SORT FIELDS=(5,17,CH,D)


any help will be much appreciated

Thank You
Liam_George
 
Posts: 6
Joined: Mon Mar 10, 2014 6:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort Utility in sequential data set

 

Re: Sort Utility in sequential data set

Postby enrico-sorichetti » Mon Mar 10, 2014 6:19 pm

what prevents Yo to use
//SORTOUT DD DISP=(NEW,CATLG),DSN=...,
// ...
// ...


with all the dataset attribute of a PS dataset ???
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Sort Utility in sequential data set

Postby Liam_George » Mon Mar 10, 2014 6:51 pm

Data1 (mentioned above ) is the PS dataset that i need to write to, will the like of code you have gave me work for this?
Liam_George
 
Posts: 6
Joined: Mon Mar 10, 2014 6:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort Utility in sequential data set

Postby steve-myers » Mon Mar 10, 2014 7:07 pm

You are writing the SORTIN and SORTOUT DD statements so they are members of a PDS rather than sequential data sets, which is fine if slightly unusual. It will hurt the performance of the sort product a little, but I doubt you will notice. You just have to be certain the DCB attributes of the two data sets are similar as sort does not copy DCB attributes.
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Sort Utility in sequential data set

Postby Liam_George » Mon Mar 10, 2014 7:12 pm

The SORTIN is coming from a PDS the SORTOUT needs to write to a PS. I am a beginner so i am sorry for being clueless
Liam_George
 
Posts: 6
Joined: Mon Mar 10, 2014 6:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort Utility in sequential data set

Postby BillyBoyo » Mon Mar 10, 2014 7:34 pm

Just define a PS for the SORTOUT, as enrico has indicated. There will be no changes to the SORT control cards.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Sort Utility in sequential data set

Postby Liam_George » Mon Mar 10, 2014 7:52 pm

so......


//MYJCL1 JOB 1,NOTIFY=&SYSUID
//SORT EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&SYSUID..LABS.JCL(AREACODE),DISP=SHR
//SORTOUT DD DISP=(NEW,CATLG),DSN=&SYSUID..CW(AREACODE)
SORT FIELDS=(5,17,CH,D)

should that work?
Liam_George
 
Posts: 6
Joined: Mon Mar 10, 2014 6:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort Utility in sequential data set

Postby NicC » Mon Mar 10, 2014 7:56 pm

No - the parentheses indicate a PDS - pds.name(member). You want a PS file - phys.seq.file.name - and you will need to specify space, RECFM and LRECL
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Sort Utility in sequential data set

Postby Liam_George » Mon Mar 10, 2014 8:04 pm

any chance you could write it out for me, this will help me understand it better in the future.
Liam_George
 
Posts: 6
Joined: Mon Mar 10, 2014 6:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort Utility in sequential data set

Postby Blackthorn » Mon Mar 10, 2014 8:16 pm

You will understand it better still if you code it yourself. Refer to the JCL manuals, or simply find some JCL at your shop that does this. You must have hundreds if not thousands of jobs that create sequential files. As has already been said, writing the output to a PDS member is fairly unusual.
Blackthorn
 
Posts: 98
Joined: Tue Feb 01, 2011 7:12 pm
Has thanked: 0 time
Been thanked: 2 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post