MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

To copy a file records(5-6 and 12-14) using Sort
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
manoj nayak
Banned


Joined: 12 Apr 2007
Posts: 15
Topics: 8
Location: Ind

PostPosted: Thu Jun 07, 2007 8:12 am    Post subject: To copy a file records(5-6 and 12-14) using Sort Reply with quote

My need is that I want to copy records from 5-9 and 12-14 from a single file copy it to a single output file.

I tried this code but it copies the first 5 records and didnt work for second one.The return code is zero.

Code:

//SYSIN DD *                                         
        SORT FIELDS=COPY                             
        OUTFIL FNAMES=SORTOUT1,STARTREC=5,ENDREC=9   
        OUTFIL FNAMES=SORTOUT1,STARTREC=12,ENDREC=14 
/*     
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Jun 07, 2007 8:18 am    Post subject: Reply with quote

manoj nayak,

Finally you did look at the rules.

what is the LRECL and RECFM of the Input dataset ?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
manoj nayak
Banned


Joined: 12 Apr 2007
Posts: 15
Topics: 8
Location: Ind

PostPosted: Thu Jun 07, 2007 8:25 am    Post subject: Reply with quote

In both case for the input and output files the LRECL=50 and BLKSIZE=500

My input and out file is given below:


//SORTIN DD DSN=V5C.TEST.EPRG1,DISP=SHR
//SORTOUT1 DD DSN=V5C.TEST.SORT1RES,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(10,10),RLSE),
// DCB=(RECFM=FB,LRECL=50,BLKSIZE=500)
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Jun 07, 2007 8:34 am    Post subject: Reply with quote

manoj nayak,

Try this untested JCL

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*   
//SORTIN   DD DSN=V5C.TEST.EPRG1,DISP=SHR
//SORTOUT  DD DSN=V5C.TEST.SORT1RES,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(TRK,(10,10),RLSE)
//SYSIN DD *                                         
  SORT FIELDS=COPY                                   
  OUTREC OVERLAY=(51:SEQNUM,8,ZD)                   
  OUTFIL INCLUDE=((51,8,ZD,GE,5,AND,51,8,ZD,LE,9),OR,
                  (51,8,ZD,GE,12,AND,51,8,ZD,LE,14)),
  OUTREC=(01,50)                                     
/*   


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jajularamesh
Beginner


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Thu Jun 07, 2007 9:11 am    Post subject: Reply with quote

Hi kolusu,

This is not working

OUTREC=(01,50)


Regards,
Venkata Apparao Jajula
Back to top
View user's profile Send private message
manoj nayak
Banned


Joined: 12 Apr 2007
Posts: 15
Topics: 8
Location: Ind

PostPosted: Thu Jun 07, 2007 9:15 am    Post subject: Reply with quote

I TRIED THIS CODE BUT LITTLE BIT EDITED:

Code:

//SYSIN DD *                                               
        SORT FIELDS=COPY                                   
        OUTREC OVERLAY=(51:SEQNUM,8,ZD)                     
        INCLUDE COND=((51,8,ZD,GE,5,AND,51,8,ZD,LE,9),OR,   
                       (51,8,ZD,GE,12,AND,51,8,ZD,LE,14))   
        OUTREC=(1,50)                                       
/*                                                         


ERROR:
 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 10:12 ON THU JUN
           SORT FIELDS=COPY                                             
           OUTREC OVERLAY=(51:SEQNUM,8,ZD)                               
           INCLUDE COND=((51,8,ZD,GE,5,AND,51,8,ZD,LE,9),OR,             
                          (51,8,ZD,GE,12,AND,51,8,ZD,LE,14))             
           OUTREC=(1,50)                                                 
                 $                                                       
 1 SYNTAX ERROR                                                         
 0 C5-K21008 C6-K90007 C7-K90000 C8-K90007 E7-K11698                     
 3 END OF DFSORT                                                         


WHAT TO DO?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Jun 07, 2007 9:26 am    Post subject: Reply with quote

Quote:

WHAT TO DO?


Manoj_nayak,

If you atleast copied my control cards as is, you wouldn't have got that error. You are missing a comma after the include statement.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Jun 07, 2007 9:28 am    Post subject: Reply with quote

Quote:

Hi kolusu,

This is not working

OUTREC=(01,50)


jajularamesh,

I canNOT read your sysout or your mind. I am guessing that you made the same mistake of omitting the comma after the include statement. Just copy the sysin cards AS IS and if it still does NOT work then post your sysout instead of 1 line responses " It does not work"
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Jun 07, 2007 9:32 am    Post subject: Reply with quote

I know little or nothing about SORT, but I would copy exactly what someone else had spent time creating for me:

Kolusu's code:
Code:

                  (51,8,ZD,GE,12,AND,51,8,ZD,LE,14)),
  OUTREC=(01,50)                                     


your code:
Quote:

(51,8,ZD,GE,12,AND,51,8,ZD,LE,14))
OUTREC=(1,50)


a hint:
the end of Kolusu's 1st line is: )),
the end of your 1st line is: ))

syntax, syntax, syntax........................................
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Thu Jun 07, 2007 9:50 am    Post subject: Reply with quote

manoj nayak

check this
Code:

//SYSIN DD *                                         
  SORT FIELDS=COPY                                   
  OUTREC OVERLAY=(51:SEQNUM,8,ZD)                   
  OUTFIL INCLUDE=((51,8,ZD,GE,5,AND,51,8,ZD,LE,9),OR,
                  (51,8,ZD,GE,12,AND,51,8,ZD,LE,14)),
                  build=(01,50)                                     
/*

_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Jun 07, 2007 10:57 am    Post subject: Reply with quote

krisprems,

BUILD & OUTREC does the same. Did you think that OUTREC wouldn't work?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jajularamesh
Beginner


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Thu Jun 07, 2007 11:17 am    Post subject: Reply with quote

Hi Kolusu,

i have used the sordcard which you gave and i got this message

CONVERT FEATURE CANNOT BE USED WITH OVERLAY OR IFTHEN

regards,
Ramesh
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Jun 07, 2007 11:25 am    Post subject: Reply with quote

Quote:

I have used the sordcard which you gave and i got this message
CONVERT FEATURE CANNOT BE USED WITH OVERLAY OR IFTHEN


jajularamesh,

lemme ask you somehting . Are you trying to test my patience? What part of my message don't you understand?

kolusu wrote:

Just copy the sysin cards AS IS and if it still does NOT work then post your sysout instead of 1 line responses " It does not work"


I need to see the ENTIRE SYSOUT to be able to help you. What do you expect me to remember all the error text messages ?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jajularamesh
Beginner


Joined: 14 Apr 2006
Posts: 87
Topics: 33

PostPosted: Fri Jun 08, 2007 12:03 am    Post subject: Reply with quote

first of all sorry kolusu

This is what i got in sysout
Code:

  PRODUCT LICENSED FOR CPU SERIAL NUMBER 13C3A, MODEL 2094 705     
SYSIN :                                                           
 SORT FIELDS=COPY                                                 
 OUTREC OVERLAY=(51:SEQNUM,8,ZD)                                 
 OUTFIL INCLUDE=((51,8,ZD,GE,5,AND,51,8,ZD,LE,9),OR,             
                   (51,8,ZD,GE,12,AND,51,8,ZD,LE,14)),           
 OUTREC(1,50)                                                     
*/                                                               
WER276B  SYSDIAG= 28205, 820950, 820950, 938628                   
WER164B  6,912K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B     0 BYTES RESERVE REQUESTED, 3,068K BYTES USED         
WER146B  4K BYTES OF EMERGENCY SPACE ALLOCATED                   
WER108I  SORTIN   : RECFM=FB   ; LRECL=    80; BLKSIZE= 27920     
WER237I  OUTREC RECORD LENGTH =    80                             
WER110I  SORTOUT  : RECFM=FB   ; LRECL=    80; BLKSIZE=   800     
WER247A  SORTOUT  HAS INCOMPATIBLE LRECL                         
WER425A  CONVERT FEATURE CANNOT BE USED WITH OVERLAY OR IFTHEN   
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

I guess the reason for the abend may the sort i am using i,e SYNC sort

Please correct me if i am wrong.

Regards,
Ramesh
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Jun 08, 2007 3:28 am    Post subject: Reply with quote

Quote:

WER247A SORTOUT HAS INCOMPATIBLE LRECL


jajularamesh,

Remove the hardcoded DCB parameters in your JCL. Sort automatically calculates the DCB parameters.

look at the JCL example shown in this same topic here

http://www.mvsforums.com/helpboards/viewtopic.php?p=41058#41058

One more thing Manoj's input is only 50 bytes and I showed an example for it. you take the same input cards for a 80 byte file and complain that it is not working without proper sysout error messages. Try understanding the control cards first.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group