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 

Sorting records without changing position of headers.
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
bade_miya
Beginner


Joined: 10 Dec 2003
Posts: 110
Topics: 38

PostPosted: Fri Sep 10, 2004 3:39 am    Post subject: Sorting records without changing position of headers. Reply with quote

Hi all,
My input file has the following format.

herder1
herder2
herder3
herder4
herder5
rec1
rec2
rec3
rec4
rec5
rec6
rec7
herder1
herder2
herder3
herder4
herder5
rec8
rec9
rec10
rec11
rec12
rec13
rec14

I want to sort my records only omiting all the header part. The problem is that the header repeats for every 17 records. I have to retain the position of these headers while i am sorting. I want to do it by sorting and cannot use any other methods like ezytrieve and quickjob. I can use either syncsort or dfsort. Can anyone give a clue on how it can be done.

thanks.
bade_miya
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Fri Sep 10, 2004 9:54 am    Post subject: Reply with quote

It's not clear to me what you want to do. You say you want to "sort my records only omiting all the header part". Does that mean you want to remove the header records? If so, you can do that with OMIT before you sort the records. But then you say "I have to retain the position of these headers while i am sorting." so it sounds like you don't want to remove the headers. Confusing.

Are you trying to sort the detail records within each group of headers and details records independently of the other groups? It would help if you showed an example of what the input records look like with the keys out of order, and what the output records look like with the keys in order.

What is the RECFM and LRECL of your input file? What is the starting position, length and format of the key?

Do the headers have some kind of identifier (e.g. 'HDR' in positions 1-3)?

Do your groups always consist of 5 header records and 7 detail records?

What's the approximate maximum number of records in the input file?
_________________
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
bade_miya
Beginner


Joined: 10 Dec 2003
Posts: 110
Topics: 38

PostPosted: Wed Sep 15, 2004 10:16 am    Post subject: Reply with quote

Hi Frank,
Sorry for the late reply. I didnt come to office for last two days. Now for the description, first of all let me clarify that i want to retain the headers.

Code:

*************************************************************
sample input
*************************************************************
--------------------------------------------------------------------------------------
                                 SUMMARY REPORT  FOR AUGUST
field1         field2         field3         field4        field5
--------------------------------------------------------------------------------------
4
2
1
5
5
2
3
--------------------------------------------------------------------------------------
                                 SUMMARY REPORT  FOR AUGUST
field1         field2         field3         field4        field5
--------------------------------------------------------------------------------------
8
5
2
3
1
9
1
*************************************************************
sample output for the above input
*************************************************************
--------------------------------------------------------------------------------------
                                 SUMMARY REPORT  FOR AUGUST
field1         field2         field3         field4        field5
--------------------------------------------------------------------------------------
1
1
1
2
2
2
3
--------------------------------------------------------------------------------------
                                 SUMMARY REPORT  FOR AUGUST
field1         field2         field3         field4        field5
--------------------------------------------------------------------------------------
3
4
5
5
5
8
9
*************************************************************
*************************************************************


The sortable field is field1 alone. Thats why i didnt fill in values for other fields.

The headers should repeat after every 7 records in the output file. Sorting shouldnt be inbetween headers. it should consider all records together.

Please let me know if there is any way to insert headers after every 7 output records.

Please tell me if i need to explain more.

thanks
bade_miya
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Sep 15, 2004 10:39 am    Post subject: Reply with quote

bade_miya,

The following DFSORT/ICETOOL JCL will give you the desired results. If you have syncsort at your shop then change the pgm name to synctool .I assumed that your input file is 80 bytes in lrecl and is of FB recfm.

A brief explanation of the job.

The first copy operator splits the input file into 2 files. T1 will have all the headers records and file T2 will have all the detail records. Since you wanted the header records to appear after every 7 records, we add a seqnum to the header file with increments of 7.

The sort operator then takes the detail file (T2) and sorts it on FIELD1 and writes out to T3. We also add a seqnum to this file so that sneak in the header records in between.

The last sort operator takes in files T1 & T3 concatenated together and sorts on the seqnum, to acheive the desired results. While writting out , we remove the sequence number.

Code:

//STEP0100 EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN       DD *                                           
SUMMARY REPORT FOR AUGUST                                 
4                                                         
2                                                         
1                                                         
5                                                         
5                                                         
2                                                         
3                                                         
SUMMARY REPORT FOR AUGUST                                 
8                                                         
5                                                         
2                                                         
3                                                         
1                                                         
9                                                         
1                                                         
//T1       DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE) 
//T2       DD DSN=&T2,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE) 
//T3       DD DSN=&T3,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE) 
//CON      DD DSN=&T1,DISP=OLD,VOL=REF=*.T1               
//         DD DSN=&T3,DISP=OLD,VOL=REF=*.T3               
//OUT      DD SYSOUT=*                                     
//TOOLIN   DD *                                         
  COPY FROM(IN)  USING(CTL1)                           
  SORT FROM(T2)  USING(CTL2)                           
  SORT FROM(CON) USING(CTL3)                           
//CTL1CNTL DD *                                         
  OUTFIL FNAMES=T1,INCLUDE=(1,7,CH,EQ,C'SUMMARY'),     
  OUTREC=(1,80,SEQNUM,8,ZD,START=1,INCR=7)             
  OUTFIL FNAMES=T2,SAVE                                 
//CTL2CNTL DD *                                         
  SORT FIELDS=(1,1,CH,A)                               
  OUTFIL FNAMES=T3,                                     
  OUTREC=(1,80,SEQNUM,8,ZD)                             
//CTL3CNTL DD *                                         
  OPTION EQUALS                                         
  SORT FIELDS=(81,8,CH,A)                               
  OUTFIL FNAMES=OUT,                                   
  OUTREC=(1,80)                                         
/*                                                     


If you want the headers to be generated, instead of retaining the orginals headers from the input file, then we can avoid a couple of passes. Let me know if you are interested in that solution.


Hope this helps....

Cheers

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: Wed Sep 15, 2004 11:40 am    Post subject: Reply with quote

Bade,

Here's another way to do this with DFSORT. I assumed that your input file has RECFM=FB and LRECL=86. The approach here is to set up DFSORT symbols for the headers from the input record headers, and then use them to create the headers in the report where needed. Since each input line is 86 bytes, we have to break each header line into two DFSORT symbols (a DFSORT symbol string can be a maximum of 50 bytes).

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  FB/86 input file
//SORTOUT DD DSN=&&S,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
* Create two DFSORT symbols as follows from each of the four
* header lines:
* HDAn,'bytes 1-43'
* HDBn,'bytes 44-86'
  OPTION COPY,STOPAFT=4
  OUTFIL OUTREC=(C'HDA',SEQNUM,1,ZD,C',''',1,43,C'''',80:X,/,
                 C'HDB',SEQNUM,1,ZD,C',''',44,43,C'''')
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S,DISP=(OLD,PASS)
//SORTIN DD DSN=...  FB/86 input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
* Collate equal keys in original order
   OPTION EQUALS
* Remove the original header lines
   OMIT COND=(1,1,CH,LT,C'1',OR,1,1,CH,GT,C'9')
* Sort on the key
   SORT FIELDS=(1,1,CH,A)
* Use the HDAn-HDBn symbols to create the 4 header lines
* before each 7 sorted data lines.
   OUTFIL HEADER2=(HDA1,HDB1,/,HDA2,HDB2,/,HDA3,HDB3,/,HDA4,HDB4),
    LINES=11
/*

_________________
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


Last edited by Frank Yaeger on Thu Sep 16, 2004 10:08 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bade_miya
Beginner


Joined: 10 Dec 2003
Posts: 110
Topics: 38

PostPosted: Thu Sep 16, 2004 2:42 am    Post subject: Reply with quote

Hi Frank&Kolusu,
First of all i appologize for not providing the details that Frank asked for in the previous post. I missed that part while posting my reply.

Q)What is the RECFM and LRECL of your input file? What is the starting position, length and format of the key?
A) RECFM=FB LRECL=135, position=1,length=31,format=ch

Q)Do the headers have some kind of identifier (e.g. 'HDR' in positions 1-3)?
A) NO they dont have. The headers are
--------------------------------------------------------------------------------------
SUMMARY REPORT FOR AUGUST
field1 field2 field3 field4 field5
--------------------------------------------------------------------------------------
The first two headers are excatly the same and the third header will be names of various fiedls.

Q)Do your groups always consist of 5 header records and 7 detail records?
A) yes it does. but it is 4 headers .

Q)What's the approximate maximum number of records in the input file?
A) dont know for sure. lets say 1-1000.

*************************************************************
Now for the replies, Kolusu is considering only one header i guess. If we take that way, the job is working perfect. i am trying to apply it in case of more than one header. I would also like to know about how to generate the headers as you mentioned in your previous post as it would perfectly suit my need. Can we generate the same kind of headers as i have shown in the previous post? Should i provide any other info for that?

Frank,
I didnt get what this statement in your job ment.
'SORTIN DD DSN=&&IN,DISP=(OLD,PASS)'
as we havent used &&IN anywhere else in the jcl.
It also gave me a JCL error. so i try giving it disp=(,pass) and modified the outfil statement to
OUTFIL OUTREC=(C'HDA',SEQNUM,1,ZD,C',''',1,43,C'''',129:X,/,
C'HDB',SEQNUM,1,ZD,C',''',44,43,C'''')
as my infile lrecl=135. (please correct me if i am wrong in changing this.)

When i submitted the job, it gave me MAX CC=S013 REASON CODE =20 for SYSIN statement for S2 STEP. I couldnt resolve it. Please help me with this.

thanks.
bade_miya
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Sep 16, 2004 5:28 am    Post subject: Reply with quote

Bade_miya,

Quote:

Now for the replies, Kolusu is considering only one header i guess. If we take that way, the job is working perfect. i am trying to apply it in case of more than one header.


I am not considering that you have only a single header. My job works for 'N' of headers.

Quote:

I would also like to know about how to generate the headers as you mentioned in your previous post as it would perfectly suit my need.


you want a header like that after every 7 sorted records?
Code:

                                 SUMMARY REPORT  FOR AUGUST
field1         field2         field3         field4        field5



Quote:

When i submitted the job, it gave me MAX CC=S013 REASON CODE =20 for SYSIN statement for S2 STEP. I couldnt resolve it. Please help me with this.


It would help us if you can provide us the TOOLIN and DFSMSG DD's sysout

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


Joined: 10 Dec 2003
Posts: 110
Topics: 38

PostPosted: Thu Sep 16, 2004 8:51 am    Post subject: Reply with quote

Hi guys,
This is the message i in JESYSMSG which i got while running Franks solution.
********************************************************************
Code:
IEF237I JES2 ALLOCATED TO SYSIN                                                 
IEF237I JES2 ALLOCATED TO SYSIN                                                 
IEC141I 013-20,IGG0191A,MFID12AA,S2,SYMNAMES,5127,PUBL03,SYS04260.T073936.RA000.
IEA995I SYMPTOM DUMP OUTPUT                                                     
SYSTEM COMPLETION CODE=013  REASON CODE=00000020                               
********************************************************************

This is for the second step. And the second step is
********************************************************************
Code:
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S,DISP=(OLD,PASS)
//SORTIN DD DSN=&&IN,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SORTOUT DD DSN=DFC2.VND709.GLOB.FFB.HEADSRT.OUTPUT,
//           DISP=(NEW,CATLG,DELETE),
//           UNIT=SYSDA,
//           SPACE=(CYL,(10,10),RLSE),
//           DCB=(LRECL=135,RECFM=FB,BLKSIZE=0)
//SYSIN    DD    *
   OPTION EQUALS
   OMIT COND=(1,1,CH,LT,C'1',OR,1,1,CH,GT,C'9')
   SORT FIELDS=(1,1,CH,A)
   OUTFIL HEADER2=(HDA1,HDB1,/,HDA2,HDB2,/,HDA3,HDB3,/,HDA4,HDB4),
    LINES=11
/*
********************************************************************

Quote :
Quote:

'It would help us if you can provide us the TOOLIN and DFSMSG DD's sysout '


But it was not for TOOLIN which i got the error message and Franks solution dosent contain any TOOLIN. And i have provided the error message i have got for the step S2 and also the step itself.

********************************************************************
Quote:
Quote:

'you want a header like that after every 7 sorted records? '


Yes.
********************************************************************
Quote:

I am not considering that you have only a single header. My job works for 'N' of headers


But in your sample input there is only one kind of header ie 'SUMMARY REPORT FOR AUGUST'. There are two other kind of headers also, as shown in my sample input. They are.
1) -------------------------------------------------------------------------------------------
2) field1 field2 field3 field4 field5

********************************************************************
Quote:

If you want the headers to be generated, instead of retaining the orginals headers from the input file, then we can avoid a couple of passes. Let me know if you are interested in that solution.


Please tell me how we can do this. Can i generate these three kind of headers after every 7 records?

thanks
bade_miya.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Sep 16, 2004 9:01 am    Post subject: Reply with quote

Bade_miya,

Please post the SYSOUT messages from Frank's job of step1 and step2. Also post the JCL you used(both steps)

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


Joined: 10 Dec 2003
Posts: 110
Topics: 38

PostPosted: Thu Sep 16, 2004 9:21 am    Post subject: Reply with quote

SYSOUT FOR S1
-------------------
*************************************************************
Code:
SYSIN :                                                                         
* CREATE TWO DFSORT SYMBOLS AS FOLLOWS FROM EACH OF THE FOUR                   
* HEADER LINES:                                                                 
* HDAN,'BYTES 1-43'                                                             
* HDBN,'BYTES 44-86'                                                           
  OPTION COPY,STOPAFT=4                                                         
  OUTFIL OUTREC=(C'HDA',SEQNUM,1,ZD,C',''',1,43,C'''',129:X,/,                 
                 C'HDB',SEQNUM,1,ZD,C',''',44,43,C'''')                         
WER164B  6,896K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,             
WER164B     64K BYTES RESERVE REQUESTED, 1,027,808 BYTES USED                   
WER146B  20K BYTES OF EMERGENCY SPACE ALLOCATED                                 
WER108I  SORTIN   :  RECFM=FB   ; LRECL=   100; BLKSIZE=   100                 
WER110I  SORTOUT  :  RECFM=FB   ; LRECL=   129; BLKSIZE= 27993                 
WER405I  SORTOUT  :  DATA RECORDS OUT          4; TOTAL RECORDS OUT          8 
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                   
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                   
WER416B  SORTIN:    EXCP'S=1,UNIT=3390,DEV=5183,CHP=(BBCCBDBFC6C8CA,1),VOL=DVLP7
WER416B  OUTFIL WAS USED FOR SORTOUT                                           
WER054I  RCD IN          4, OUT          4                                     
WER169I  RELEASE 1.1C BATCH 0405 TPF LEVEL 2B                                   
WER052I  END SYNCSORT - MFID12AA,S1,,DIAG=E800,7BCE,C0AA,20CC,A056,4CC2,82E8,0C6
*************************************************************

SYSOUT FOR S2
-------------------
Its a SNAP and it is very large. i will paste the begining lines of the same
*************************************************************
Code:
 PSW AT ENTRY TO SNAP    078D1000  80008B1E  ILC  02  INTC  0033               
                                                                               
ASCB: 00EEFB80                                                                 
         +0000  ASCB..... ASCB      FWDP..... 00EE1400  BWDP..... 00EA7200  LTCS
         +0014  SYNC..... 0010EDF6  IOSP..... 00000000  R01C..... 0000      WQID
         +0024  ASID..... 0244      R026..... 0000      LL5...... 00        HLHI
         +002C  TCBE..... 00000000  LDA...... 7FF17EA0  RSMF..... 00        FLG3
         +0038  CSCB..... 1D9D0400  TSB...... 00000000  EJST..... 00000000  029A
         +0048  EWST..... BBD456C5  D6E1B100            JSTL..... 00000073  ECB.
         +005C  TLCH..... 00000000  DUMP..... 008FFE88  AFFN..... FFFF      RCTF
         +0068  TMCH..... 00000000  ASXB..... 008FDE88  SWCT..... 1434      DSP1
         +0074  RSV...... 0000      SRBS..... 0000      LLWQ..... 00000000  RCTP
         +0084  LSWQ..... 00000000  QECB..... 00000000  MECB..... 40000000  OUCB
         +0098  FMCT..... 0000      LEVL..... 03        FL2A..... 80        R09C
         +00A4  RTMC..... 00000000  MCC...... 00000000  JBNI..... 00E9E448  JBNS
         +00B5  SRQ2..... 00        SRQ3..... 00        SRQ4..... 00        VGTT
         +00C0  SSRB..... 0000      SMCT..... 00        SRBM..... 07        SWTL

*************************************************************

JCL USED
-----------
*************************************************************

Code:
//MFID12AA JOB (AAAA,BBBB),
//             'FILECOPY',
//             CLASS=A,
//             MSGCLASS=T,
//             NOTIFY=&SYSUID
//*
//*******************************************************
//STEP0    EXEC PGM=IEFBR14
//DD1      DD  DISP=(MOD,DELETE),
//             DSN=MFID12.HEADSRT.OUTPUT,
//             SPACE=(TRK,(0,0))
//*
//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=MFID12.C27870DD.G0132V00,DISP=SHR
//SORTOUT DD DSN=&&S,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
* CREATE TWO DFSORT SYMBOLS AS FOLLOWS FROM EACH OF THE FOUR
* HEADER LINES:
* HDAN,'BYTES 1-43'
* HDBN,'BYTES 44-86'
  OPTION COPY,STOPAFT=4
  OUTFIL OUTREC=(C'HDA',SEQNUM,1,ZD,C',''',1,43,C'''',129:X,/,
                 C'HDB',SEQNUM,1,ZD,C',''',44,43,C'''')
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S,DISP=(OLD,PASS)
//SORTIN DD DSN=&&IN,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SORTOUT DD DSN=MFID12.HEADSRT.OUTPUT,
//           DISP=(NEW,CATLG,DELETE),
//           UNIT=SYSDA,
//           SPACE=(CYL,(10,10),RLSE),
//           DCB=(LRECL=135,RECFM=FB,BLKSIZE=0)
//SYSIN    DD    *
* COLLATE EQUAL KEYS IN ORIGINAL ORDER
   OPTION EQUALS
* REMOVE THE ORIGINAL HEADER LINES
   OMIT COND=(1,1,CH,LT,C'1',OR,1,1,CH,GT,C'9')
* SORT ON THE KEY
   SORT FIELDS=(1,1,CH,A)
* USE THE HDAN-HDBN SYMBOLS TO CREATE THE 4 HEADER LINES
* BEFORE EACH 7 SORTED DATA LINES.
   OUTFIL HEADER2=(HDA1,HDB1,/,HDA2,HDB2,/,HDA3,HDB3,/,HDA4,HDB4),
    LINES=11
/*
//


*************************************************************

Thanks
bade_miya.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Thu Sep 16, 2004 10:07 am    Post subject: Reply with quote

Bade,

The SORTIN DD statement was supposed to be:

//SORTIN DD DSN=... FB/86 input file

&&IN was the input data set I generated and used for my test. I changed the //SORTIN DD in the first step, but forgot to change it in the second step.

The WER messages indicate you're using Syncsort, not DFSORT, so there's no point in my showing you how to do this with DFSORT.
_________________
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
bade_miya
Beginner


Joined: 10 Dec 2003
Posts: 110
Topics: 38

PostPosted: Thu Sep 16, 2004 10:20 am    Post subject: Reply with quote

Hi Frank,

But i used the same job as shown. I havent mentioned syncsort anywhere. In my step S1 and S2 i have used PGM=ICEMAN. Then how come i am using syncsort? Please explain.

thanks
bade_miya
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Sep 16, 2004 10:33 am    Post subject: Reply with quote

Bade_miya,

please go thru link this link which explains in about ICEMAN

http://www.mvsforums.com/helpboards/viewtopic.php?t=2504&highlight=alias

I will post the correct JCL later

Hope this helps...

Cheers

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: 12377
Topics: 75
Location: San Jose

PostPosted: Thu Sep 16, 2004 10:58 am    Post subject: Reply with quote

Bade_miya,

The Error s013 is due to the fact that A SYMNAMES DD statement data set must have the following attributes: RECFM=F or RECFM=FB and LRECL=80.

Since your input file length is 135 bytes, we create 3 symbols instead of 2 as frank has shown.

The following JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=ICEMAN                               
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=YOUR.INPUT.FILE,                     
//            DISP=SHR                                   
//SORTOUT  DD DSN=&S,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE) 
//SYSIN    DD *             
* CREATE 3 DFSORT SYMBOLS AS FOLLOWS FROM EACH OF THE FOUR     
* HEADER LINES:                                               
* HDAN,'BYTES 01-45'                                           
* HDBN,'BYTES 46-90'                                           
* HDCN,'BYTES 90-135'                                         
  OPTION COPY,STOPAFT=4                                       
  OUTFIL OUTREC=(C'HDA',SEQNUM,1,ZD,C',''',01,45,C'''',/,     
                 C'HDB',SEQNUM,1,ZD,C',''',46,45,C'''',/,     
                 C'HDC',SEQNUM,1,ZD,C',''',91,45,C'''',80:X)   
/*
//STEP0200 EXEC PGM=ICEMAN                         
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD DSN=YOUR.RPT.INPUT,               
//            DISP=SHR                             
//SYMNAMES DD DSN=&S,DISP=OLD                     
//SORTOUT  DD DSN=YOUR OUTPUT FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=PROD,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *                     
  OPTION EQUALS                             
  OMIT COND=(01,1,CH,EQ,C'-',OR,           
             01,5,CH,EQ,C'FIELD',OR,         
             34,7,CH,EQ,C'SUMMARY')         
  SORT FIELDS=(1,1,CH,A)
  OUTFIL REMOVECC,HEADER2=(HDA1,HDB1,HDC1,/,   
                           HDA2,HDB2,HDC2,/,   
                           HDA3,HDB3,HDC3,/,   
                           HDA4,HDB4,HDC4),LINES=11               
/*                                 


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu


Last edited by kolusu on Fri Sep 17, 2004 4:52 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bade_miya
Beginner


Joined: 10 Dec 2003
Posts: 110
Topics: 38

PostPosted: Fri Sep 17, 2004 3:30 am    Post subject: Reply with quote

Hi Kolusu,
I made some changes to the above job and it is working perfect. It gave me syntax error when i first ran this job at

Code:
OUTFIL REMOVECC HEADER2=(HDA1,HDB1,HDC1,/,   
                           HDA2,HDB2,HDC2,/,   
                           HDA3,HDB3,HDC3,/,   
                           HDA4,HDB4,HDC4),LINES=11


So i changed it to

Code:
OUTFIL HEADER2=(HDA1,HDB1,HDC1,/,   
                           HDA2,HDB2,HDC2,/,   
                           HDA3,HDB3,HDC3,/,   
                           HDA4,HDB4,HDC4),LINES=11,REMOVECC 



Its working perfectly as i wanted. Thanks to Kolusu and Frank for the replies.

Thanks
bade_miya.
Back to top
View user's profile Send private message
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