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
 

 

need help to convert alphanumeric value to numeric

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: need help to convert alphanumeric value to numeric
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    Post subject: Re: need help to convert alphanumeric value to numeric
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    Post subject:
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    Post subject: Re: need help to convert alphanumeric value to numeric
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am


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