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 

copying header,specific records and trailer

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Thu Aug 30, 2007 4:38 am    Post subject: copying header,specific records and trailer Reply with quote

Hi,

I have tape file with header,records and trailer. I want to copy header and specific records and trailer to dasd dataset. I have written the following jcl. But its giving syntax error. Please correct my jcl. The tape data set is Variable length.
Code:

//SORT02   EXEC PGM=SORT                                                 
//SYSPRINT DD SYSOUT=*                                                   
//SYSOUT   DD SYSOUT=*                                                   
//SORTIN   DD DSN=MDL.DISCOUNT.HISTORY.MD800.G0919V00,DISP=SHR           
//SORTOF01 DD DSN=&&TEMP1,UNIT=TEMP,DISP=(,PASS),                       
//            SPACE=(CYL,(1,1)),DCB=(RECFM=VB,LRECL=1111,BLKSIZE=0)     
//SORTOF02 DD DSN=&&TEMP2,UNIT=TEMP,DISP=(,PASS),                       
//            SPACE=(CYL,(400,25)),DCB=(RECFM=VB,LRECL=1111,BLKSIZE=0)   
//SORTOF03 DD DSN=&&TEMP3,UNIT=TEMP,DISP=(,PASS),                       
//            SPACE=(CYL,(1,1)),DCB=(RECFM=VB,LRECL=1111,BLKSIZE=0)     
//SORTWK1  DD UNIT=SYSDA,SPACE=(CYL,(100,1))                             
//SORTWK2  DD UNIT=SYSDA,SPACE=(CYL,(100,1))                             
//SORTWK3  DD UNIT=SYSDA,SPACE=(CYL,(100,1))                             
//SYSIN    DD  *                                           
         SORT FIELDS=COPY                                 
         RECORD TYPE=V                                     
         OUTFIL FILES=01,                                 
         INCLUDE COND=(5,1,PD,EQ,X'00'),                   
         OUTREC=(1:1,4,5,31)                               
         OUTFIL FILES=02,                                 
         INCLUDE=((23,4,CH,EQ,C'2654'),                   
                  (23,4,CH,EQ,C'3060'),                   
                  (23,4,CH,EQ,C'2043'),                   
                  (23,4,CH,EQ,C'5314'),                   
                  (23,4,CH,EQ,C'2560'),                   
                  (23,4,CH,EQ,C'2007'),                   
                  (23,4,CH,EQ,C'2329')),                   
         OUTREC=(1:1,1111)                                 
         OUTFIL FILES=03,                                 
         INCLUDE COND=(5,1,PD,EQ,X'FF'),                   
         OUTREC=(1:1,4,5,32)                               
/*                                                         
 //MERGE2   EXEC PGM=SORT,COND=(0,LT)                               
 //SORTLIB  DD  DSN=SYS1.SORTLIB,DISP=SHR                           
 //SRTMSGE  DD  SYSOUT=*                                             
 //SYSUDUMP DD  SYSOUT=*                                             
 //SYSOUT   DD  SYSOUT=*                                             
 //SORTIN   DD DSN=&&TEMP1,DISP=(OLD,DELETE)                         
 //         DD DSN=&&TEMP2,DISP=(OLD,DELETE)                         
 //         DD DSN=&&TEMP3,DISP=(OLD,DELETE)                         
 //SORTOUT  DD DSN=YI75.DISCOUNT.HISTORY.MD800.LIVE(+1),             
 //         DISP=(NEW,CATLG,DELETE),                                 
 //         DCB=(RECFM=VB,BLKSIZE=23476,LRECL=1111),                 
 //         SPACE=(CYL,(210,50),RLSE)                               
 //SORTWK1  DD UNIT=SYSDA,SPACE=(CYL,(1,1))                         
 //SORTWK2  DD UNIT=SYSDA,SPACE=(CYL,(300,100))                     
//SORTWK3  DD UNIT=SYSDA,SPACE=(CYL,(1,1))         
//SYSIN    DD *                                   
  SORT FIELDS=COPY                                 
/*

It is giving error in sort02 step itself.

Also is there any way to automaticaly update the trailer record with actual count i.e. exact number of records extracted by include condition.

Thanks
Nadh
Back to top
View user's profile Send private message Send e-mail
blitz2
Beginner


Joined: 23 Jan 2007
Posts: 84
Topics: 14

PostPosted: Thu Aug 30, 2007 4:44 am    Post subject: Reply with quote

Nadh,
What is the error that you get? Can you pls post the Sort messages?
________
THE CIGAR BOSS


Last edited by blitz2 on Thu Mar 10, 2011 5:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Thu Aug 30, 2007 4:49 am    Post subject: Reply with quote

Hi,

Please find the sortout messages.
Code:

ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 10:47 ON THU AUG 30, 2007 - 
                   SORT FIELDS=COPY     
                   RECORD TYPE=V       
                   OUTFIL FILES=01,     
                   INCLUDE=(5,1,CH,EQ,X'00'),     
                   OUTREC=(1:1,4,5,31)
       
                   OUTFIL FILES=02,     
                   INCLUDE=((23,4,CH,EQ,C'2654'),OR,       
                            (23,4,CH,EQ,C'3060'),OR,       
                            (23,4,CH,EQ,C'2043'),OR,       
                            (23,4,CH,EQ,C'5314'),OR,       
                            (23,4,CH,EQ,C'2560'),OR,       
                            (23,4,CH,EQ,C'2007'),OR,
                            (23,4,CH,EQ,C'2329')),
                   OUTREC=(1:1,1111)
                   OUTFIL FILES=03,
                   INCLUDE =(5,1,CH,EQ,X'FF'),
                          $
ICE007A 1 SYNTAX ERROR
                   OUTREC=(1:1,4,5,32)
                         $
ICE007A 1 SYNTAX ERROR
ICE905I 0 I : RF=80,LR=1111,BLK=32736,BCT=69174
ICE751I 0 C5-K90007 C6-K90007 C7-K90000 C8-K90007 E7-K11698
ICE052I 3 END OF DFSORT
Thanks
Nadh
Back to top
View user's profile Send private message Send e-mail
dbzTHEdinosauer
Supermod


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

PostPosted: Thu Aug 30, 2007 4:52 am    Post subject: Reply with quote

nadh,

please use [code] and [/code] tags,it makes your posts easier to read. For info use this link for BBCode.

Use the search facility, this type of processing has been discussed numerous times on this board. You should also look at each 'Sticky' in the DFSORT forum (which is where this topic belongs). There are many examples there, as well as in the manuals (links for manuals provided in appropriate Sticky as well as the 'Quick Manuals' hyperlink at top of page). Your topic is the subject of an example in the quick starts manual.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Thu Aug 30, 2007 4:55 am    Post subject: Reply with quote

Hi,

I modified the jcl and submitted now. Its giving the below message. got rid of syntax error. Please help me out to solve this.

Code:

ICE805I 1 JOBNAME: YI75HDTR , STEPNAME: SORT02                     
ICE802I 0 BLOCKSET     TECHNIQUE IN CONTROL                   
ICE905I 0 I : RF=80,LR=1111,BLK=32736,BCT=69174                   
ICE201I E RECORD TYPE IS V - DATA STARTS IN POSITION 5                   
ICE858I 0 LA=262024, DA=6144, AA=255880, BA=6085, TA=6133                   
ICE859I 0 LB=8048, DB=1036, AB=7012, BB=0, CP=4, RS=0, TB=24                   
ICE860I 0 F=YN, P=2, M=N, B=2048                   
ICE751I 0 C5-K90007 C6-K90007 C7-K90000 C8-K90007 E9-K90007 C9-BASE   E5-K18181 E7-K11698   
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                   
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 10:50 ON THU AUG 30, 2007 -                     SORT FIELDS=COPY                   
                   RECORD TYPE=V                     
                   OUTFIL FILES=01,                   
                   INCLUDE=(5,1,CH,EQ,X'00'),                     
                   OUTREC=(1:1,4,5,31)                   
                   OUTFIL FILES=02,                   
                   INCLUDE=((23,4,CH,EQ,C'2654'),OR,
                            (23,4,CH,EQ,C'3060'),OR,
                            (23,4,CH,EQ,C'2043'),OR,
                            (23,4,CH,EQ,C'5314'),OR,
                            (23,4,CH,EQ,C'2560'),OR,
                            (23,4,CH,EQ,C'2007'),OR,
                            (23,4,CH,EQ,C'2329')),
                   OUTREC=(1:1,1111)
                   OUTFIL FILES=03,
                   INCLUDE=(5,1,CH,EQ,X'FF'),
                   OUTREC=(1:1,4,5,32)
ICE905I 0 I : RF=80,LR=1111,BLK=32736,BCT=69174
ICE201I E RECORD TYPE IS V - DATA STARTS IN POSITION 5
ICE858I 0 LA=262024, DA=6144, AA=255880, BA=6085, TA=6133
ICE859I 0 LB=8048, DB=1036, AB=7012, BB=0, CP=4, RS=0, TB=24
ICE860I 0 F=YN, P=2, M=N, B=2048       
ICE751I 0 C5-K90007 C6-K90007 C7-K90000 C8-K90007 E9-K90007 C9-BASE   E5-K18181 E7-K11698
ICE142I 0 SRTMSGE  NOT FOUND - SYSOUT USED
ICE193I 0 ICEAM1 ENVIRONMENT IN EFFECT - ICEAM1 INSTALLATION MODULE SELECTED
ICE088I 0 YI75HDTR.SORT02  .        , INPUT LRECL = 1111, BLKSIZE = 32736, TYPE = VB
ICE093I 0 MAIN STORAGE = (MAX,6291456,6291456)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6234096,6234096)
ICE127I 0 OPTIONS: OVFLO=RC0,SPANINC=RC16,VLSCMP=N,SZERO=Y,
RESET=Y,VSAMEMT=Y,DYNSPC=70
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,
EQUALS=N,LIST=Y,ERET=RC16 ,MSGDDN=SYSOUT
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=FULL ,WRKSEC=Y,OUTSEC=Y,
VERIFY=N,CHALT=N,DYNALOC=N  ,ABCODE=MSG
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=N,
STIMER=Y,COBEXIT=COB2
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,
OVERRGN=65536,CINV=Y,CFW=Y,DSA=0
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=Y,TEXIT=Y,LISTX=N,EFS=NONE    ,EXITCK=S,PARMDDN=DFSPARM ,FSZEST=N                     
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=60  ,ODMAXBF=2097152,SOLRF=Y,VLLONG=N,VSAMIO=N,MOSIZE=MAX
ICE235I 0 OPTIONS: NULLOUT=RC0       
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTIN
ICE889I 0 CT=MAX     , SB=3, L=0, D=0000
ICE902I 0 O       I JZ11             
ICE231I 0 STORAGE USED FOR OUTFIL : BELOW 16M = 24576, ABOVE 16M = 6280192
ICE855I 0 SORTOF01 : TX=N, R=J, L=J, B=D, BL=0, BR=0, DCT=37, VS=N, RU=X, SB=8
ICE210I 0 SORTOF01 : EXCP USED, LRECL = 1111, BLKSIZE = 27998, TYPE = VB
ICE855I 0 SORTOF02 : TX=N, R=J, L=J, B=D, BL=0, BR=0, DCT=37, VS=N, RU=X, SB=8
ICE210I 0 SORTOF02 : EXCP USED, LRECL = 1111, BLKSIZE = 27998, TYPE = VB
ICE855I 0 SORTOF03 : TX=N, R=J, L=J, B=D, BL=0, BR=0, DCT=37, VS=N, RU=X, SB=8
ICE210I 0 SORTOF03 : EXCP USED, LRECL = 1111, BLKSIZE = 27998, TYPE = VB
ICE218A 3 49 BYTE VARIABLE RECORD IS SHORTER THAN 1111 BYTE MINIMUM FOR SORTOF02 FIELDS
ICE751I 1 EF-K10929 CB-K90000 F0-Q84357 E8-K11698
ICE052I 0 END OF DFSORT

Thanks
Nadh
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Aug 30, 2007 5:12 am    Post subject: Reply with quote

Quote:

ICE218A 3 49 BYTE VARIABLE RECORD IS SHORTER THAN 1111 BYTE MINIMUM FOR SORTOF02 FIELDS


Nadh,

Did you want the SORTOF02 a Fixed block(FB) file or Variable Block(VB) file. If you want VB file then just remove the OUTREC statement. Use these control cards

Code:

 SORT FIELDS=COPY
 RECORD TYPE=V
 OUTFIL FILES=01,
 INCLUDE=(5,1,CH,EQ,X'00'),
 OUTREC=(1:1,4,5,31)

 OUTFIL FILES=02,
 INCLUDE=((23,4,CH,EQ,C'2654'),OR,
          (23,4,CH,EQ,C'3060'),OR,
          (23,4,CH,EQ,C'2043'),OR,
          (23,4,CH,EQ,C'5314'),OR,   
          (23,4,CH,EQ,C'2560'),OR,
          (23,4,CH,EQ,C'2007'),OR,
          (23,4,CH,EQ,C'2329'))

  OUTFIL FILES=03,
  INCLUDE=(5,1,CH,EQ,X'FF'),
  OUTREC=(1:1,4,5,32)       
/*


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


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Thu Aug 30, 2007 5:33 am    Post subject: Reply with quote

Cheers!!!

Kolusu it worked fine.

But, its copying the acutal trailer where i need to update the record count. Since data set is huge its automaticaly opening in browse mode. is there any way to update it through sort itself?

Thanks
Nadh
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Aug 30, 2007 5:35 am    Post subject: Reply with quote

nadh,

How do you identify the header and trailer record? What is the pos and format of the count field?

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


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Thu Aug 30, 2007 5:50 am    Post subject: Reply with quote

Kolusu,

OUTFIL FILES=01 is for header
OUTFIL FILES=03 is for trailer in sort conditions above. The trailer record format is
01 MDMS-MSAVER-HIST-TRLR.
03 FILLER PIC X(27).
03 MDMS-R-COUNT PIC S9(9) COMP-3.
So I need to update the record cound in trailer from 28th position in record.

Thanks
Nadh.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Aug 30, 2007 7:20 am    Post subject: Reply with quote

nadh,

Is the total on trailer consider the header and trailer record also into account? or just the detail record count?Also do you need the contents of header as is from the input file or can we generate them writing them to output?

In your definition you showed the trailer had 27 bytes of filler. What is the contents of that filler? is it all low-values ? or any thing specific?

Show me the header and trailer record contents

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Aug 31, 2007 11:21 am    Post subject: Reply with quote

nadh,

Just showing us YOUR attempt at the job doesn't really tell us what we need to know. I suspect you can do this in less passes using DFSORT's IFTHEN clauses. But to help us give you the best solution, it would really help if you would show an example of your input records and what you expect for output, give the RECFM and LRECL of the input file, and give the position, length and format of all relevant fields.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
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
Page 1 of 1

 
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