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

How to write two records to the same output DD using DFSORT


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

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Sat Oct 06, 2007 1:37 am
Reply with quote

I have a job step that reads a single variable record and writes out a reformatted fixed record.

Code:

//S6SORT EXEC PGM=DFSORT                                             
//SORTIN   DD  DISP=SHR,DSN=Variable.input.file             
//SORTOUT  DD  DSN=Fixed output.file,                           
//             UNIT=SYSDA,DISP=(NEW,CATLG),                         
//             RECFM=FB,LRECL=80,BLKSIZE=27920,                     
//             SPACE=(TRK,(60,15),RLSE)                             
//SYSOUT   DD SYSOUT=*                                               
//SYSIN    DD *                                                     
 OPTION NOVLSCMP,VLSHRT                                             
 SORT FIELDS=COPY                                                   
 INCLUDE COND=((5,4,CH,EQ,C'0500'),AND,                             
             (257,8,CH,NE,C'$IOA    '),AND,                         
             (257,8,CH,NE,C'TCICSTRN'))                             
 OUTFIL OUTREC=(1:C'DATASET  ',10:10,44,54:1C' ',55:1C' *UACC* ',
    55:1C' *UACC* ',63:1C' A ',66:133,8,74:7C' '),CONVERT
/*       


The above JCL runs fine.

I would like to know how to read a single variable input record and write two fixed output records to the same SORTOUT file. The 1st fixed output record is the OUTREC= record define above and the 2nd fixed output record should look like:

Code:

 OUTFIL OUTREC=((1:C'DATASET  ',10:10,44,54:1C' ',       
    55:1C' *LPAR* ',63:1C'   ABCFLNRTUW',74:7C' '),CONVERT


Is this possible in DFSORT?
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: Sat Oct 06, 2007 2:04 am
Reply with quote

You can replace your OUTFIL statement with this one (I corrected a few syntax errors):

Code:

  OUTFIL CONVERT,                                               
    BUILD=(1:C'DATASET  ',10:10,44,54:1C' ',55:1C' *UACC* ',   
      63:1C' A ',66:133,8,74:7C' ',/,                           
    1:C'DATASET  ',10:10,44,54:1C' ',                           
     55:1C' *LPAR* ',63:1C'   ABCFLNRTUW',76:5C' ')             


The / says to start a new record.
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Sat Oct 06, 2007 2:12 am
Reply with quote

Outstanding Frank!!!

Worked like a charm.

I searched for BUILD= in the PDF for the DFSORT Application Programming Guide and didn't get a hit, so maybe I have an outdated manual.

Have a great weekend.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sat Oct 06, 2007 2:25 am
Reply with quote

Frank Yaeger wrote:
The / says to start a new record.
Neat, I was thinking it was only good in trailer type print functions..... icon_lol.gif
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: Sat Oct 06, 2007 3:06 am
Reply with quote

Quote:
I searched for BUILD= in the PDF for the DFSORT Application Programming Guide and didn't get a hit, so maybe I have an outdated manual.


Yes, you must. You can always access all of the latest DFSORT books online from:

Use [URL] BBCode for External Links
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 TRIM everything from input, output co... DFSORT/ICETOOL 0
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top