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

Control statements to convert FBA to FB


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

Active User


Joined: 29 Oct 2010
Posts: 205
Location: Toronto, ON, Canada

PostPosted: Fri Dec 30, 2011 12:03 am
Reply with quote

I want to share the below sort control cards that can be used to convert a FBA dataset into FB. It shifts every line over 1 byte and inserts a blank line when it encounters a non-blank print control char. This makes the resulting dataset easy to import into another file (such as a Word document) and not waste space.
HINT: use the "Courier New" font and switch to Landscape with 0.5 inch margins to make the file fit.
Code:
 RECORD TYPE=F,LENGTH=(133,,132)                       
 SORT FIELDS=COPY                                     
** IF FIRST CHAR IS BLANK THEN COPY REMAINING RECORD   
** ALL OTHER RECORDS INSERT A BLANK LINE PRIOR         
 OUTFIL FILES=OUT,                                     
   IFTHEN=(WHEN=(1,1,CH,EQ,C' '),BUILD=(2,132)),       
*  IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),BUILD=(/,2,132)),     
*  IFTHEN=(WHEN=(1,1,CH,EQ,C'0'),BUILD=(/,2,132)),     
*  IFTHEN=(WHEN=(1,1,CH,EQ,C'-'),BUILD=(2/,2,132)),   
   IFTHEN=(WHEN=NONE,BUILD=(/,2,132))                 

NOTE: the lines begining with an asterisk are optional can be removed. Also the RECORD statement is not required but I put it there as an error check. If the input file record length was not 133 byte then DFSORT will fail.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Dec 30, 2011 1:07 am
Reply with quote

Jerryte,

Simply Code RECFM=FB on JCL and use the following control cards.

Code:

  SORT FIELDS=COPY
  INREC BUILD=(2,132)
//*
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Convert CSV to flat file. DFSORT/ICETOOL 6
No new posts convert arbitrary UTC to local (SYD) ... COBOL Programming 1
No new posts Dynamically build unload and load sta... DB2 14
No new posts Convert Service Unit to CPU Seconds All Other Mainframe Topics 1
No new posts CONVERT a given date from UTC TO BST CICS 0
Search our Forums:


Back to Top