header date dd/mm/yy to yyyymmdd



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Re: header date dd/mm/yy to yyyymmdd

Postby skolusu » Mon May 17, 2010 9:42 pm

shyamsaravan wrote:Yes Kolusu;

I read the the lat post...Just convert(Reformat) the header date format(dd/mm/yy) to Record date format(YYYYMMDD) and check the prior day of header date Record in detail records with additional searck key of '0310EUR','310RON','0311EUR','0311RON', if is available,do write that selected records to output record,if it is not available means check two days prior day record in detail record and write to o/p file.


Shayamsaravan,

*sigh* Please enlighten me as to how you can get "any date - 2 days" date using DFSORT.
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Re: header date dd/mm/yy to yyyymmdd

 

Re: header date dd/mm/yy to yyyymmdd

Postby shyamsaravan » Tue May 18, 2010 4:16 pm

Kolusu: I tried your previous code

mY Input file is

000001 00HEADER 18/05/10
000002 01AEDUNITED ARAB EMIRATESUAE DIRHAM OTHER FOREIGN
000003 01ALLALBANIA ALBANIAN LEK OTHER FOREIGN
000004 01ARAARGENTINA AUSTRAL (OLD) LATIN AMERICA
000005 01ARPARGENTINA PESO (OLD) LATIN AMERICA
000006 01ARSARGENTINA ARGENTINE PESO OTHER FOREIGN
000007 01ATSAUSTRIA SCHILLING EUROPE Y199901
000008 01AUDAUSTRALIA AUSTRALIAN DOLLAR ASIA-PACIFIC
000009 0301FRF1981093000001790000000000000000000000
000010 0301ILS2000093000002485089500000000000000000ZZZ
000011 0310RON2010051700000007203540800000000000000
000012 0301NLG1987033100004907000000000000000000000
000013 0310EUR2010051700003114294612300000000000000
000014 0310BRL2010012800005408778301500000000000000
000015 0310CNY2007041000001292826191600000000000000
000016 0311CYP2007091700023753851420700000000000000
000017 0311RON2010051700022650207182300000000000000
000018 0311EUR2010051700012602000000000000000000000
.
.
042221 99TRAILER 042219 000001 000001 042221



I tried below as the control card

SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(89:C'20')),
IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'00'),
PUSH=(91:16,2,13,2,10,2)),
IFTHEN=(WHEN=(1,2,SS,EQ,C'00,99',OR,
1,7,CH,EQ,C'0310EUR',AND,8,8,CH,LT,89,8,CH,OR,
1,7,CH,EQ,C'0310RON',AND,8,8,CH,LT,89,8,CH,OR,
1,7,CH,EQ,C'0311EUR',AND,8,8,CH,LT,89,8,CH,OR,
1,7,CH,EQ,C'0311RON',AND,8,8,CH,LT,89,8,CH),
OVERLAY=(97:SEQNUM,6,ZD))
OUTFIL INCLUDE=(97,1,CH,GT,C' '),IFOUTLEN=88,
IFTHEN=(WHEN=(1,2,ZD,EQ,99),
BUILD=(1,10,11:C'0000002 0000001 000001 ',97,6))
//*

output dispalyed like this

000001 00HEADER 18/05/10
000002 0310EUR2008112100012602000000000000000000000
000003 0311RON2010051700002948030000000000000000000
000004 0310EUR2006052200012753000000000000000000000
000005 0310RON2010040600003272105520200000000000000
000006 0310RON2010021900003272573226800000000000000
000007 0310EUR2010021100013718000000000000000000000
000008 0310EUR2010051700012909000000000000000000000
000009 0310EUR2010012000014132000000000000000000000
000010 0311RON2009051300003290010000000000000000000
000011 0310EUR2008061300015336000000000000000000000
000012 0310RON2009102700003465921006600000000000000
000013 0311EUR2009041700013078999877600000000000000
000014 0310RON2009100800003449299065400000000000000
000015 0311EUR2009012800013250318608800000000000000
000016 0311RON2010051700002940230000000000000000000
000017 0310EUR2008081400014907000000000000000000000
003167 0310RON2005102000003313374913300000000000000
003168 0310EUR2006020700011973000000000000000000000
003169 0310RON2008062000004248197033600000000000000
003170 0311EUR2010051700014107720385300000000000000
.
.
003171 99TRAILER 0000002 0000001 000001 003171

bUT I NEED BELOW SHOULD BE THE OUTPUT

000001 00HEADER 18/05/10
000002 0310RON2010051700000007203540800000000000000
000003 0310EUR2010051700003114294612300000000000000
000004 0311RON2010051700022650207182300000000000000
000005 0311EUR2010051700012602000000000000000000000
000006 99TRAILER 000004 000001 000001 000006

For the above code it displayed all records which are all having the date field less than the Header date .
But i need one day prior day record,if not available in the input file means, needs three day prior day record(ie 20100514 date record).

Please any one can help me
shyamsaravan
 
Posts: 40
Joined: Tue May 11, 2010 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: header date dd/mm/yy to yyyymmdd

Postby dick scherrer » Tue May 18, 2010 11:16 pm

Hello,

Why did you not answer Kolusu's question. . .
*sigh* Please enlighten me as to how you can get "any date - 2 days" date using DFSORT.


Possibly you need to consider actually writing a bit of code.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: header date dd/mm/yy to yyyymmdd

Postby shyamsaravan » Wed May 19, 2010 1:51 pm

Dick;

I agreed what Kolusu said earlier,,I just asking for any other way to perform the logic,,Just i given my comments,,Any way can we convert the header date to julian date and we can easily perform the date arithmetic operation ?.

Trailer record should have the count of detail record(exclude of header and Trailer record count)..Sorry for the delaying reply for that..

Please help me in any way in JCL,Sort ,,not cobol..
shyamsaravan
 
Posts: 40
Joined: Tue May 11, 2010 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: header date dd/mm/yy to yyyymmdd

Postby shyamsaravan » Wed May 19, 2010 6:46 pm

My requirement is changed..Now we need to fetch latest 10 earlier prior date records and write to o/p with compare of current date.(No need to consider Header date)
The input file is same as what i mentioned earlier
for Ex if current date is 19th may 2010 means, we have to use the folllowing search key to retieve the records

0310RON20100518--->18th may 2010
0310RON20100517
0310RON20100514
0310RON20100513
0310RON20100512
0310RON20100511
0310RON20100510
0310RON20100507
0310RON20100506
0310RON20100505-->5th may 2010

0310EUR20100518
0310EUR20100517
0310EUR20100514
.
0310EUR20100505


0311RON20100518
0311RON20100517
0311RON20100514
0311RON20100513
.
0311RON20100505

0311EUR20100518
0311EUR20100517
0311EUR20100514
0311EUR20100513
.
0311EUR20100505

So O/p should be

00HEADER 18/05/10
0310RON20100518
0310RON20100517
0310RON20100514--->see here ,the previous two days record missing,bcoz of Sat and Sun
0310RON20100513
0310RON20100512
0310RON20100511
0310RON20100510
0310RON20100507
0310RON20100506
0310RON20100505
0310EUR20100518
0310EUR20100517
0310EUR20100514
0310EUR20100513
0310EUR20100512
0310EUR20100511
0310EUR20100510
0310EUR20100507
0310EUR20100506
0310EUR20100505
0311RON20100518
0311RON20100517
0311RON20100514
0311RON20100513
0311RON20100512
0311RON20100511
0311RON20100510
0311RON20100507
0311RON20100506
0311RON20100505
0311EUR20100518
0311EUR20100517
0311EUR20100514
0311EUR20100513
0311EUR20100512
0311EUR20100511
0311EUR20100510
0311EUR20100507
0311EUR20100506
0311EUR20100505
99TRAILER 000040 00001 00001 000042

so Trailer record should have the following details

000040-->indicates Total no of detail records
000001-->indicates Header record count
000001-->indicates Trailer record count
000042-->indicates Total No of records

Please let me know,if any
Give the solution please....
shyamsaravan
 
Posts: 40
Joined: Tue May 11, 2010 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: header date dd/mm/yy to yyyymmdd

Postby dick scherrer » Wed May 19, 2010 7:06 pm

Hello,

Give the solution please....
Already given. . .

Write the code. . .

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: header date dd/mm/yy to yyyymmdd

Postby shyamsaravan » Wed May 19, 2010 7:28 pm

hi dick;

Already given code is displayed all earlier dates record,,but i need latest 10 date records,,how to perform
shyamsaravan
 
Posts: 40
Joined: Tue May 11, 2010 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: header date dd/mm/yy to yyyymmdd

Postby dick scherrer » Thu May 20, 2010 12:55 am

Hello,

Obviously, communication is not happening properly here. . .

I'm not sure how to say this differently, but you may have to write your own code (cobol, easytrieve, rexx, whatever).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Previous

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post