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
 

 

Reconstructing records with ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Reconstructing records with ICETOOL
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 Moderator


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

PostPosted: Fri Mar 26, 2010 5:06 am    Post subject:
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    Post subject:
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    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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Group elements using ICETOOL Learncoholic DFSORT/ICETOOL 2 Fri Apr 14, 2017 11:01 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


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