|
View previous topic :: View next topic
|
| Author |
Message |
aura21
New User
Joined: 23 Aug 2023 Posts: 7 Location: india
|
|
|
|
Hi My request is to have Header in all outfile and Header should have MOnth and Year from current date.
Sort provided function DATE2 but i tried various way and sort step only fail , can you guide how can i use this. SPent lot of time searching and doing R&D but no success |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2283 Location: USA
|
|
|
|
| aura21 wrote: |
Hi My request is to have Header in all outfile and Header should have MOnth and Year from current date.
Sort provided function DATE2 but i tried various way and sort step only fail , can you guide how can i use this. SPent lot of time searching and doing R&D but no success |
PLEASE!!!!!!
Provide the code you have used, and the exact errors you have got.
Otherwise it is just wasting of time - reading meaningless postings on the forum.
P.S.
Do not reply that "your code is a Top Secret information". |
|
| Back to top |
|
 |
aura21
New User
Joined: 23 Aug 2023 Posts: 7 Location: india
|
|
|
|
***************************** Top of Data **************************
SORT FIELDS=(8,18,CH,A)
OMIT COND=(1,4,CH,EQ,C'BANK',OR,
1,1,CH,EQ,C'9',OR,1,1,CH,EQ,C'T')
OUTFIL REMOVECC,
HEADER1=(1:C'MONTHLY FILE CREATED ON : ',27:DATE2(-),/,
1:'BETA ',
'GMMA A ',
'AMOUNT ',
'AMT NUMBER ',
'DATE '),
BUILD=(1,80),
SECTIONS=(8,18,TRAILER3=('9',X,10,18,X,COUNT=(M10,LENGTH=8),51X)),
TRAILER1=(1:'T',X,
3:COUNT=(M10,LENGTH=13),X, * REC COUNT LEADING SPACES
17:TOT=(53,13,ZD,M10,LENGTH=18),46X) * TOT AMT LEADING SPACES |
|
| Back to top |
|
 |
aura21
New User
Joined: 23 Aug 2023 Posts: 7 Location: india
|
|
|
|
It is showing syntax error, with same card if I use DATE=4MD or dateins result are good.but with Date2 it fails
I am not able to fix so wanted ur help asap if poasible |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2283 Location: USA
|
|
|
|
This is what the manual says:
This is what you are using in your code
| Code: |
| HEADER1=(1:C'MONTHLY FILE CREATED ON : ',27:DATE2(-),/, |
Please, wipe your eyes, and try to find the difference.
If you cannot, then I give up…  |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1441 Location: Bamberg, Germany
|
|
|
|
Make use of symbols, it's easy to fix. Add to the job:
| Code: |
//SYMNAMES DD *
MyYear,S'&LYR4.'
MyMonth,S'&LMON.'
/* |
and change OUTFIL as follows:
| Code: |
OUTFIL REMOVECC,
HEADER1=(1:C'MONTHLY FILE CREATED ON : ',27:MyYear,C'-',MyMonth,/, |
BTW: The word "asap" leads always to slower processing of any help by the volunteers of this forum. If you need something asap, hire a well paid professional. |
|
| Back to top |
|
 |
aura21
New User
Joined: 23 Aug 2023 Posts: 7 Location: india
|
|
|
|
SORRY for using the word ASAP
i was trying hard and i am not getting any manual with example but could not find any
sergeyken i really appreicate your reply and your efforts to self find the solution.
i am yet not getting the fix..any one example can atlease give some start |
|
| Back to top |
|
 |
aura21
New User
Joined: 23 Aug 2023 Posts: 7 Location: india
|
|
|
|
For date values in the form C’yyyy-mm’, you could use the DATE2(-) constant;
I USED THIS BUT NOT WORKING
THE FORUM IS FOR HELP AND TO SAVE TIME |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1441 Location: Bamberg, Germany
|
|
|
|
| aura21 wrote: |
For date values in the form C’yyyy-mm’, you could use the DATE2(-) constant;
I USED THIS BUT NOT WORKING
THE FORUM IS FOR HELP AND TO SAVE TIME |
See what I have written and do not complain that volunteers spend their spare time to assist you. |
|
| Back to top |
|
 |
aura21
New User
Joined: 23 Aug 2023 Posts: 7 Location: india
|
|
|
|
//SYMNAMES DD *
JP1,S'&LYR4.'
JP2,S'&LMON.'
/*
Getting syntax error:
SORT FIELDS=(8,18,CH,A)
OMIT COND=(1,4,CH,EQ,C'BANK',OR,
1,1,CH,EQ,C'9',OR,1,1,CH,EQ,C'T')
OUTFIL REMOVECC,
HEADER1=(1:C'MONTHLY FILE CREATED ON : ',27:JP1,C'/',JP2,/,
*
1:'TV CODE ',
'TV NUMBER ',
'AMT N ',
'NUMBER ',
'PDDATE '),
BUILD=(1,80),
SECTIONS=(8,18,TRAILER3=('9',X,10,18,X,COUNT=(M10,LENGTH=8),51X)),
TRAILER1=(1:'T',X,
3:COUNT=(M10,LENGTH=13),X, * REC COUNT LEADING SPACES
17:TOT=(53,13,ZD,M10,LENGTH=18),46X) * TOT AMT LEADING SPACES
WER813I INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER578I SORTL INSTRUCTION NOT USED; REASON CODE=FE
Appreciate all members efforts. it is just i am trying from 3 days and still nothing |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2283 Location: USA
|
|
|
|
If you tried to read the manual carefully, you would find that the only date formats allowed for HEADER/TRAILER parameters are as follows:
| Quote: |
&DATE [{±}nnnn]
&DATE=(m1m2m3m4 )[{±}nnnn]
&DATENS=(xyz)[{±}nnnn]
&YDDD=(m1m2m3)[{±}nnnn]
&YDDDNS=(m1m2)[{±}nnnn] |
All other date formats (including &DATE2 - with ampersand!!!) are used only for data records, not for headers/trailers.
Just use any of allowed code, and forget about absolutely stupid initial requirements.
| Code: |
| HEADER1=(1:C'MONTHLY FILE CREATED ON : ',27:&DATE=(4MD-),/, |
| Code: |
********************************* TOP OF DATA *************
MONTHLY FILE CREATED ON : 2023-08-25
BETA GMMA A AMOUNT AMT NUMBER DATE
1234567890
******************************** BOTTOM OF DATA *********** |
P.S.
You are still not able even to learn how to use the Code button! To say nothing about RTFM... |
|
| Back to top |
|
 |
aura21
New User
Joined: 23 Aug 2023 Posts: 7 Location: india
|
|
|
|
I had used this - it gave me full date which is not the ask of my request.
we just want year and month in the file header.
I am trying to use Parameters but that is also showing same syntax error
appreciate your time to help me in all stages. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2283 Location: USA
|
|
|
|
| aura21 wrote: |
I had used this - it gave me full date which is not the ask of my request.
we just want year and month in the file header.
I am trying to use Parameters but that is also showing same syntax error
appreciate your time to help me in all stages. |
It look like you even do not read the detailed explanation, but continuously repeat your mantras... |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2283 Location: USA
|
|
|
|
One more way to satisfy your absolutely senseless initial requirement:
| Code: |
//REPORT EXEC PGM=SORT,PARM='JP0"&LYR4-&LMON"'
. . . . . . .
HEADER1=(1:C'MONTHLY FILE CREATED ON : ',27:JP0,/,
. . . . . . . . |
|
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1441 Location: Bamberg, Germany
|
|
|
|
| Btw, that Topic should be moved to the SYNCSORT section. Not even able to chose the right part of the forum, these Software Engineers nowadays. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|