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

Utility to convert variable length to fixed length file.


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

New User


Joined: 17 Mar 2006
Posts: 26

PostPosted: Wed May 17, 2006 3:34 pm
Reply with quote

Is there any utility pgm to convert a variable length file to a fixed file ..
eg :

Code:

Input File (Fileds with Variable Length):
 
Empid;Name;Salary
324;Ram;23525
554;Shyam;1312333
2523454;kumar;2843



Code:

Output File (Fileds with Fixed Length):
 
Empid                   Name                Salary
324                     Ram                  23525
554                     Shyam              1312333
2523454                 kumar                 2843


_______________________________________________________________________
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Wed May 17, 2006 4:33 pm
Reply with quote

Hi,
Please find the job to convert from variable to fixed length file

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=A123456.VBIN,DISP=SHR
//FBOUT DD DSN=A123456.FBOUT,DISP=(NEW,CATLG,DELETE),
// UNIT=3390,SPACE=(CYL,(5,5))
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=FBOUT,VTOF,OUTREC=(1:5,100)
* VTOF CONVERT FB TO VB
* 1:5,100 COPY FROM 5 BYETS(BECAUSE IN VB FIRST 4 BYTES ARE *OCCUPIED BY RDW SO STARTING POSITION WILL BE 5
 /*


Regards
jai
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 May 17, 2006 8:27 pm
Reply with quote

ramp_senti,

I think jai misunderstood what you wanted. I think you have an FB data set with delimited fields and you want to reformat it to an FB data set with fixed fields.

The DFSORT job below will do what you asked for. I assumed the maximum length of each variable field was 10 bytes, but you can change the FIXLEN=n values for the actual maximums if needed.

You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's PARSE, %nn and JFY functions. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

Use [URL] BBCode for External Links

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB)
//SORTOUT DD DSN=...  output file (FB)
//SYSIN    DD    *
  OPTION COPY
  INREC PARSE=(%00=(ENDBEFR=C';',FIXLEN=10),
               %01=(ENDBEFR=C';',FIXLEN=10),
               %02=(FIXLEN=10)),
        BUILD=(1:%00,25:%01,41:%02,JFY=(SHIFT=RIGHT))
/*
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 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
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
Search our Forums:

Back to Top