How to include header in a file



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

How to include header in a file

Postby jatin_compsci » Wed Feb 13, 2013 2:30 pm

Hi,

I am facing problem while inserting a header in to my input file.

My input file looks like -

00789753;0065382;00000;OP;2012-09-22
00824766;0007211;00000;OP;2013-02-10
00826145;0065382;00000;OP;2012-07-05
00826147;0065382;00100;DL;2012-07-10
00884274;0060398;01287;DL;2012-10-09
00884314;0072859;00000;OP;2012-10-04
00918760;0081999;00000;OP;2013-01-16


and i want output file to be -

DRDER_BR NOTLAVEN_XVC_BNK PRDSRWAD_PTS LORNANKAD_SNK_SAT
00739753;0065382;00000;OP;2012-09-22
00824766;0007211;00000;OP;2013-02-10
00826145;0065382;00000;OP;2012-07-05
00826147;0065382;00100;DL;2012-07-10
00884274;0060398;01287;DL;2012-10-09
00884314;0072859;00000;OP;2012-10-04
00918760;0081999;00000;OP;2013-01-16

i.e. divided into 4 columns DRDER_BR , NOTLAVEN_XVC_BNK , PRDSRWAD_PTS , LORNANKAD_SNK_SAT

How to achieve this?

Thanks in advance.
jatin_compsci
 
Posts: 17
Joined: Wed Feb 13, 2013 1:30 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to include header in a file

 

Re: How to include header in a file

Postby BillyBoyo » Wed Feb 13, 2013 2:58 pm

Look at the reporting functions of OUTFIL, specifically HEADER1.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to include header in a file

Postby jatin_compsci » Wed Feb 13, 2013 3:01 pm

Hi Billy,

I have mentioned header as1 -

HEADER1=('DRDER_BR;BNR;NOTLAVEN_XVC_BNK;',             
         'PRDSRWAD_PTS ;LORNANKAD_SNK_SAT;'),           
  BUILD=(1,8,C';',9:10,7,C';',13:18,5,C';',30:24,2,C';',
  42:27,10)


Code'd
jatin_compsci
 
Posts: 17
Joined: Wed Feb 13, 2013 1:30 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to include header in a file

Postby BillyBoyo » Wed Feb 13, 2013 3:11 pm

And? If you need more help, post all your Sort control cards and the full sysout from the step, please. In the Code tags.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to include header in a file

Postby jatin_compsci » Wed Feb 13, 2013 3:30 pm

Hi Billy,

Sorry, i should have given this to you earlier only.

Below is the complete card -

                                                                     
//S1       EXEC  PGM=ICEMAN                                           
//SYSOUT   DD   SYSOUT=*                                               
//SORTIN   DD DSN=VTENK.UNLOAD.FTDT.TORDRAD4.OUT,DISP=SHR             
//SORTOUT  DD DSN=VTENK.UNLOAD.FTDT.TORDRAD5.OUT,                     
//             DISP=(NEW,CATLG,DELETE),                               
//             SPACE=(CYL,(1000,1000),RLSE),                           
//             DCB=(LRECL=42,BLKSIZE=42000,RECFM=FB),                 
//             UNIT=(TEST,25)                                         
//SYSIN    DD    *                                                     
  OPTION COPY                                                         
  OUTFIL REMOVECC,                                                     
          HEADER1=('DRDER_BR;BNR;NOTLAVEN_XVC_BNK;',             
          'PRDSRWAD_PTS ;LORNANKAD_SNK_SAT;'),                 
            BUILD=(1,8,C';',9:10,7,C';',13:18,5,C';',30:24,2,C';',     
            42:27,10)                                                 
/*                                                                     


Let me know if anyother information is required.
jatin_compsci
 
Posts: 17
Joined: Wed Feb 13, 2013 1:30 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to include header in a file

Postby BillyBoyo » Wed Feb 13, 2013 4:17 pm

Well, you didn't include the sysout, but I guess you got this:

ICE126A 9 INCONSISTENT REFORMATTING FOR SORTOUT : REASON CODE 04, IFTHEN 0


 BUILD=(1,8,C';',9:10,7,C';',13:18,5,C';',30:24,2,C';',42:27,10)


The problem is, you've put "columns" into the BUILD without taking care that they do no overlap other parts of the BUILD. If the columns are not needed, don't use them, it'll be easier to understand and maintain.

BUILD=(1,8,C';',10,7,C';',18,5,C';',24,2,C';',
42:27,10,11X)


The positions might not be what you want, but you can change them. I have 11X at the end, as the text is longer than the data.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to include header in a file

Postby jatin_compsci » Wed Feb 13, 2013 4:43 pm

Hi Billy,

I am getting the below error now :(

I think i am defining the header in a wrong manner.

 ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                               
 ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES A
 ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 12:11 ON WED FE
             OPTION COPY                                                       
             OUTFIL REMOVECC,                                                   
                     HEADER1=('ORDER_NR;BNR;MOTTAGEN_KVT_BPK;',                 
                              'ORDERRAD_STS;FORVANTAD_ANK_DAT;'),               
                       BUILD=(1,8,C,9:10,7,C,13:18,5,C,30:24,2,C,               
                                   Å                                           
 ICE007A E SYNTAX ERROR                                                         
                       42:27,10,11X)                                           
                       Å                                                       
 ICE007A 0 SYNTAX ERROR                                                         
 ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E7-K24705                   
 ICE026I 1 SMF RECORD NOT WRITTEN TO THE SMF DATA SET(RC=20)                   

jatin_compsci
 
Posts: 17
Joined: Wed Feb 13, 2013 1:30 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to include header in a file

Postby BillyBoyo » Wed Feb 13, 2013 4:46 pm

If you don't want the separators in the data, you need to get rid of the "C"s as well. My advice is still to get rid of the column numbers (9:, 13: and 30:) which are not needed.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to include header in a file

Postby jatin_compsci » Wed Feb 13, 2013 5:35 pm

Hi Billy,

But if i remove 9:,13 and 30 and then i am left with 1,8 only.

Wont this effect the column which i am trying to include.?

It would be great for me if you can give me BUILD for the same.
jatin_compsci
 
Posts: 17
Joined: Wed Feb 13, 2013 1:30 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to include header in a file

Postby BillyBoyo » Wed Feb 13, 2013 5:44 pm

I already gave you one based on what you first showed. On what you have now shown,

 BUILD=(1,8,10,7,18,5,24,2,42:27,10,11X)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post