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
 

 

Date option in DFSORT
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Cketha
Warnings : 1

New User


Joined: 19 May 2007
Posts: 22
Location: mumbai

PostPosted: Tue Jun 05, 2007 5:11 pm    Post subject: Date option in DFSORT
Reply with quote

Hi,

I want to find last date of previous month using DFSORT, is any option available in the DFSORT?
Please, help me regarding this

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

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Jun 05, 2007 5:18 pm    Post subject:
Reply with quote

Have you looked at the sort manual?
Back to top
View user's profile Send private message
Cketha
Warnings : 1

New User


Joined: 19 May 2007
Posts: 22
Location: mumbai

PostPosted: Tue Jun 05, 2007 5:30 pm    Post subject: Date optin in DFSORT
Reply with quote

I have gone through sort manuals, I have got the option to find the previous month but I did not find any option to get last day of the previous month.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 05, 2007 5:32 pm    Post subject:
Reply with quote

It can be done in REXX
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 05, 2007 5:33 pm    Post subject:
Reply with quote

I forgot to ask why the must for using DFSORT ???
Back to top
View user's profile Send private message
Cketha
Warnings : 1

New User


Joined: 19 May 2007
Posts: 22
Location: mumbai

PostPosted: Tue Jun 05, 2007 5:41 pm    Post subject: Date option DFSORT
Reply with quote

Hi,
We can do it using COBOL program or REXX, but I supposed to use DFSORT.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 05, 2007 5:43 pm    Post subject:
Reply with quote

Is this HOMEWORK ???
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Jun 05, 2007 5:46 pm    Post subject: Re: Date optin in DFSORT
Reply with quote

Cketha wrote:
I have got the option to find the previous month but I did not find any option to get last day of the previous month.
The usual way , if the tools are available, would be to plug the dd of your mmddyy with a 01, convert to julian yyddd, subtract 1 from the ddd and convert back to mmddyy.
Back to top
View user's profile Send private message
Cketha
Warnings : 1

New User


Joined: 19 May 2007
Posts: 22
Location: mumbai

PostPosted: Tue Jun 05, 2007 5:48 pm    Post subject:
Reply with quote

hey, this is not a homework...
It's bcoz it saves processing time we are sorting a file.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 05, 2007 5:55 pm    Post subject:
Reply with quote

Quote:
hey, this is not a homework...
It's bcoz it saves processing time we are sorting a file.

Apologies, it just sounded like a homework question until you clarified further.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Jun 05, 2007 5:58 pm    Post subject: Re: Date option in DFSORT
Reply with quote

Cketha wrote:
I want to find last date of previous month using DFSORT, is any option available in the DFSORT?
OK, fill in some information, please.
The stated requirement to use sort to generate a date is a bit thin.....
Where is the previous month coming from? The current month? A field in the input?
What are you doing with the last day of the previous month? Comparing it to a field in the input?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 05, 2007 6:02 pm    Post subject:
Reply with quote

In the past, I have used REXX to build the control statements for DFSORT, for something similar.
Back to top
View user's profile Send private message
Cketha
Warnings : 1

New User


Joined: 19 May 2007
Posts: 22
Location: mumbai

PostPosted: Tue Jun 05, 2007 6:09 pm    Post subject: Re: Date optin in DFSORT
Reply with quote

Hi
As you said we can get the current date, How can we convert date to 01 and use the Julian Date function in the sort card?
Actually our requirment is to populate fields from input files along with RPT-DATE(previous month last day) to the output file.
This is the new field added in the output file.

Thanks
Jahnavi
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Jun 05, 2007 6:18 pm    Post subject:
Reply with quote

So you need the date of the last day of the previous month in a sort control card, right?
I don't know, but Frank can do some magic in creating sort input for a following sort step....
And as expat said, he has "used REXX to build the control statements for DFSORT".....
Back to top
View user's profile Send private message
Cketha
Warnings : 1

New User


Joined: 19 May 2007
Posts: 22
Location: mumbai

PostPosted: Tue Jun 05, 2007 6:19 pm    Post subject:
Reply with quote

Hey, It's Ok.
I am not familiar with REXX.
Back to top
View user's profile Send private message
Cketha
Warnings : 1

New User


Joined: 19 May 2007
Posts: 22
Location: mumbai

PostPosted: Tue Jun 05, 2007 6:39 pm    Post subject:
Reply with quote

William Thompson wrote:
So you need the date of the last day of the previous month in a sort control card, right?
I don't know, but Frank can do some magic in creating sort input for a following sort step....
And as expat said, he has "used REXX to build the control statements for DFSORT".....


I have two files First file(having thousanda of records) with 10 field and spaces in date field , Second file contains a date field only one record.
I want to populate all the records from first file with date field added from second file to the output file.
Can you help me regarding this?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jun 05, 2007 8:32 pm    Post subject:
Reply with quote

Please show an example of the records in each input file and what you expect for output. Give the starting position, length and format of all relevant fields. Give the RECFM and LRECL of each input file. Explain the "rules" for getting from input to output.

Also, do you only have 20yy dates? Or do you have 20yy and 19yy dates?
Back to top
View user's profile Send private message
Cketha
Warnings : 1

New User


Joined: 19 May 2007
Posts: 22
Location: mumbai

PostPosted: Wed Jun 06, 2007 9:34 am    Post subject:
Reply with quote

Frank Yaeger wrote:
Please show an example of the records in each input file and what you expect for output. Give the starting position, length and format of all relevant fields. Give the RECFM and LRECL of each input file. Explain the "rules" for getting from input to output.

Also, do you only have 20yy dates? Or do you have 20yy and 19yy dates?


Hi,
Sorry I couldn't to relply you.
First I/p file following fields
eno. x(10), sys_id 9(10),name x(40), bal 9(10)
This file contains thousand of records

Second file has
ddate(10)
This file has one record.

output file structure
eno. x(10), sys_id 9(10),date x(10), name x(40), bal 9(10),ldno 9(10)
I have to populate first files record along with date from second file
in all the records as per the abbove file structure..
Few extra fields are in d output files those will b polulated with zeros or
spaces
can u help me to prepare sort card for this?
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Jun 06, 2007 12:20 pm    Post subject:
Reply with quote

Cketha
your output file structure

Quote:
eno. x(10), sys_id 9(10),date x(10), name x(40), bal 9(10),ldno 9(10)

contains "ldno" which is not specified in any of the i/p's, clarify this.

It would be better if you are providing a set of sample i/p records, as to how your i/ps look, for clear understanding of your request.
Back to top
View user's profile Send private message
Cketha
Warnings : 1

New User


Joined: 19 May 2007
Posts: 22
Location: mumbai

PostPosted: Wed Jun 06, 2007 6:12 pm    Post subject: Sorting a file using DFSORT
Reply with quote

Hi,

I m giving u some sample records
I/p file 1
eno. x(10) sys_id 9(10), name x(10) bal 9(10)
1111111111 1212121212 aaaaaaaaaa 1000000000
2222222222 2121212121 bbbbbbbbbb 2000000000
3333333333 3131313131 cccccccccccc 3000000000

File1 file contain thousands of records...


I/p file 2.. only 1 record
date X(10)
2007-01-31

yyyy-mm-dd

This is how i/p files are


I want to populate all the records of file 1 with same date as it is in file 2
to o/p file with structure as follow

O/p I need
eno. x(10) sys_id 9(10), dno x(10) name x(10) bal 9(10) lno9(10)
1111111111 1212121212 2007-01-31 aaaaaaaaaa 1000000000 00000000
2222222222 2121212121 2007-01-31 bbbbbbbbbb 2000000000 00000000
3333333333 3131313131 2007-01-31 cccccccccccc 3000000000 00000000

using sortcard, Can you help regarding this?
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
Goto page 1, 2  Next
Page 1 of 2

 

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
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
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


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