Can DFSORT generate a record from nothing?



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Can DFSORT generate a record from nothing?

Postby Ed Goodman » Wed Jun 15, 2011 11:49 pm

I have a perfect OUTREC coded which makes a date card for me. It's a single line of output, 80 bytes.

For now, I have a parm member as the SORTIN. That input member currently has one line in it, something like "SORT FIELDS=COPY".

I feel a little exposed about putting this into prod, because someone might change that parm card to have more than one line. I'll protect myself from that with a "stopaft" option, but then I thought that someone might DELETE that parm.

So I'm wondering if there is a graceful way to have a dummy file in, but get a single record out.
Ed Goodman
 
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: Can DFSORT generate a record from nothing?

Postby Frank Yaeger » Thu Jun 16, 2011 1:01 am

Yes, you can use TRAILER1 to do that. For example:

//S1 EXEC PGM=SORT                         
//SYSOUT DD SYSOUT=*                       
//SORTIN DD DUMMY,RECFM=FB,LRECL=80         
//SORTOUT DD DSN=...  output file  (FB/80)                 
//SYSIN DD *                               
  OPTION COPY                               
  OUTFIL REMOVECC,NODETAIL,                 
    TRAILER1=(DATE=(4MD/))                 
/*


If you need more specific help, tell me the RECFM and LRECL you want for your output file, and what exactly you want in the output record.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Can DFSORT generate a record from nothing?

Postby Ed Goodman » Thu Jun 16, 2011 1:27 am

Of course... much more elegant.
Here's what I ended up with after changing my DATE1 and TIME2 variables from the OUTFIL into DATENS and TIMENS:
  SORT FIELDS=COPY                                                   
  OUTFIL REMOVECC,NODETAIL,                                           
     TRAILER1=(02:C'INCLUDE COND=(1,4,BI,GT,',DATENS=(4MD),C',OR,',/,
                16:C'1,4,BI,EQ,',DATENS=(4MD),C',AND,',/,           
                16:C'5,4,BI,GT,',TIMENS=(24),C'00)',/,               
                02:C'SORT FIELDS=COPY',80:X)                         


Which gives the desired output of:
  INCLUDE COND=(1,4,BI,GT,20110615,OR,       
               1,4,BI,EQ,20110615,AND,     
               5,4,BI,GT,15525800)         
  SORT FIELDS=COPY                           

Good to talk to you again Frank.
Ed Goodman
 
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: Can DFSORT generate a record from nothing?

Postby Frank Yaeger » Thu Jun 16, 2011 2:18 am

Ed,

I'm glad I could help. BTW, the 80:X in TRAILER1 has no effect. The length is taken from BUILD, or from SORTIN if there's no BUILD, not from TRAILER1.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post