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
 

 

Junk chars preceding parameter passed from JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Junk chars preceding parameter passed from JCL
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    Post subject: Re: Junk chars preceding parameter passed from JCL
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    Post subject: Re: Junk chars preceding parameter passed from JCL
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

Moderator Team Head


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

PostPosted: Tue Jun 14, 2005 2:27 pm    Post subject: Re: Junk chars preceding parameter passed from JCL
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    Post subject:
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    Post subject: Re: Junk chars preceding parameter passed from JCL
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Can DFSPARM override SORTKEYS paramet... ashek15 DB2 2 Tue Jan 31, 2017 11:36 pm
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
No new posts DDNAME parameter mistah kurtz JCL & VSAM 6 Mon Dec 19, 2016 4:41 pm
No new posts Execessive parameter issue Sumeendar JCL & VSAM 5 Mon Dec 19, 2016 4:35 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am


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