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

Converting Variable block file to Fixed block file


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

New User


Joined: 07 Dec 2016
Posts: 7
Location: India

PostPosted: Tue May 16, 2017 2:20 pm
Reply with quote

Hi,

Iam trying to convert Variable block file(Record length-32750) to Fixed block file(Record length=80).I used the following Build statement,

//SYSIN DD *
OPTION COPY
OUTFIL VTOF,BUILD=(5,80,/,85,80,/,165,80,/,245,80,/,325,80,/,
405,80,/,485,80,/,565,80,/,645,80,/,725,80,/,805,80,/,885,80,/,
965,80,/,1045,80,/,1125,80,/,1205,80,/,1285,80,/,1365,80,/,
.
.
.
.
32645,80,/,32725,25) .The build statement I mentioned here is working fine,but as each time the position upto which data exists in input VB file differs, during VB to FB conversion,the positions which are not having data are getting copied as spaces into output FB file.Please suggest me a way to get rid of spaces.Iam using ICEMAN for this.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 310
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue May 16, 2017 2:27 pm
Reply with quote

Quote:
Please suggest me a way to get rid of spaces.

What do you mean by getting rid of spaces. What do you expect? Did you mean that the next record should start immediately after the data part of previous record ends?

You need to explain more clearly and if possible post a sample input and expected output.
Back to top
View user's profile Send private message
bhavana yalavarthi

New User


Joined: 07 Dec 2016
Posts: 7
Location: India

PostPosted: Tue May 16, 2017 2:29 pm
Reply with quote

I mean whatever data is available in input VB file,that data should get copied to output FB file ,as spaces are getting populated into output file when the data is not there in input file.
Back to top
View user's profile Send private message
bhavana yalavarthi

New User


Joined: 07 Dec 2016
Posts: 7
Location: India

PostPosted: Tue May 16, 2017 2:33 pm
Reply with quote

Sample I/p having 32750 RECL.

Code:
ISA*00*          *00*          *01*032893096    *16*054481205NPCT*150721*0814*U*00200*856000595*0*T*.GS*SH*1414008NPCC*054481205*150721*0814*10068078*X*0030REF*LS*S3002522.CTT*2.SE*16*0001.GE*1*10068078.IEA*1*856000595.


Like this VB file comes in single record having 32750 RECL.I want to split this one record into 80 RECL FB file each having 80 byte records.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue May 16, 2017 5:25 pm
Reply with quote

You could give the DFSORT 'RESIZE' a try. And then make sure you get rid of the 'blank' records.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2567
Location: NYC,USA

PostPosted: Tue May 16, 2017 8:30 pm
Reply with quote

ibmmainframes.com/about62609.html
Back to top
View user's profile Send private message
bhavana yalavarthi

New User


Joined: 07 Dec 2016
Posts: 7
Location: India

PostPosted: Wed May 17, 2017 3:35 pm
Reply with quote

The link you have suggested is in case of FB file. Can you please tell me whether I can use the same RESIZE option during VB to FB conversion!I want to split the 32750 byte I/p VB record to 80 byte FB records.I mean first 80 columns data in 1st record,next 80 columns data in 2nd record...If data is not present upto 32750 RECL,that empty data should not be populated as spaces in the resultant FB file.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2448
Location: Hampshire, UK

PostPosted: Wed May 17, 2017 5:50 pm
Reply with quote

If you had read the entire topic you would have found that it actually related to VB data set (NOTE: DATA SET not 'file').
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2567
Location: NYC,USA

PostPosted: Wed May 17, 2017 10:22 pm
Reply with quote

So basically you don't want to put time and efforts to learn yourself, your choice.
Feed this card to your input data and let us know.
Code:
//JS040   EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN       DD DSN=Input file VB-32750
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)   
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)   
//T3 DD SYSOUT=*                                             
//TOOLIN   DD *                                               
   COPY FROM(IN) USING(CTL1)                                 
   RESIZE FROM(T1) TO(T2) TOLEN(80)                           
   COPY FROM(T2) USING(CTL2)                                 
//CTL1CNTL DD *                                               
   OUTFIL FNAMES=(T1),VTOF,BUILD=(5,32746)                     
//CTL2CNTL DD *                                               
   OUTFIL FNAMES=(T3),INCLUDE=(1,1,CH,NE,C' ')   

May be someone can suggest you a better way as there always is.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri May 19, 2017 6:28 pm
Reply with quote

Rohit Umarjikar,

The idea should be to OMIT entire-blank-records, instead of just checking the first character, or else you might end up losing data records that could possibly have a blank only at position-1, but have data at other positions.

You don't really need the second COPY (plug it into the RESIZE...USING).
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2567
Location: NYC,USA

PostPosted: Fri May 19, 2017 10:23 pm
Reply with quote

Right Arun Raj, it was test data I tested with and did not change the include with TS stuff.
Code:
//JS040   EXEC PGM=ICETOOL                                 
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN       DD DSN=RXxxxxx.TEST.VB,DISP=SHR                 
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD SYSOUT=*                                           
//TOOLIN   DD *                                           
   COPY FROM(IN) USING(CTL1)                               
   RESIZE FROM(T1) TO(T2) TOLEN(80) USING(CTL2)             
//CTL1CNTL DD *                                           
   OUTFIL FNAMES=(T1),VTOF,BUILD=(5,32746)                 
//CTL2CNTL DD *                                           
   OUTFIL FNAMES=(T2),INCLUDE=(1,80,CH,NE,C' ')

Edited to fix typo.
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 Converting a file from PD to display ... SYNCSORT 4
No new posts Record count of RECFM=U tape file DFSORT/ICETOOL 17
This topic is locked: you cannot edit posts or make replies. Write Character to Hexadecimal file w... COBOL Programming 8
No new posts Checking the total counts inside a re... JCL & VSAM 5
No new posts File-aid batch how to repeat a line... Compuware & Other Tools 2
Search our Forums:

Back to Top