Page 2 of 2

Re: How to Write Fixed length file as Variable Length file?

PostPosted: Fri Aug 19, 2011 12:43 am
by Alissa Margulies
Here is an example that should help you achieve the desired output:

//STEP1 EXEC PGM=SORT                       
//SYSOUT  DD SYSOUT=*                       
//SORTOUT DD SYSOUT=*                       
//SORTIN  DD *                               
4917 WWW BBBBB LN           AAA  AAAAA  AAAA
15575 SSSSS HHYR            BBB BBBB BBBB   
6357 OOOO OOOO OO           CCC CCC CCC     
16 COOOOO SSSSSS            SDSDSD SDSDSD   
1523 45TH ST                GHGHG   GHGG     
//SYSIN   DD *                               
  SORT FIELDS=COPY                           
  OUTFIL BUILD=(1,28,JFY=(VL),C'|',         
                29,20,JFY=(VL),C'|',         
                21,8,JFY=(VL),C'|'),FTOV     
/*

This is the output produced from the above sort step:
4917 WWW BBBBB LN|AAA  AAAAA  AAAA||
15575 SSSSS HHYR|BBB BBBB BBBB||   
6357 OOOO OOOO OO|CCC CCC CCC||     
16 COOOOO SSSSSS|SDSDSD SDSDSD||   
1523 45TH ST|GHGHG   GHGG||         

Re: How to Write Fixed length file as Variable Length file?

PostPosted: Tue Aug 23, 2011 11:42 am
by pjagathis
Hi Alissa,

Thanks..

But both my input and output file are FB file.Your understanding is correct.

Below code does what I need when my output file is VB, But my both input and output file are FB file

Please help me...

Re: How to Write Fixed length file as Variable Length file?

PostPosted: Thu Aug 25, 2011 8:11 pm
by Alissa Margulies
Hello pjagathis.

The use of JFY=(VL) requires the output record to be variable-length. You can convert the file to FB in a successive copy step.

Regards,

Re: How to Write Fixed length file as Variable Length file?

PostPosted: Fri Aug 26, 2011 1:04 pm
by pjagathis
Hi Alissa,

ThanX...

Whether we can do it single step ?.. Is possible..

Since if we do it for multiple files, then this will increase the number of steps....

any other option which willl convert in single step?

Re: How to Write Fixed length file as Variable Length file?

PostPosted: Sat Aug 27, 2011 12:11 am
by dick scherrer
Hello,

Why do you care if this is one or multiple steps? The same amount of data will still be processed.

If you use multiple steps, it will probably be easier for people to understand.