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
 

 

Utility to convert variable length to fixed length file.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Utility to convert variable length to fixed length file.
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    Post subject:
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 Moderator


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

PostPosted: Wed May 17, 2006 8:27 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

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    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 5 Tue Jan 17, 2017 4:26 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 TAPE VERIFY utility?? MrExtraordinare JCL & VSAM 3 Fri Dec 09, 2016 10:57 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
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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