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

Combining, convert of FB to VB and specifying OUTREC on FB


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

New User


Joined: 08 Jun 2006
Posts: 45
Location: Trumbull, CT

PostPosted: Wed May 16, 2007 4:54 pm
Reply with quote

Hi All,

I have a VB file with LRECL=300. The minimum record length in the dataset is 46. I need to filter on the condition in the dataset at 13th position to be '030'. And on these records I need this specific OUTREC. OUTREC FIELDS=(1,12,36,16). I need my output file to be in FB format.

For getting my above work done i have used two sort steps.
Step 1. For converting the 300 length VB file to 304 length FB file by
Code:
 SORT FIELDS=COPY                                     
  OUTFIL FNAMES=SORTOUT1,VTOF,                         
  OUTREC=(1:1,304)                                     
  END                           


Step 2. For getting my output in needed format.

Code:
SORT FIELDS=(40,16,CH,A,5,12,CH,A)                   
    SUM FIELDS=NONE                                     
    INCLUDE COND=(17,3,BI,EQ,X'F0F3F0')                 
    OUTREC FIELDS=(5,12,40,16)


So I am using two sort steps(one for converting VB to FB & other for getting the desired output in FB) for a single work. I believe we can do this in one single sort step or ICETOOL step.

I searched through the forum but not able to find a solution.

Can anyone help me out?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed May 16, 2007 5:02 pm
Reply with quote

Why not use the VTOF in the second sort and do not process the first sort.

I don't have MF access today, so can not get to my library with the correct code in. I will try to later.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed May 16, 2007 9:02 pm
Reply with quote

kaleelahamed,

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB/300)
//SORTOUT1 DD DSN=...  output file (FB/28)
//SYSIN    DD    *
    OPTION VLSHRT
    INCLUDE COND=(17,3,CH,EQ,C'030')
    SORT FIELDS=(40,16,CH,A,5,12,CH,A)
    SUM FIELDS=NONE
    OUTFIL FNAMES=SORTOUT1,VTOF,
      BUILD=(5,12,40,16)
/*
Back to top
View user's profile Send private message
kaleelahamed

New User


Joined: 08 Jun 2006
Posts: 45
Location: Trumbull, CT

PostPosted: Thu May 17, 2007 12:59 pm
Reply with quote

Thanks for the code..Its working fine.

Can ICETOOL do this job?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu May 17, 2007 7:55 pm
Reply with quote

Yes, you can do the same thing with DFSORT's ICETOOL rather than with DFSORT directly like this:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (VB/300)
//SORTOUT1 DD DSN=...  output file (FB/28)
//TOOLIN   DD    *
SORT FROM(IN) TO(SORTOUT1) USING(CTL1)
//CTL1CNTL DD *
    OPTION VLSHRT
    INCLUDE COND=(17,3,CH,EQ,C'030')
    SORT FIELDS=(40,16,CH,A,5,12,CH,A)
    SUM FIELDS=NONE
    OUTFIL FNAMES=SORTOUT1,VTOF,
      BUILD=(5,12,40,16)
/*
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 Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top