sort:count



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

sort:count

Postby pearl » Tue Mar 19, 2013 1:03 pm

what is wrong with this code? It goes in an infinite loop..
               
 000100 //xxxxxx   JOB (1234),CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),               
 000200 //            NOTIFY=&SYSUID,PRTY=15                                   
 000300 //STEP1    EXEC PGM=SORT                                               
 000400 //SORTIN   DD DSN=xxxxx.xxxx.xxxxx(IP1),DISP=SHR                     
 000500 //SORTOUT  DD DSN=xxxxxx.xxxx.xxxxxx(OP1),                             
 000600 //            DISP=(NEW,CATLG,DELETE),                                 
 000700 //            SPACE=(TRK,(1,2),RLSE),                                   
 000800 //            DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)                       
 001000 //SYSIN    DD *                                                         
 001100    SORT FIELDS=COPY,                                                   
 001110    OUTFIL REMOVECC,NODETAIL,                                           
 001120           TRAILER1=('NO OF RECORDS:',COUNT=(M11,LENGTH=7))             
 001200 /*                                                                     
 001300 //SYSOUT   DD SYSOUT=*                                                 
 
pearl
 
Posts: 21
Joined: Fri Mar 15, 2013 12:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: sort:count

 

Re: sort:count

Postby enrico-sorichetti » Tue Mar 19, 2013 1:17 pm

instead of running using two dat sets try with
//SORTIN DD *
some data
...
more data
//SORTOUT DD SYSOUT=*
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: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: sort:count

Postby pearl » Tue Mar 19, 2013 3:49 pm

I tried to do as you said.But,its still going in an infinaite loop
pearl
 
Posts: 21
Joined: Fri Mar 15, 2013 12:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: sort:count

Postby enrico-sorichetti » Tue Mar 19, 2013 4:20 pm

the chances of getting help on such a problem are pretty slim
better ask Your support

the best reply You might get on a forum is the confirmation that
 ****** ***************************** Top of Data ******************************
 000001 //ENRICO1  JOB NOTIFY=&SYSUID,
 000002 //             MSGLEVEL=(1,1),CLASS=A,MSGCLASS=H
 000003 //*
 000004 //ICE     EXEC PGM=SORT
 000005 //SYSOUT    DD SYSOUT=*
 000006 //SYSPRINT  DD SYSOUT=*
 000007 //SORTIN    DD *
 000008 SOME DATA
 000009 ...
 000010 MORE DATA
 000011 //SORTOUT   DD SYSOUT=*
 000012 //SYSIN     DD *
 000013   SORT FIELDS=COPY
 000014   OUTFIL REMOVECC,NODETAIL,
 000015          TRAILER1=('NO OF RECORDS:',COUNT=(M11,LENGTH=7))
 ****** **************************** Bottom of Data ****************************

runs correctly and returns
********************************* TOP OF DATA **********************************
NO OF RECORDS:0000003
******************************** BOTTOM OF DATA ********************************


looking over again at Your control cards You should have received some kind of syntax error
because the comma at the end of the SORT statement implies a continuation when none is needed
just get rid of it ( the comma ) and see what happens

the forum contains zillions of <sort> examples,
You should have spotted the error Yourself :mrgreen:
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: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: sort:count

Postby BillyBoyo » Tue Mar 19, 2013 4:46 pm

I think it wildly unlikely you get a loop in SORT. Show the sysout from the step, please.

Or, claiming an "infinite loop" for something with syntax errors, are you Trolling?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: sort:count

Postby pearl » Tue Mar 19, 2013 5:28 pm

thankx alot...your code is working. but, i am yet to find the error in mine. :(
pearl
 
Posts: 21
Joined: Fri Mar 15, 2013 12:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: sort:count

Postby steve-myers » Tue Mar 19, 2013 5:43 pm

pearl wrote:what is wrong with this code? It goes in an infinite loop..
               
 000100 //xxxxxx   JOB (1234),CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),               
 000200 //            NOTIFY=&SYSUID,PRTY=15                                   
...
 
If I were your boss, and saw the JCL in the quote, I'd show you the door real quick!
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: sort:count

Postby steve-myers » Tue Mar 19, 2013 5:51 pm

As Mr. Sorrichetti and Billyboyo say, it is very unlikely that the sort product will loop. However, you better look at your SORTOUT DD statement. There is a serious error there, though I will leave it to you to deduce the error.
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: sort:count

Postby enrico-sorichetti » Tue Mar 19, 2013 5:53 pm

thankx alot...your code is working. but, i am yet to find the error in mine.


should not be that difficult... did You read my comment about the EXTRA comma ???
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: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: sort:count

Postby BillyBoyo » Tue Mar 19, 2013 6:08 pm

Plus, if you just want a count of the records, have a look at ICETOOL's COUNT operator.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post