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

Junk chars preceding parameter passed from JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bindunat

New User


Joined: 10 Jun 2005
Posts: 5

PostPosted: Tue Jun 14, 2005 10:16 am
Reply with quote

When i pass a parameter from JCL to a cobol program and try to print the recieved value in cobol, it displays two junk characters preceding the actual parameter. if the size mentioned was just right, then the last two bytes from the parm gets truncated. what is the reason for the junk characters? and how can it be avoided while passing the value from JCL itself?
Somebody please help me with this...
thanks in advance.
Back to top
View user's profile Send private message
j_prameela2000

New User


Joined: 01 Jun 2005
Posts: 28
Location: Chennai

PostPosted: Tue Jun 14, 2005 11:53 am
Reply with quote

Hi Bindunat,

The first two junk characters represents length of the actual data passed.
you can not avoid that. if you want to receive length you should declare s9(4) comp in linkage section where u delcare parm variables as the first varible where the length will be stored. If i am wrong, please correct me.
Back to top
View user's profile Send private message
j_prameela2000

New User


Joined: 01 Jun 2005
Posts: 28
Location: Chennai

PostPosted: Tue Jun 14, 2005 11:56 am
Reply with quote

Hi Bindunat,

When u declare length field in linkage section along with parm variables, then when u receive the parameters passed through parm will get displayed without any junk characters. If iam wrong correct me.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Jun 14, 2005 2:27 pm
Reply with quote

Bindunat, could you please post an example of your program and of the calling JCL.
Back to top
View user's profile Send private message
Girishm

New User


Joined: 09 Mar 2005
Posts: 35
Location: Mysore

PostPosted: Thu Jun 16, 2005 1:07 pm
Reply with quote

Hi bindu,

Let my detail U with an example:

Cobol code:
LINKAGE SECTION.
01 PARM-IN.
05 PARM-LENGTH PIC S9(4) COMP.
05 PARM-CENTURY PIC 99.
05 PARM-YEAR PIC 99.
05 PARM-PERIOD PIC 99.

and you are passing the parameter as PARM=200505 from the JCL

In the cobol program if you r trying to print PARM-IN, then as u said it will print junk chars before the actual data. But if you print PARM-CENTURY then it will display exact value that u have passed i.e, 20.
there is no way the parm gets truncated if you are passing correctly.

for the above code if ur parm is PARM=20050504, then obviously 04 get truncated, b'coz there is no declaration to receive that value in Linkage.

Hope this helps U. if not please brief with the code.
_________
GM
Back to top
View user's profile Send private message
Bindunat

New User


Joined: 10 Jun 2005
Posts: 5

PostPosted: Thu Jun 16, 2005 1:14 pm
Reply with quote

Problem was I did'nt declare the variable for length in the linkage section for recieving the parm. So i got junk data. Thanks to all for the help
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts DB2 Event passed to the Application P... DB2 1
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Demand with DEADLINE TIME parameter CA Products 4
No new posts Option DYNALLOC second parameter. DFSORT/ICETOOL 11
Search our Forums:

Back to Top