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 

Can I write records into SORTOUT when the SORTIN is DUMMY

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


Joined: 24 Aug 2005
Posts: 32
Topics: 14
Location: Hyderabad

PostPosted: Fri Oct 27, 2006 5:44 am    Post subject: Can I write records into SORTOUT when the SORTIN is DUMMY Reply with quote

Hi All,

I have a doubt like, is there any way to write a record into SORTOUT while SORTIN is DUMMY. I tried to write the current date by using the &DATE1 function in OUTREC but as the SORTIN is itself DUMMY no record is being written to the ouput file, does anybody know how to acheive this using SORT?????

Regards,
Sharada.
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Fri Oct 27, 2006 5:49 am    Post subject: Reply with quote

Sharada,

Please try this code from previuos posts.

If you just want one record with the date in C'yyyymmdd' format, you can use this DFSORT job:

Code:
Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
//SORTOUT DD DSN=...  output record with date
//SYSIN   DD *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    TRAILER1=(DATENS=(4MD))
/*

_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
sharada
Beginner


Joined: 24 Aug 2005
Posts: 32
Topics: 14
Location: Hyderabad

PostPosted: Fri Oct 27, 2006 6:23 am    Post subject: Reply with quote

Thanks a lot.
Back to top
View user's profile Send private message
rama krishna reddy
Beginner


Joined: 18 Sep 2006
Posts: 31
Topics: 13
Location: Hyderabad

PostPosted: Wed Nov 29, 2006 4:32 am    Post subject: Reply with quote

Please refer below sort card to write the current date to a file
Code:

//STEP0010 EXEC PGM=SORT                                         
//SYSOUT   DD  SYSOUT=*                                           
//SORTIN   DD  DSN=C8USP.C8MPM710.C8713.T.R36DSPDT(+0),DISP=SHR   
//*            DISP=OLD                                           
//SORTOUT  DD  DSN=C8USP.C8SEM000.DATE,                           
//             DISP=(NEW,CATLG,DELETE),                           
//             RECFM=FB,                                         
//             LRECL=80                                           
//*            BLKSIZE=800                                       
//SYSIN    DD  *                                                 
 SORT FIELDS=COPY,STOPAFT=1                                       
 OUTREC FIELDS=(C'20&:EYEMED.')                                   
/*
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Nov 29, 2006 6:12 am    Post subject: Reply with quote

rama krishna reddy,

Please read the question carefully once again. Your JCL will work if there is atleast 1 record in the file whereas the poster wanted a record in the output even when the file is empty. And secondly that sort card does NOT write the current date to the output file.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
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