Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DFSORT - Yesterday date with CYYMMDD

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

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Thu Jul 28, 2011 3:30 pm    Post subject: DFSORT - Yesterday date with CYYMMDD
Reply with quote

Hi

Input File : 1110724XXXXXXXXXXX..

I have to use this input file and write Yesterday date with CYYMMDD this format and copy remaining data.

Runing in July26
Output file should be

Output : 1110725XXXXXXXXXXX..
I need to write in DFSORT only. Can you plese help on this.
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Jul 28, 2011 4:09 pm    Post subject:
Reply with quote

Do you mean irrespective of date in your input file.. you want yesterdays date inthe output file at same position?
Back to top
View user's profile Send private message
vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Thu Jul 28, 2011 4:11 pm    Post subject:
Reply with quote

Yes... Correct
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Jul 28, 2011 4:20 pm    Post subject:
Reply with quote

Hi.... This might help you...
Code:

//STEPORT  EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD *                                 
1110724XXXXXXXXXXXYY                             
/*                                               
//SORTOUT  DD SYSOUT=*                           
//SYSIN    DD *                                 
  SORT FIELDS=COPY                               
  INREC FIELDS=(01:DATE1,9:8,13)                 
  OUTREC FIELDS=(01:1,2,                         
                 CHANGE=(1,C'20',C'1',           
                           C'21',C'2'),         
                 2:3,4,                         
                 6:7,2,ZD,SUB,+1,EDIT=(TT),     
                 8:9,13)                         
/*                                               


Thanks
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Jul 28, 2011 4:23 pm    Post subject:
Reply with quote

You can also put
Code:

,NOMATCH=(set)


in the change clause if the there is no match.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Jul 28, 2011 4:24 pm    Post subject:
Reply with quote

vicky10001 wrote:
Yes... Correct


Even if yesterday is weekend/holiday?
Back to top
View user's profile Send private message
vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Thu Jul 28, 2011 6:22 pm    Post subject:
Reply with quote

Thanks gylbharat.. Its working fine
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Jul 28, 2011 6:49 pm    Post subject:
Reply with quote

gylbharat wrote:
Hi.... This might help you...

Thanks


Gylbharat, What if date is first of the month?
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Jul 28, 2011 7:02 pm    Post subject:
Reply with quote

Escapa wrote:
gylbharat wrote:
Hi.... This might help you...

Thanks


Gylbharat, What if date is first of the month?


Sorry... Missed that condition....

Code:

//STEPORT  EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD *                                   
1110724XXXXXXXXXXXYY                             
/*                                               
//SORTOUT  DD SYSOUT=*                           
//SYSIN    DD *                                   
  SORT FIELDS=COPY                               
  INREC FIELDS=(01:DATE1-1,9:8,13)               
  OUTREC FIELDS=(01:1,2,                         
                   CHANGE=(1,C'20',C'1',         
                             C'21',C'2'),         
                   2:3,6,                         
                   8:9,13)                       
/*                                               
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jul 28, 2011 9:07 pm    Post subject: Reply to: DFosrt - Yesterday date with CYYMMDD
Reply with quote

Hello,

Quote:
Thanks gylbharat.. Its working fine

Quote:
Sorry... Missed that condition....


Which indicates insufficient testing on both sides. . .

I mention this because many people take code given and use it with little or no proper testing/validation. Just a caution. . . icon_neutral.gif

d
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jul 28, 2011 9:09 pm    Post subject: Reply to: DFosrt - Yesterday date with CYYMMDD
Reply with quote

vicky10001,

An easier approach would be a simple subtraction of 19 from the century portion. This will take care of any one simulating a 19xx dates and future dates up 2899-12-31. I assumed that the LRECL=80 and RECFM=FB

Code:

//STEP0100 EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//SORTIN   DD *                             
1110724XXXXXXXXXXX.                         
//SORTOUT  DD SYSOUT=*                       
//SYSIN    DD *                             
  SORT FIELDS=COPY                           
  INREC BUILD=(DATE1-1,8,73)                 
  OUTREC BUILD=(1,2,ZD,SUB,+19,EDIT=(T),3,79)
//*
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Jul 28, 2011 9:10 pm    Post subject:
Reply with quote

Ohhh... I didn't notice... Even OP was happy with the code.. icon_rolleyes.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Thu Jul 28, 2011 9:15 pm    Post subject:
Reply with quote

Quote:
Which indicates insufficient testing on both sides. . .
Back in my teaching days, I used to assign a homework problem:
Quote:
You have been asked to generate test cases adequate to completely test this rpobelm:
Quote:
Write a program that accepts as input 3 integers representing the lengths of the sides of a triangle. Output of the program should indicate if the triangle is equlateral, isoceles, or scalene.
DO NOT WRITE THE PROGRAM -- JUST THE TEST CASES!
It was a rare student who managed to come up with more than half the test cases.
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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us