Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
COBOL pgm not getting the correct values from JCL parm

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rakesh17684

New User


Joined: 08 Oct 2006
Posts: 60
Location: San Diego

PostPosted: Wed Feb 18, 2009 2:14 pm    Post subject: COBOL pgm not getting the correct values from JCL parm
Reply with quote

Hi,

I have a COBOL program which gets 11 different values as a PARM from a JCL.

Code:

//STEP01  EXEC PGM=PROG1,PARM=('2009-01-21','1234','0012','1111', 
//             '2009-01-22','4321','32767','2222','TABLE_NAME','47',   
//             '999.88')     
                                       


and in PROG1 after receiving the parms via the linkage section i unstring the parms to get individual values into variables.

Code:
UNSTRING WS-EXEC-PRM-VALUE
   DELIMITED BY  ','
   INTO DATE
           SEQ-NO
           FILE-NO
              .
              .
              .
              .
              .
              .
              .
        AMOUNT
END-UNSTRING
.

The problem is the last field (amount) which is declared as
Code:
05 AMOUNT          PIC 9(8)V9(2).

I am not getting the value passed. i get 7 spaces followed by 3 zeroes (for 999.88).
here is the display part of all the parms
Code:
     
2009-01-21     
000000000001234
00012         
01111         
2009-01-22     
000000000004321
32767         
02222         
TABLE_NAME     
00047         
       000   ---this one should be 999.88 


can you guys help me point out where i am going wrong ??
Thanks in advance
Back to top
View user's profile Send private message

aishwarya_20

New User


Joined: 19 Nov 2008
Posts: 57
Location: pune

PostPosted: Wed Feb 18, 2009 2:25 pm    Post subject:
Reply with quote

Hi Rakesh,

Here you are passing Amount as alphanumeric (character string) so you receiving the amount in cobol program in alphanumeric form and then move it to numeric. This could help you.
Back to top
View user's profile Send private message
rakesh17684

New User


Joined: 08 Oct 2006
Posts: 60
Location: San Diego

PostPosted: Wed Feb 18, 2009 2:50 pm    Post subject:
Reply with quote

Quote:
you receiving the amount in cobol program in alphanumeric form


unstring is done into AMOUNT which is declared as
Code:
05 AMOUNT          PIC 9(8)V9(2).
Back to top
View user's profile Send private message
aishwarya_20

New User


Joined: 19 Nov 2008
Posts: 57
Location: pune

PostPosted: Wed Feb 18, 2009 2:53 pm    Post subject:
Reply with quote

Please declare the AMOUNT as follows:-

05 AMOUNT PIC 9(10).

after that you can move it into another variable which is declared as 9(8)v9(2).
Back to top
View user's profile Send private message
rakesh17684

New User


Joined: 08 Oct 2006
Posts: 60
Location: San Diego

PostPosted: Wed Feb 18, 2009 3:16 pm    Post subject:
Reply with quote

yes i did that, but the result was
Code:
PARMS ARE:   0000000000

I am gonna try reference modification for this particular variable. let me see how it comes out.
Back to top
View user's profile Send private message
aishwarya_20

New User


Joined: 19 Nov 2008
Posts: 57
Location: pune

PostPosted: Wed Feb 18, 2009 3:19 pm    Post subject:
Reply with quote

There are 2 options which you can try:-

1. Either pass value of Amount from JCL without quotes i.e. ..'47',998.88)

2. Or you recieve it in X(10) in the program.
Back to top
View user's profile Send private message
rakesh17684

New User


Joined: 08 Oct 2006
Posts: 60
Location: San Diego

PostPosted: Wed Feb 18, 2009 3:56 pm    Post subject:
Reply with quote

Quote:
1. Either pass value of Amount from JCL without quotes i.e. ..'47',998.88)

this gives me a JCL error for decimal values,

Quote:
2. Or you recieve it in X(10) in the program.


This worked fine but then i need to type cast to decimal values. for this i used NUMVAL function and now i am good to go.

Thanks for helping me out. Much appreciated

[/quote]
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. Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am
No new posts Call COBOL or PLI with a click from w... vaibhav gs All Other Mainframe Topics 1 Mon Apr 16, 2018 7:29 pm
No new posts LOW VALUES as a KEY juares castro DB2 10 Sat Apr 07, 2018 1:06 am
No new posts COBOL MVS options BiswajitDG COBOL Programming 8 Fri Apr 06, 2018 12:35 am
No new posts Duplicate PARM on OUTFIL sancraig16 SYNCSORT 11 Thu Apr 05, 2018 10:25 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us