Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Create Header Dtae as MMDDYYYY

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
thesumitk

Active User


Joined: 24 May 2013
Posts: 154
Location: INDIA

PostPosted: Tue Feb 25, 2020 4:56 pm    Post subject: Create Header Dtae as MMDDYYYY
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: 2365
Location: Hampshire, UK

PostPosted: Tue Feb 25, 2020 5:04 pm    Post subject: Reply to: Create Header Dtae as MMDDYYYY
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: 154
Location: INDIA

PostPosted: Tue Feb 25, 2020 5:23 pm    Post subject:
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: 154
Location: INDIA

PostPosted: Tue Feb 25, 2020 5:45 pm    Post subject:
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

Active Member


Joined: 29 Apr 2008
Posts: 801
Location: Maryland

PostPosted: Tue Feb 25, 2020 6:29 pm    Post subject:
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

Active Member


Joined: 29 Apr 2008
Posts: 801
Location: Maryland

PostPosted: Tue Feb 25, 2020 6:37 pm    Post subject:
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: 39
Location: NY

PostPosted: Tue Feb 25, 2020 8:24 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 2417
Location: NY,USA

PostPosted: Tue Feb 25, 2020 9:15 pm    Post subject:
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

Active Member


Joined: 29 Apr 2008
Posts: 801
Location: Maryland

PostPosted: Tue Feb 25, 2020 11:14 pm    Post subject:
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: 154
Location: INDIA

PostPosted: Thu Feb 27, 2020 5:26 pm    Post subject:
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

Active Member


Joined: 29 Apr 2008
Posts: 801
Location: Maryland

PostPosted: Thu Feb 27, 2020 11:58 pm    Post subject:
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: 39
Location: NY

PostPosted: Fri Feb 28, 2020 1:58 am    Post subject:
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

Active User


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

PostPosted: Sat Feb 29, 2020 10:41 pm    Post subject:
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: 154
Location: INDIA

PostPosted: Thu Mar 05, 2020 4:49 pm    Post subject:
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: 154
Location: INDIA

PostPosted: Thu Mar 05, 2020 5:03 pm    Post subject:
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: 39
Location: NY

PostPosted: Thu Mar 05, 2020 7:42 pm    Post subject:
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: 154
Location: INDIA

PostPosted: Wed Mar 11, 2020 3:59 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Insert System Runtime in HEADER In SY... Rick Ryan SYNCSORT 9 Tue May 26, 2020 9:01 pm
No new posts Add the name in the PS file and creat... dharmaraok DFSORT/ICETOOL 9 Wed Apr 01, 2020 10:43 am
No new posts How to create UUID using COBOL PORYES COBOL Programming 0 Tue Mar 17, 2020 4:43 pm
No new posts IFTHEN HIT=NEXT BUILR should create m... speermb DFSORT/ICETOOL 5 Fri Jan 10, 2020 10:49 pm
No new posts How to include header and some detail... AllyDick DFSORT/ICETOOL 2 Sun Dec 08, 2019 10:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us