View previous topic :: View next topic
|
Author |
Message |
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Hi ,
I need to create header for my output file and put current date in header in MMDDYYYY.
, tried searching the web but not getting enough , can some one please help.Thanks |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Instead of searching the internet did you try searching the DFSort manual? Somewhere between page 800 and 900. |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Thanks for your reply.
I tried Looking in to that as well but I dont find a way to create the date like if we use Y4W so it need a separator but in my case I don't have a separator and also I have no input for date to edit. I dont know What I am missing here , can you please help. Thanks |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Here is my full requirement for Header and Trailer
Header record should look like below
Position 1-2 it shd be as 'H ' - Alphabetic
Position 3-6 it shd contain 'XXX' - left justified Alphanumeric
Position 7-22 '11XXXXXXXXXXXXX' -left justified Alphanumeric
Position 23-44 '22XXXXXXXXXXXXXXXXXXXX' Left justified Alphabetic
Position 45-54 '33XXXXXXXX' left justified Alphabetic
Position 55-63 shd contain DATE in MMDDYYYY format
Position 64-71 '44XXXXXXXX' left justified Alphabetic
Position 72-80 shd contain DATE in MMDDYYYY format
Position 81-88 '55XXXXXXXX' left justified Alphabetic
Position 89-96 shd contain DATE in MMDDYYYY format
Trailer record should look like below
Position 1-2 shd Contain 'T ' Alphabetic
Position 3-13 Shd contain '1XXXXXXXXXX' Alphabetic
Position 14-29 Shd contain record count of the file --numeric
Position 30-59 Shd contain '2XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' Alphabetic
Position 60-63 Shd contain '3XXX' Alphanumeric
Position 64-84 Shd contain '4XXXXXXXXXXXXXXXXXXXX' Left justified Alphanumeric
I am spiting a file in to 10 output files based on a condition and for each file I have write these header and trailer , Where I am facing hurdles to write date in MMDDYYYY format . Please let me know if I am not clear above. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2021 Location: USA
|
|
|
|
Please, provide any result of: what did you try to do?
Don't forget to use code tags around your code samples. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2021 Location: USA
|
|
|
|
thesumitk wrote: |
Here is my full requirement for Header and Trailer
Header record should look like below
Position 1-2 it shd be as 'H ' - Alphabetic
Position 3-6 it shd contain 'XXX' - left justified Alphanumeric
Position 7-22 '11XXXXXXXXXXXXX' -left justified Alphanumeric
Position 23-44 '22XXXXXXXXXXXXXXXXXXXX' Left justified Alphabetic
Position 45-54 '33XXXXXXXX' left justified Alphabetic
Position 55-63 shd contain DATE in MMDDYYYY format
Position 64-71 '44XXXXXXXX' left justified Alphabetic
Position 72-80 shd contain DATE in MMDDYYYY format
Position 81-88 '55XXXXXXXX' left justified Alphabetic
Position 89-96 shd contain DATE in MMDDYYYY format
Trailer record should look like below
Position 1-2 shd Contain 'T ' Alphabetic
Position 3-13 Shd contain '1XXXXXXXXXX' Alphabetic
Position 14-29 Shd contain record count of the file --numeric
Position 30-59 Shd contain '2XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' Alphabetic
Position 60-63 Shd contain '3XXX' Alphanumeric
Position 64-84 Shd contain '4XXXXXXXXXXXXXXXXXXXX' Left justified Alphanumeric
I am spiting a file in to 10 output files based on a condition and for each file I have write these header and trailer , Where I am facing hurdles to write date in MMDDYYYY format . Please let me know if I am not clear above. |
All these tons of useless information are not related in any manner to the original question about the date in the header/trailer lines. |
|
Back to top |
|
|
John Del
New User
Joined: 27 Apr 2012 Posts: 42 Location: NY
|
|
|
|
thesumitk wrote: |
Thanks for your reply.
I tried Looking in to that as well but I dont find a way to create the date like if we use Y4W so it need a separator but in my case I don't have a separator and also I have no input for date to edit. I dont know What I am missing here , can you please help. Thanks |
Nic is pointing you to SYMNAMES.
For example, something like this might work for you if you understand how to use symbols and incorporate them into your sort control cards: MMDDCCYY,S'&LMON.&LDAY.&LYR4'
Alternatively, you could even set them up as JPn exec parms in case you ever need to change them on the fly.
/* |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Look for HEADER1 and TRAILER1 in manuals or this forum or Internet. This will add first and last record to your current Detail records. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2021 Location: USA
|
|
|
|
Do you speak English???
Page 128 wrote: |
TRAILER1=(field1[,field2]...)
TRAILER2=(field1[,field2]...)
TRAILER3=(field1[,field2]...) |
Page 129 wrote: |
&DATE[±nnnn]
&DATE=(xyzt)[±nnnn]
&DATENS=(xyz)[±nnnn]
&YDDD=(xyz)[±nnnn]
&YDDDNS=(xy)[±nnnn] |
Page 131 wrote: |
For example, &DATENS=(DMY) would produce a date of the form
'ddmmyy' which on March 29, 2002, would appear as '290302'.
&DATENS=(4MD) would produce a date of the form 'yyyymmdd' |
|
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Thanks All.
It worked for me , I coded as Nic and John suggested like below
Used SYMNAMES . |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2021 Location: USA
|
|
|
|
thesumitk wrote: |
Thanks All.
It worked for me , I coded as Nic and John suggested like below
Used SYMNAMES . |
The original issue with inserting date (in whatever format) into either header, or trailer record, has nothing to do neither with SYMNAMES itself, nor with all other presented information on other fields of your header/trailer. |
|
Back to top |
|
|
John Del
New User
Joined: 27 Apr 2012 Posts: 42 Location: NY
|
|
|
|
sergeyken wrote: |
thesumitk wrote: |
Thanks All.
It worked for me , I coded as Nic and John suggested like below
Used SYMNAMES . |
The original issue with inserting date (in whatever format) into either header, or trailer record, has nothing to do neither with SYMNAMES itself, nor with all other presented information on other fields of your header/trailer. |
The question wished to know how to use current date in a certain format when creating those header/trailer records and that the poster already knew which parameters to use to build header and trailer records.
We both provided suggestions to achieving that end, so I'm not sure I follow a reason for your expressing a sort of negativity with the response of his that you quoted, being that they were able to complete the request with a solution that worked best for them.
Personally, for a majority of production jobs, I would utilize JPn exec parameters whenever possible since they are the most dynamic and can be easily reused/configured for similar requests, followed by SYMNAMES symbolics as my second option, before hardcoding DATENS=(x) which is great for those quick and dirty uses. Understanding the concepts of these three and when best to apply them was accomplished by both of our suggested solutions, no? |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1249 Location: Bamberg, Germany
|
|
|
|
John Del wrote: |
Personally, for a majority of production jobs, I would utilize JPn exec parameters whenever possible since they are the most dynamic and can be easily reused/configured for similar requests.. |
If the JPn limit of 100 Bytes would be lifted by making use of the PARMDD JCL statement (available since z/OS 2.1), that would be an even more excellent option. |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
[quote="John Del"][quote="sergeyken"]
thesumitk wrote: |
Personally, for a majority of production jobs, I would utilize JPn exec parameters whenever possible since they are the most dynamic and can be easily reused/configured for similar requests, followed by SYMNAMES symbolics as my second option, before hardcoding DATENS=(x) which is great for those quick and dirty uses. Understanding the concepts of these three and when best to apply them was accomplished by both of our suggested solutions, no? |
Yes.. That would be great to use as JPn exec parameter , but I don't know if we can use system sybols like LMON,LDAy etc in JPn . Can you please show me a way with a small example .Thanks Much |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
thesumitk wrote: |
Yes.. That would be great to use as JPn exec parameter , but I don't know if we can use system sybols like LMON,LDAy etc in JPn . Can you please show me a way with a small example .Thanks Much |
Thank you so much , I got it from Manual and tested good now , I used it like below
Code: |
//JSTEP EXEC PGM=SORT,
// PARM='MSGDDN=MYOUT,JP1"&LMON.&LDAY.&LYR4",LIST',REGION=512M
//MYOUT DD SYSOUT=* |
and I used JP1 in the sort control card for putting the date in MMDDYYYY format. |
|
Back to top |
|
|
John Del
New User
Joined: 27 Apr 2012 Posts: 42 Location: NY
|
|
|
|
thesumitk wrote: |
thesumitk wrote: |
Yes.. That would be great to use as JPn exec parameter , but I don't know if we can use system sybols like LMON,LDAy etc in JPn . Can you please show me a way with a small example .Thanks Much |
Thank you so much , I got it from Manual and tested good now , I used it like below
Code: |
//JSTEP EXEC PGM=SORT,
// PARM='MSGDDN=MYOUT,JP1"&LMON.&LDAY.&LYR4",LIST',REGION=512M
//MYOUT DD SYSOUT=* |
and I used JP1 in the sort control card for putting the date in MMDDYYYY format. |
Nice
You could make it even more dynamic by setting it up to use as a jcl overrirde/proc set statement, such as below, so that you can easily override the parameters to whatever you might need...
Code: |
// SET JOBNAME='&JOBNAME'
//*SET FTPDATE='20200122'
// SET FTPDATE='&LYR4.&LMON.&LDAY'
// SET FTPTIME='&LHHMMSS'
....
//STEP1 EXEC PGM=SORT,PARM=('JP0"&FTPDATE"',
// 'JP1"&FTPTIME"','JP2"&JOBNAME"')
|
|
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
John Del wrote: |
thesumitk wrote: |
thesumitk wrote: |
Yes.. That would be great to use as JPn exec parameter , but I don't know if we can use system sybols like LMON,LDAy etc in JPn . Can you please show me a way with a small example .Thanks Much |
Thank you so much , I got it from Manual and tested good now , I used it like below
Code: |
//JSTEP EXEC PGM=SORT,
// PARM='MSGDDN=MYOUT,JP1"&LMON.&LDAY.&LYR4",LIST',REGION=512M
//MYOUT DD SYSOUT=* |
and I used JP1 in the sort control card for putting the date in MMDDYYYY format. |
Nice
You could make it even more dynamic by setting it up to use as a jcl overrirde/proc set statement, such as below, so that you can easily override the parameters to whatever you might need...
Code: |
// SET JOBNAME='&JOBNAME'
//*SET FTPDATE='20200122'
// SET FTPDATE='&LYR4.&LMON.&LDAY'
// SET FTPTIME='&LHHMMSS'
....
//STEP1 EXEC PGM=SORT,PARM=('JP0"&FTPDATE"',
// 'JP1"&FTPTIME"','JP2"&JOBNAME"')
|
|
Thank yo u so much John , I tested it and it worked fine.
Sumit |
|
Back to top |
|
|
|