IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Jcl - file split and add a new field to each file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mane Sagar

New User


Joined: 12 Jul 2005
Posts: 41
Location: mumbai

PostPosted: Tue Jan 31, 2006 9:33 pm
Reply with quote

Hi,

I have an input file and have to split it as per a condition at position 7(if CD='PER' and 'PEN)
and have to add a new field at the 15th position.

I tried to do this with ICETOOl but it abends. Can you please let me know the error in the jcl I have written.
The record length of the input file is 52.
The JCL that I have written is :
Code:

//********************************************************
//* COPY                                                 
//********************************************************
//STEP01   EXEC PGM=ICETOOL,                             
//            COND=(4,LT)                                 
//*                                                       
//SORTIN       DD  DSN=ASOS.CISPGM.INPUT.TEST2,           
//            DISP=SHR                                   
//*                                                       
//OUT1         DD  DSN=ASOS.CISPGM.TEST.CURRENT1,         
//            DISP=(NEW,CATLG,CATLG),                     
//            UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),       
//            DCB=(RECFM=FB,LRECL=34,BLKSIZE=0)           
//                                                       
//OUT2         DD  DSN=ASOS.CISPGM.TEST.CURRENT2,         
//            DISP=(NEW,CATLG,DELETE),                   
//            UNIT=SYSDA,SPACE=(TRK,(50,10),RLSE),       
//            DCB=(RECFM=FB,LRECL=34,BLKSIZE=0)           
//                                                       
//TOOLMSG      DD  SYSOUT=*                         
//DFSMSG       DD  SYSOUT=*                         
//*                                                 
//TOOLIN       DD  * *** CONSTANT CONTROL CARDS ***
   COPY FROM(SORTIN) USING(CTL1)                       
//CTL1CNTL     DD  * *** CONSTANT CONTROL CARDS ***
   OUTFIL FNAMES=OUT1,                               
   INCLUDE=(07,3,CH,EQ,C'PEN'),                       
   OUTREC=(01:19,5,                                   
         06:24,9,                                   
         15:3C'33D',                               
         18:1,6,                                   
         24:42,11)                                 
   OUTFIL FNAMES=OUT2,                               
   INCLUDE=(07,3,CH,EQ,C'PER'),                     
   OUTREC=(01:19,5,                                 
        06:24,9,                                 
        15:3C'33D',                             
        18:1,6,                                 
        24:42,11) 
/* END OF INPUT       
//*         


And the error is :
Code:


ICE000I 0 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 07:46 ON TUE JAN
           OUTFIL FNAMES=OUT1,                                                 
           INCLUDE=(07,3,CH,EQ,C'PEN'),                                         
           OUTREC=(01:19,5,                                                     
                   06:24,9,                                                     
                   15:3C'33D',                                                 
                   18:1,6,                                                     
                   24:42,11)                                                   
ICE146I 0 END OF STATEMENTS FROM CTL1CNTL - PARAMETER LIST STATEMENTS FOLLOW   
          DEBUG NOABEND,ESTAE                                                   
          OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL1,SORTIN=SORTI
                         ,DYNALLOC                                             
          SORT FIELDS=COPY                                                     
ICE201I 0 RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
ICE126A 9 INCONSISTENT OUT1     IFTHEN 0 REFORMATTING FIELD FOUND               
ICE052I 3 END OF DFSORT   


Please help in this regards.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Feb 01, 2006 1:30 am
Reply with quote

I think this statement:
Code:

15:3C'33D',

is the problem and should be changed to:
Code:

15:C'33D',
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Feb 01, 2006 2:28 am
Reply with quote

Mane,

Superk is right.

In both OUTFIL OUTREC operands, you have:

Code:

  15:3C'33D',                               
  18:1,6,     


Since 3C'33D' gives you 9 characters, it overlaps the next column you specified (18:). C'33D' will only give you three characters, so it won't overlap the next column.

Given that all of your fields are one after the other, you might want to just drop the column numbers (c:) and let DFSORT figure them out automatically.
Back to top
View user's profile Send private message
Mane Sagar

New User


Joined: 12 Jul 2005
Posts: 41
Location: mumbai

PostPosted: Wed Feb 01, 2006 1:41 pm
Reply with quote

Hi,

Thanks a lot Superk and Frank,

I have done the changes and it has worked fine.
Frank can you please ellaborate your last statement on DFSORT.

'Given that all of your fields are one after the other, you might want to just drop the column numbers (cicon_smile.gif and let DFSORT figure them out automatically'

Does it mean that, if I dnt specify the position in the output file DFSORT will calculate on its own.
Can you also give me the syntax.

Please let me know if I am wrong.

Regds,
Sagar Mane.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Feb 01, 2006 9:38 pm
Reply with quote

When you reformat records, DFSORT automatically puts each item right after the previous item unless you use c: to tell it not to. So if you used:

Code:

    OUTREC=(19,5,                                                     
           24,9,                                                     
           C'33D',                                                 
           1,6,                                                     
           42,11)   


You would get the same result as if you used:

Code:

    OUTREC=(01:19,5,                                                     
           06:24,9,                                                     
           15:C'33D',                                                 
           18:1,6,                                                     
           24:42,11)   


You can use c: whenever you like, but you really only need it if you are skipping bytes, e.g.

Code:

    OUTREC=(19,5,                                                     
           10:24,9)         


Without the 10:, the second field would start in position 6. With the 10:, it starts in position 10 and blanks are filled in from position 6 to 9.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top