View previous topic :: View next topic |
Author |
Message |
sharada Beginner
Joined: 24 Aug 2005 Posts: 32 Topics: 14 Location: Hyderabad
|
Posted: Fri Oct 27, 2006 5:44 am Post subject: Can I write records into SORTOUT when the SORTIN is DUMMY |
|
|
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 |
|
|
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Fri Oct 27, 2006 5:49 am Post subject: |
|
|
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 |
|
|
sharada Beginner
Joined: 24 Aug 2005 Posts: 32 Topics: 14 Location: Hyderabad
|
Posted: Fri Oct 27, 2006 6:23 am Post subject: |
|
|
Thanks a lot. |
|
Back to top |
|
|
rama krishna reddy Beginner
Joined: 18 Sep 2006 Posts: 31 Topics: 13 Location: Hyderabad
|
Posted: Wed Nov 29, 2006 4:32 am Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Nov 29, 2006 6:12 am Post subject: |
|
|
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 |
|
|
|
|