MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ICETOOL to convert VB file to FB

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Tue Oct 25, 2016 7:15 am    Post subject: ICETOOL to convert VB file to FB Reply with quote

For various in-house reasons, I have to use ICETOOL rather than DFSORT.
My input file file is VB 1000, my output one should be FB 1000. The input file is already sorted so that doesn't need to be done.
The "real" data from the input file is in position 37 onwards (pos 37 is the offset including the RDW). I need to insert some hard-coded text on each output record.

This is what I've got so far using DFSORT
Code:

OPTION COPY                                                     
OUTFIL FNAMES=SORTOUT,                                         
VTOF,                          $ CONVERT VB TO FB               
OUTREC=(1:C'10M23+00300',   $ 1: TAG BORT RDW, KOLLA MANUAL     
 37,8,C'  ',     $ GRAB FROM POS 37 8 CHARS, THEN 2 BLANKS     
 45,955,1000:X), $ GRAB FROM POS 45, 955 POS FORWARD, 1000:X ???
 VLFILL=C' '                                                   


What I would like to do with the above is the following:-
a) convert this to ICETOOL instead
b) include a date record as the first output record, preferably (if possible) including the actual hard-coded record within the ICETOOL commands.

Is this doable?
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Tue Oct 25, 2016 9:35 am    Post subject: Reply with quote

misi01,

it is quite simple.

Code:

PGM=SORT                         PGM=ICETOOL TOOLIN
=============                    ======================
OPTION COPY            =          COPY FROM(indd) TO(OUT) USING(CTLx)
SORT FIELDS=(..)       =          SORT FROM(indd) TO(OUT) USING(CTLx)

outrec/inrec/outfil    =          Code them in CTLxCNTL dd


We recommend that SORTCNTL, SORTIN, SORTOUT, SORTINnn, and xxxxINnn (where xxxx is specified in a USING operand) should not be used as ddnames in ICETOOL operators nor supplied as DD statements.

misi01 wrote:

b) include a date record as the first output record, preferably (if possible) including the actual hard-coded record within the ICETOOL commands.


Use HEADER1 with &Date to get the current date in MM/DD/YY format. If you need another format then look up &DATE=(abcd) in the application programming guide.

So based on your control cards, here is a Untested ICETOOL job that will give you the desired results.

Code:

//STEP0100 EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN       DD DISP=SHR,DSN=Your Input FB LRECL 1000 byte file
//OUT      DD SYSOUT=*                                                 
//TOOLIN   DD *                                                       
  COPY FROM(IN) TO(OUT) USING(CTL1)                                   
//*
//CTL1CNTL DD *
  OUTFIL VTOF,                  $ CONVERT VB TO FB
  REMOVECC,                     $ NO CARRIAGE CONTROL         
  HEADER1=(&DATE),              $ CURR DATE AS MM/DD/YY           
  BUILD=(C'10M23+00300',        $ KOLLA MANUAL     
          37,8,                 $ GRAB FROM POS 37 8 CHARS
          2X,                   $ 2 BLANKS     
          45,955,               $ GRAB FROM POS 45, 955 POS
          1000:X)               $ Pad spaces upto 1000 Bytes

//*

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Tue Oct 25, 2016 12:23 pm    Post subject: As usual, thank you. Reply with quote

I'm assuming I can create a header record (not at work to experiment) along these lines ?

Code:

//CTL1CNTL DD *
  OUTFIL VTOF,                  $ CONVERT VB TO FB
  REMOVECC,                     $ NO CARRIAGE CONTROL         
  HEADER1=(C'01followed by hard-coded string of my choosing'),
  BUILD=(C'10M23+00300',        $ KOLLA MANUAL     
          37,8,                 $ GRAB FROM POS 37 8 CHARS
          2X,                   $ 2 BLANKS     
          45,955,               $ GRAB FROM POS 45, 955 POS
          1000:X)               $ Pad spaces upto 1000 Bytes

//*


Edit : found an example that answers my question by googling
Quote:

icetool header1

_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group