Get only date from SORT and SORTIN as DD Dummy?

SyncSort's Sort Product, SyncTool for z/OS, SYNCINIT and SYNCLIST.
Post Reply
RyanFox
Registered Member
Posts: 52
Joined: Sat Jun 15, 2013 12:54 pm

Get only date from SORT and SORTIN as DD Dummy?

Post 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?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1885
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

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

Post 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.
User avatar
Anuj Dhawan
Founder
Posts: 2799
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

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

Post 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.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
RyanFox
Registered Member
Posts: 52
Joined: Sat Jun 15, 2013 12:54 pm

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

Post by RyanFox »

Thanks Robert and Anuj.

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

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “SyncSort, SyncTool, SyncGener.”