Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Jcl - file split and add a new field to each file
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

Moderator Team Head


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

PostPosted: Wed Feb 01, 2006 1:30 am    Post subject: Re: Jcl - file split and add a new field to each file
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 Moderator


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

PostPosted: Wed Feb 01, 2006 2:28 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Wed Feb 01, 2006 9:38 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 0 Tue Jan 17, 2017 4:26 pm
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us