Page 1 of 1

Get only date from SORT and SORTIN as DD Dummy?

Posted: Tue Aug 13, 2013 6:31 pm
by RyanFox
Hi,

I need to create one line file with system date and time. I tried using some HEADER1 parameters to get this, but when I execute the JOB, SORT JOB fails saying:

Code: Select all

SORTIN   DCB RECFM REQUIRED
why a DUMMY needs DCB?

The Job I used is:

Code: Select all

//S1       EXEC  PGM=ICEMAN                
//SYSOUT   DD  SYSOUT=*                    
//SORTIN   DD DUMMY                        
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD    *                         
  OPTION COPY                              
  HEADER1=(DATE)                      
/*                                         
I need to get the system date every day, is there a way out to achieve this without using any real SORTIN file?

Re: Get only date from SORT and SORTIN as DD Dummy?

Posted: Tue Aug 13, 2013 6:38 pm
by Robert Sample
For every file, even DUMMY, the DCB must be known to the system since otherwise the system cannot open the file (even a DUMMY file is opened to find out there are no records in it).

If your site runs CA-7 or another job scheduler, they usually have date manipulation processes set up. For CA-7, check the chapter on CADRIVER in the CA-7 Interfaces manual. Also, most sites that have been around awhile have a date program on site; you might want to ask more experienced people at your site about what is available there.

Re: Get only date from SORT and SORTIN as DD Dummy?

Posted: Wed Aug 14, 2013 10:04 am
by Anuj Dhawan
The DUMMY parameter specifies that no device is to be allocated to this DD statement and that no disposition processing or I/O is to be done. All other JCL parameters on a DUMMY DD statement have to be syntactically correct. As Robert said otherwise system won't be able to understand what to do with this data-set.

For a SORT solution, you can use the below Job to get the System Date:

Code: Select all

//STEP01   EXEC PGM=ICEMAN                       
//SYSOUT   DD   SYSOUT=*                         
//SORTIN   DD   DUMMY,RECFM=FB,LRECL=80,BLKSIZE=0
//SORTOUT  DD   SYSOUT=*                         
//SYSIN    DD    *                               
  OPTION COPY                                    
  OUTFIL REMOVECC,NODETAIL,HEADER1=(DATE)        
/*                                               
Another alternate to get what you're looking forward to is:

Code: Select all

//STEP01   EXEC  PGM=ICEMAN 
//SYSOUT   DD  SYSOUT=*     
//SORTIN   DD *             
DUMMY                       
/*                          
//SORTOUT  DD SYSOUT=*      
//SYSIN    DD    *          
  OPTION COPY               
  OUTREC FIELDS=(DATE)      
/*                          
Hope this helps.

Re: Get only date from SORT and SORTIN as DD Dummy?

Posted: Sat Sep 07, 2013 10:58 am
by RyanFox
Thanks Robert and Anuj.

This really helped me and sorry for a late reply...