Basically coverting Julian date to the new date format , Time to be in HH:MM:SS format and date formatting to remove two hyphens - and adding up
COMMENTS label with the contents upto 30 bytes and filling up with _ till the end of the length.
After the actual coments TESTING it should padd with spaces filling length of 30 bytes , so total comments field should be of max 30 bytes
Another question with related to this:
Let us say I have ISPF Menu and I use option say 7 to get customized report as of now. The report which gets displayed is also saved in dataset USERID.REPORT.
Basically what is displayed on the screen is the output of the dataset.
Now I want the report in a new format way , so when I choose option 7 . So how can I do that . Should I be aware of the source of REXX panel / CLIST which
actually kicks off to show the report. I mean it should show up new report let us say USER.REPORT.FORMAT instead of USERID.REPORT or same USERID.REPORT if it is formatted. _________________ Shekar
Grow Technically
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Sun Oct 22, 2017 3:02 pm Post subject: Re: Convert Julian date to a new format
shekar123 wrote:
Basically coverting Julian date to the new date format , Time to be in HH:MM:SS format and date formatting to remove two hyphens - and adding up
COMMENTS label with the contents upto 30 bytes and filling up with _ till the end of the length.
After the actual coments TESTING it should padd with spaces filling length of 30 bytes , so total comments field should be of max 30 bytes
Sekhar123,
This is quite easy.
1. Number the records using SEQNUM
2. Using WHEN=GROUP, push the 1st record on to 2nd record at the end by checking the seqnum of 1 that you added in step 1 with records=2
3. Now convert the julian date using TOGREG function and output in Y4w format for the 2nd record.
4. Using OUTFIL startrec=2, eliminate the 1st record and build the 1 and 2nd records using the contents you pushed at the end and for the month name, use CHANGE command to convert the 2 digit monthly name 3 character month name.
shekar123 wrote:
Another question with related to this:
Let us say I have ISPF Menu and I use option say 7 to get customized report as of now. The report which gets displayed is also saved in dataset USERID.REPORT.
Basically what is displayed on the screen is the output of the dataset.
Now I want the report in a new format way , so when I choose option 7 . So how can I do that . Should I be aware of the source of REXX panel / CLIST which
actually kicks off to show the report. I mean it should show up new report let us say USER.REPORT.FORMAT instead of USERID.REPORT or same USERID.REPORT if it is formatted.
You need to Write your OWN rexx/clist to format the dataset to your needs and invoke it AFTER you generated the report from your customized option 7. _________________ Kolusu
www.linkedin.com/in/kolusu
//STEP010 EXEC PGM=SORT
//SORTIN DD *
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
D17246Â T193102 WEEKLYÂ Â Â Â 1Â Â 2Â Â 3Â Â TESTING
    17-OCT-2017
/*
//SYSIN DD *
SORT FIELDS=COPY
INREC OVERLAY=(1,80,81:SEQNUM,1,ZD)
INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(81:SEQNUM=2)),
OUTFIL INCLUDE=(81,1,ZD,EQ,1),
BUILD=(1:1,40,/,17:C'COMMENTS: ',27:98,11)
/*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//
ICE002I 0 DUPLICATE OR CONFLICTING INREC STATEMENT
ICE002I 0 DUPLICATE OR CONFLICTING INREC STATEMENT
ICE201I 0 RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE805I 1 JOBNAME: KC03F89R , STEPNAME: STEP010
ICE802I 0 BLOCKSET TECHNIQUE IN CONTROL
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
ICE000I 1 - CONTROL STATEMENTS FOR 5650-ZOS, Z/OS DFSORT V2R1 - 11:58 ON TUE OCT 24, 2017 -
SORT FIELDS=COPY
INREC OVERLAY=(1,80,81:SEQNUM,1,ZD)
INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(81:SEQNUM=2)),
INREC IFTHEN=(WHEN=GROUP,BEGIN=(81,1,ZD,EQ,1),PUSH=(82:17,11)),
OUTFIL INCLUDE=(81,1,ZD,EQ,1),
BUILD=(1:1,40,41:97,11,/,17:C'COMMENTS: ',27:41,30)
ICE027A 9 END OF SORTOUT FIELD BEYOND MAXIMUM RECORD LENGTH
ICE751I 0 C5-BASE C6-BASE C7-K96411 C8-K96411 E9-BASE E7-K96411
ICE052I 3 END OF DFSORT
I am trying to add 1st record and then the 2nd record in one line and then trying to create first 40 bytes in line 1 and then in line 2 building up the COMMENTS and the text
Can you please help me further. _________________ Shekar
Grow Technically
Please see my input and the output which I have got when I have multiple records
Code:
//**********************************************************************
//STEP010 EXEC PGM=SORT
//SORTIN DD *
D17246Â T193102 WEEKLYÂ Â Â Â 1Â Â 2Â Â 3Â Â TESTING1
    17-OCT-2017
D17247Â T093102 MONTHLY Â Â Â 4Â Â 5Â Â 6Â Â TESTING2
    18-OCT-2017
/*
//SYSIN DD * Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
OPTION COPY Â Â Â Â Â Â Â
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(81:SEQNUM,8,ZD)), Â
IFTHEN=(WHEN=GROUP,BEGIN=(81,8,ZD,EQ,1),
PUSH=(101:1,80),RECORDS=2),
IFTHEN=(WHEN=(81,8,ZD,EQ,2),
OVERLAY=(90:102,5,Y2T,TOGREG=Y4W))
OUTFIL STARTREC=2,IFOUTLEN=80,
IFTHEN=(WHEN=(81,8,ZD,EQ,2), Â Â Â Â
BUILD=(101,40,
012,02, Â Â Â Â Â
015,03, Â Â Â Â
019,04,/, Â Â Â Â
092,02, Â Â
090,2,CHANGE=(3,C'01',C'JAN',C'02',C'FEB',C'03',C'MAR',
C'04',C'APR',C'05',C'MAY',C'06',C'JUN',
C'07',C'JUL',C'08',C'AUG',C'09',C'SEP',
C'10',C'OCT',C'11',C'NOV',C'12',C'DEC'),
NOMATCH(C'ERR'),
94,4,
X,
110,2,
C':',
112,2,
C':',
114,2,
4X,
C'COMMENTS: TESTING',
30C'_'))
/*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Wed Oct 25, 2017 11:24 am Post subject:
shekar123 wrote:
Kolusu,
Please see my input and the output which I have got when I have multiple records
I am not achieving desired results , can you please help here.
Shekar123,
How hard is to explain the requirements in 1 go? You could have mentioned in the first post about having multiple header records which start with D at position 1 and you want write 2 records from it. You did not even bother to explain even after I gave you the hint about eliminating the first record and starting with record number 2 and now you come back to tell me that you have multiple headers. Sigh
It is really difficult to produce a solution with a moving target requirements. Anyway here is another set of untested control cards.
First of all thanks for your help and I really apologize that I was not clear. I was in the assumption that the solution will work with those kind of records. I should have been clear on the same. This will not repeat again. I have run the code and here are my results:
If the first record had TEST1 and second record had TESTING2 as the contents they should have TEST1 followed by _ to fill in 30 max length and the same for TESTING2 followed by _ to fill in 30 max length after the hardcoded label COMMENTS:
I should have been more clear in my initial post . Sorry for the same.
Thank you once again for your help. _________________ Shekar
Grow Technically
Did you even bother to understand what the job is doing? If you did aligning is such a simple task. Clue look at what 101,40 is doing and split that into multiple fileds. And for the 4 spaces before comment understand what 4x does.
shekar123 wrote:
If first record had TEST1 and second record had TESTING2 as the contents they should have TEST1 followed by _ to fill in 30 max length and the same for TESTING2 followed by _ to fill in 30 max length after the hardcoded label COMMENTS:
I should have been more clear in my initial post . Sorry for the same.
Thank you once again for your help.
Shekar123,
Yet another requirement change. SMH. What happens if you have testing 3 and 4? Or any other testing n? Either way it is trivial to add the updated text message
Look up the earlier CHANGE command and follow the same pattern.
Please do NOT expect to be spoon fed with solutions despite being an experienced programmer. _________________ Kolusu
www.linkedin.com/in/kolusu
 OPTION COPY                                                         Â
 INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'D'),                    Â
               PUSH=(101:1,80),RECORDS=2),                           Â
       IFTHEN=(WHEN=(101,1,CH,EQ,C'D'),                              Â
      OVERLAY=(90:102,5,Y2T,TOGREG=Y4W))                             Â
                                                                      Â
 OUTFIL OMIT=(1,1,CH,EQ,C'D'),IFOUTLEN=80,                           Â
 IFTHEN=(WHEN=(101,1,CH,EQ,C'D'),                                    Â
 BUILD=(001:101,8,                                                   Â
        009:C' ',                                                   Â
        011:109,7,                                                   Â
        018:C'   ',                                                 Â
        022:116,10,                                                  Â
        032:126,13,                                                  Â
        017,02,                                                      Â
        020,03,                                                      Â
        024,04,/,                                                    Â
        092,02,                                                      Â
        090,2,CHANGE=(3,C'01',C'JAN',C'02',C'FEB',C'03',C'MAR',      Â
                        C'04',C'APR',C'05',C'MAY',C'06',C'JUN',      Â
                        C'07',C'JUL',C'08',C'AUG',C'09',C'SEP',      Â
                        C'10',C'OCT',C'11',C'NOV',C'12',C'DEC'),     Â
                        NOMATCH(C'ERR'),                             Â
        094,4,                                                       Â
        X,                                                           Â
        110,2,                                                       Â
        C':',                                                        Â
        112,2,                                                       Â
        C':',                                                        Â
        114,2,                                                       Â
        4X,                                                          Â
        C'COMMENTS: ',                                               Â
        33:139,35,/))                                                Â
Thank you once again for all your help. _________________ Shekar
Grow Technically
Thanks Kolusu for helping me further. I was not able to make use of _ in my code while testing for the TESTING1 and TESTING2 , so my output I made them not to use _
With your code I am able to achieve desired results.
Thank you once again. _________________ Shekar
Grow Technically
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum