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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am


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