IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to convert ws-date x(8) to integer


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mercy
Warnings : 1

New User


Joined: 25 Jun 2006
Posts: 10
Location: Bangalore

PostPosted: Thu Aug 10, 2006 12:50 pm
Reply with quote

Hi ,
How to convert ws-date x(8) to integer ?If ws-date is declared as
ws-date pic x(8) and if it is declared as

01 ws-date
02 ws-yy X(4)
02 ws-mm x(2)
02 ws-dd x(2)

can any one tell me both the ways.

Thanq
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Thu Aug 10, 2006 4:17 pm
Reply with quote

hi,

USE REDEFINES clause.

EG:

For WS-DATE PIC X(8).
WS-DATE-N REDEFINES WS-DATE PIC 9(8).
For more infomation look at quick reference.

~Vamsi
Back to top
View user's profile Send private message
mercy
Warnings : 1

New User


Joined: 25 Jun 2006
Posts: 10
Location: Bangalore

PostPosted: Thu Aug 10, 2006 4:54 pm
Reply with quote

Vamsi thanq for ur reply.
Actually my problem is that i am fetching records from input file which contains date field of format x(8).i have to compare this date with the current date and do some modifications on the yyyy of date field in the inputfile.so how can i do this ? I have used the following stmt to get current date.

ACCEPT ws-date from date yyyymmdd
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Thu Aug 10, 2006 5:26 pm
Reply with quote

hI,

Just let us know what exactly the format of DATE in Input and in what format u r reading the DATE from ACCEPT DATE..

You are not clear with your requirement.

~Vamsi
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
Search our Forums:

Back to Top