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

Reconstructing records with ICETOOL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Thu Mar 25, 2010 7:32 pm
Reply with quote

Hello Guys ,

I have a Variable block , RL (31) input file , this contains 4 fields extracted from some database.All fields are seperated with :

For example please have a look of the given below input file :-

TEST and TEST X are under one field.

Code:
****** ****************************
000001  TEST  :TEST X:TEST3  :RRRR
000002  TEST X:TEST6 :TEST7  :RRTT
****** ****************************


I want to 1) insert fixed header & trailer, 2) remove all leading trailing spaces from the fields and 3)in between spaces should be replaced with a %20 .So the output file (FB , RL=26) will look like this .
Code:

000001 HEADER                 
000002 TEST:TEST%20X:TEST3:RRRR
000003 TEST%20X:TEST6:TEST7:RRTT
000004 TRAILER   


I have used ICETOOL to acheive this but it is failing . Given below is the job and errror detail.



Code:
//XSR0002  EXEC PGM=ICEMAN                                       
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD DSN=INPUT.FILE(VB31)       
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                   
  OPTION COPY,VLSCMP                                             
  OUTFIL VTOF,REMOVECC,                                           
  HEADER1=('HEADER'),                                             
  TRAILER1=('TRAILER')                                           
  INREC IFOUTLEN=40,                                             
   IFTHEN=(WHEN=INIT,                                             
     BUILD=(1,4,5,26,JFY=(SHIFT=RIGHT,TRAIL=C':',LENGTH=27))),   
   IFTHEN=(WHEN=INIT,                                             
     PARSE=(%01=(ENDBEFR=C':',FIXLEN=10),                         
            %02=(ENDBEFR=C':',FIXLEN=10),                         
            %03=(ENDBEFR=C':',FIXLEN=10),                         
            %04=(ENDBEFR=C':',FIXLEN=10))),                       
  IFTHEN=(WHEN=INIT,BUILD=(1,4,5,26,SQZ=(SHIFT=LEFT,MID=C'%20')))
//*                                                               


AND THE ERROR IS
Code:
ICE201I F RECORD TYPE IS V - DATA STARTS IN POSITION 5                         
ICE150I 0 VLSHRT NOT USED FOR SORT, MERGE, INCLUDE, OMIT OR SUM STATEMENT FIELDS
ICE126A 9 INCONSISTENT REFORMATTING FOR SORTOUT : REASON CODE 05, IFTHEN 0     
ICE751I 0 C5-K90014 C6-K90014 C7-K45047 C8-K42136 E9-K40168 E7-K44564           
ICE052I 3 END OF DFSORT                                                         


Please let me know if i am not clear
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: Fri Mar 26, 2010 5:06 am
Reply with quote

The error message is telling you that you have VTOF without BUILD, which is not allowed.

But your control statements as written will NOT give you what you want anyway. Here's a DFSORT job that will:

Code:

//XSR0002  EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=INPUT.FILE(VB31),DISP=SHR    (VB/31)
//SORTOUT  DD SYSOUT=*                         (FB/26)
//SYSIN    DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
    BUILD=(1,4,5:5,7,SQZ=(SHIFT=LEFT,TRAIL=C':',MID=C'%20',
      LENGTH=10),
   15:13,6,SQZ=(SHIFT=LEFT,TRAIL=C':',MID=C'%20',LENGTH=10),
   25:20,7,SQZ=(SHIFT=LEFT,TRAIL=C':',MID=C'%20',LENGTH=10),
   35:28,4,SQZ=(SHIFT=LEFT,MID=C'%20',LENGTH=10))),
  IFTHEN=(WHEN=INIT,BUILD=(1,4,5,40,SQZ=(SHIFT=LEFT)))
  OUTFIL VTOF,REMOVECC,
    BUILD=(5,26),
    HEADER1=('HEADER'),
    TRAILER1=('TRAILER')
/*


Quote:
I have used ICETOOL to acheive this


Actually, you're using DFSORT, not ICETOOL. PGM=ICEMAN or PGM=SORT invokes DFSORT. PGM=ICETOOL invokes DFSORT's ICETOOL.
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Tue Mar 30, 2010 6:09 pm
Reply with quote

This is working .

Thanks Frank
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Format data from multiple records usi... SYNCSORT 4
No new posts Sort SMF records? SYNCSORT 6
No new posts To Sort detail records in a file with... SYNCSORT 5
No new posts Identify and write records containing... SYNCSORT 11
No new posts Filter records where condition is in ... SYNCSORT 6
Search our Forums:


Back to Top