IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Create Header Dtae as MMDDYYYY


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Tue Feb 25, 2020 4:56 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Feb 25, 2020 5:04 pm
Reply with quote

Instead of searching the internet did you try searching the DFSort manual? Somewhere between page 800 and 900.
Back to top
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Tue Feb 25, 2020 5:23 pm
Reply with quote

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
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Tue Feb 25, 2020 5:45 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2021
Location: USA

PostPosted: Tue Feb 25, 2020 6:29 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2021
Location: USA

PostPosted: Tue Feb 25, 2020 6:37 pm
Reply with quote

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
View user's profile Send private message
John Del

New User


Joined: 27 Apr 2012
Posts: 42
Location: NY

PostPosted: Tue Feb 25, 2020 8:24 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Tue Feb 25, 2020 9:15 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2021
Location: USA

PostPosted: Tue Feb 25, 2020 11:14 pm
Reply with quote

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
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Thu Feb 27, 2020 5:26 pm
Reply with quote

Thanks All.

It worked for me , I coded as Nic and John suggested like below

Used SYMNAMES .
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2021
Location: USA

PostPosted: Thu Feb 27, 2020 11:58 pm
Reply with quote

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
View user's profile Send private message
John Del

New User


Joined: 27 Apr 2012
Posts: 42
Location: NY

PostPosted: Fri Feb 28, 2020 1:58 am
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1249
Location: Bamberg, Germany

PostPosted: Sat Feb 29, 2020 10:41 pm
Reply with quote

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. icon_idea.gif
Back to top
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Thu Mar 05, 2020 4:49 pm
Reply with quote

[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
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Thu Mar 05, 2020 5:03 pm
Reply with quote

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
View user's profile Send private message
John Del

New User


Joined: 27 Apr 2012
Posts: 42
Location: NY

PostPosted: Thu Mar 05, 2020 7:42 pm
Reply with quote

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 icon_biggrin.gif

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
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Wed Mar 11, 2020 3:59 pm
Reply with quote

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 icon_biggrin.gif

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
No new posts COBOL - create and write to output fi... COBOL Programming 0
No new posts Best way to create an automated line ... TSO/ISPF 3
Search our Forums:

Back to Top