MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting System date and time as 2 records using sort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
deepatred
Beginner


Joined: 29 Nov 2005
Posts: 19
Topics: 6

PostPosted: Tue Nov 29, 2005 10:26 pm    Post subject: Getting System date and time as 2 records using sort Reply with quote

Hi,

I am new to Mainframe, i have a doubt...

In the sort step there is no input file, in my sort output i want system date in one line and system time in second line.

How can line no. be advanced in sort parm?

Thanks,

Deepa
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Wed Nov 30, 2005 4:42 am    Post subject: Reply with quote

deepatred,

Yes, you can do this easily with sort.

Try this code
Code:

//R010   EXEC  PGM=SORT                             
//SORTIN  DD *         
//SORTOUT DD SYSOUT=*                               
//SYSOUT  DD SYSOUT=*                               
//SYSIN   DD *                                     
  SORT FIELDS=COPY                                 
  OUTFIL HEADER1=(DATE,/,
                  TIME,80:X),REMOVECC   
/*                                                 


Let me know if this satisfies your requirement.

Thanks,
Phantom
Back to top
View user's profile Send private message
deepatred
Beginner


Joined: 29 Nov 2005
Posts: 19
Topics: 6

PostPosted: Fri Dec 02, 2005 12:59 am    Post subject: Reply with quote

Phantom,

Thanks, it satisfies my requirement. but can u tell me if there is any special significance of parameter 80:X, it made no difference when i did not keep that.

Deepa
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri Dec 02, 2005 1:30 am    Post subject: Reply with quote

Deepatred,

What Sort product (DFSORT / SYNCSORT) are you using ? - The first line in your SORT sysout will have the Product name and version.

80:X (in general nnnn:X) is used to fill empty spaces (blanks) till column 80 (or nnnn) from the current position. If you omit this parameter and if you do not provide DCB-LRECL in JCL, your output file length is ends after the last field that you provide in INREC/OUTREC/OUTFIL OUTREC/HEADER/TRAILER statements.

Try this code to see the difference
Code:

//R010   EXEC  PGM=SORT                             
//SORTIN  DD *         
//SORTOUT DD DSN=your.output.file,
//         DISP=(NEW,CATLG,DELETE),
//         UNIT=SYSDA,
//         SPACE=(TRK,(1,1),RLSE)
//SYSOUT  DD SYSOUT=*                               
//SYSIN   DD *                                     
  SORT FIELDS=COPY                                 
  OUTFIL HEADER1=(DATE,/,
                  TIME),REMOVECC   
/*         


PS: The JCL shown above does not contain a DCB parameter for SORTOUT. Do not make any changes to the JCL. Try running the JCL and see the LRECL of OUTPUT file and try with 80:X and see the difference.

Please let me know if you need more information,

Thanks,
Phantom
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Dec 02, 2005 11:39 am    Post subject: Reply with quote

Actually, the 80:X doesn't do anything in this case. The output record length is set from the length of the data records, NOT from the length of the HEADER records. In this case, the length of the data records is 80 = the length of the input records.

80:X would be necessary if an OUTREC parameter created shorter records and you wanted them padded out with blanks to 80 bytes, e.g.

Code:

  OUTFIL OUTREC=(1,20,80:X)


Noet that if a HEADER record is longer than the data record, DFSORT terminates, e.g.

Code:

   OUTFIL OUTREC=(1,20,80:X),
     HEADER1=(90C'A'),REMOVECC


ICE230A 0 90 BYTE HEADER/TRAILER RECORD EXCEEDS 80 BYTE LRECL FOR SORTOUT

The way to fix this is to make the data records as long as the header records, e.g.

Code:

   OUTFIL OUTREC=(1,20,90:X),
     HEADER1=(90C'A'),REMOVECC

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group