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

need help to convert alphanumeric value to numeric


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rohit jaiswal
Warnings : 2

New User


Joined: 09 Mar 2006
Posts: 36
Location: hyderabad,A.P

PostPosted: Thu Jun 01, 2006 11:45 am
Reply with quote

hi

my requirement is that i have a vsam file in which the date format is in yymmdd format with data type as alphanumeric . i need to convert this to numeric type and also it shud be in the julian date format. if any one has the code please send it or tell me a way to do it.

thanks in advance

regards
rohit.
Back to top
View user's profile Send private message
purushoth_jp

New User


Joined: 12 Dec 2004
Posts: 22

PostPosted: Thu Jun 01, 2006 7:20 pm
Reply with quote

hi rohit,
just i'm giving u the logic for the below requirement.

just read record from VSAM file, move the date filed to a new alpha numeric variable, pass this variable to a sub program which converts this date to a julian date. now move that julian date to a new variable which is of numeric type and return the same to the main program.

logic to convert date to a julian date

regular date format - MM/DD/YYYY.

refular date

01 date.
05 month pic x(2).
05 date pic x(2).
05 year pic x(4).

julian date - YYDDD.

01 jul
05 ye-jul pic 9(2).
05 dat-jul pic 9(3).

have a occurs claue for month field for ex

05 month-filed pic 9(2) occurs 12 times.

store 31 in month filed (1), 28 or 29 in month filed(2) ....

suppose if the date is 21/05/06 is given then

move month to n. ---> we are moving 05 to n

perform para-a varying i from 1 by 1 until i < n.
add date to dat-jul
move year to ye-jul.
display jul.

para-a

add month-field(i) to dat-jul.

let me know if u have any quires
Back to top
View user's profile Send private message
rohit jaiswal
Warnings : 2

New User


Joined: 09 Mar 2006
Posts: 36
Location: hyderabad,A.P

PostPosted: Fri Jun 02, 2006 10:19 am
Reply with quote

hi purushoth

thanks for the concern but i habe completed the conversion by using some routines and applying my own logic.

regards
rohit
Back to top
View user's profile Send private message
SKAMF

New User


Joined: 05 Jun 2006
Posts: 1

PostPosted: Mon Jun 05, 2006 12:14 pm
Reply with quote

hi purushotha, i did not understand why u gave valeus 31, 28,29 to occurs months field..
ok, u move 05 to month
how thatmeans u ar doing the loop until, 05

perform para-a varying i from 1 by 1 until i < n.
add date to dat-jul
move year to ye-jul.
display jul.

para-a

add month-field(i) to dat-jul.

so month-field (i) contains-5
u add the date x(2) to date-jul, and move the year to ye-jul..




Pls clarify..
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
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 Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
Search our Forums:

Back to Top