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
 

 

Initializing a packed decimal variable in INREC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
harsh singh

New User


Joined: 11 Dec 2007
Posts: 26
Location: INDIA

PostPosted: Tue Dec 11, 2007 8:31 pm    Post subject: Initializing a packed decimal variable in INREC
Reply with quote

My file has a record layout of 100 bytes, now I want to increase the LRECL to 120 bytes, the 20 bytes are defined as packed-decimal. Now I want to use this field in SORT:

//SYSIN DD*
OPTION COPY
INREC FEILDS=( ????)

Let the variable in SORTIN file is placed at position 10 and in SORTOUT at position 20.
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Dec 11, 2007 10:53 pm    Post subject: Reply to: Initializing a packed decimal variable in INREC
Reply with quote

harshsingh,

You can the following DFSORT control cards to initialize the packed decimal field

Code:

//SYSIN    DD *                         
  SORT FIELDS=COPY                       
  OUTREC OVERLAY=(101:+0,TO=PD,LENGTH=20)
//*                                     
Back to top
View user's profile Send private message
harsh singh

New User


Joined: 11 Dec 2007
Posts: 26
Location: INDIA

PostPosted: Wed Dec 12, 2007 3:16 pm    Post subject: Re
Reply with quote

hi Skolusu,
Thanks for the help but above code is not working .following message is displayed
E1 - DSS10065E - PARAMETER 'TO' IS UNIDENTIFIED.
E2 - DSS10065E - PARAMETER 'LENGTH' IS UNIDENTIFIED.

Can u look in to this?
Back to top
View user's profile Send private message
harsh singh

New User


Joined: 11 Dec 2007
Posts: 26
Location: INDIA

PostPosted: Wed Dec 12, 2007 6:46 pm    Post subject: Re
Reply with quote

hi,
i tried with the below code and it worked
//SYSIN DD *
//SORT FEILDS =COPY
//INREC FEILDS(101:+0,LENGTH=0)
CAN U LOOK ON SAME PROBLEM WITH NUMERIC FEILD ????
I am not getting the correct order in o/p file, i used ZD in this case , anybody have some sujjestions??? u r welcome icon_smile.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Dec 12, 2007 10:00 pm    Post subject: Re: Re
Reply with quote

harsh singh wrote:
hi Skolusu,
Thanks for the help but above code is not working .following message is displayed
E1 - DSS10065E - PARAMETER 'TO' IS UNIDENTIFIED.
E2 - DSS10065E - PARAMETER 'LENGTH' IS UNIDENTIFIED.

Can u look in to this?


Harsh singh,

The error messages you show are NOT standard DFSORT error messages. DFSORT messages start with ICExxxx. I guess they are error messages from JCL check software. Try running the job as shown by me and post the sysout, if you dont get the desired results.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Dec 12, 2007 10:12 pm    Post subject:
Reply with quote

Kolusu,

I think the above SORT card will add PD values from 101-120 while TS says
Quote:
Let the variable in SORTIN file is placed at position 10 and in SORTOUT at position 20.


Perhaps he wants to add PD fields in start of SORTOUT.

I tried your solution at my shop, JOB ran successfully, no error message but the output contains only the initialized PD fields..
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Dec 12, 2007 10:25 pm    Post subject:
Reply with quote

[quote="Anuj D."]Kolusu,

I think the above SORT card will add PD values from 101-120 while TS says
Quote:
Let the variable in SORTIN file is placed at position 10 and in SORTOUT at position 20. Perhaps he wants to add PD fields in start of SORTOUT.


I am not sure what the actual requirement is


Quote:

I tried your solution at my shop, JOB ran successfully, no error message but the output contains only the initialized PD fields..


The job shown by me copies the contents the input file and also adds the initialized PD fields at the end. So the first 100 bytes is copied as is from the input file.

Did you remove the Position(101) field in my Job?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Dec 12, 2007 11:31 pm    Post subject:
Reply with quote

harsh,

Nobody can figure out what you're doing.

You posted this question in the DFSORT Forum so we assume you're using DFSORT. You posted these control statements which we assumed are DFSORT control statements (we assumed you meant FIELDS, not FEILDS):

Code:

//SYSIN DD*
  OPTION COPY
  INREC FEILDS=( ????)


You said
Quote:
Let the variable in SORTIN file is placed at position 10 and in SORTOUT at position 20.


It's not clear what this means.

You showed:

E1 - DSS10065E - PARAMETER 'TO' IS UNIDENTIFIED.
E2 - DSS10065E - PARAMETER 'LENGTH' IS UNIDENTIFIED.

These are NOT DFSORT messages.

You said

Quote:

i tried with the below code and it worked
//SYSIN DD *
//SORT FEILDS =COPY
//INREC FEILDS(101:+0,LENGTH=0)
CAN U LOOK ON SAME PROBLEM WITH NUMERIC FEILD ????


DFSORT control statements cannot start with // and FEILDS is not a valid operand.

You said
Quote:
I am not getting the correct order in o/p file, i used ZD in this case


It's not clear what this means or what it has to do with the original requirement.

YOU need to state clearly what you are trying to do before anyone can help you. Show your complete JCL and control statements. Show an example of the records in the input file (relevant fields only) and what you expect for output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input file.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Dec 13, 2007 12:09 pm    Post subject:
Reply with quote

Quote:
Did you remove the Position(101) field in my Job?

No I didn't do that.

My input was of LRECL 80 & I use '101+' for SORTOUT with LRECL 120..so total 40 bytes were added..& I overlooked the data..as I pressed F11 (perhaps) & saw only the dots (...), when browsed the file, as intialized place holder for PD values, due to this worte the query to you right away.. icon_redface.gif ..sorry to bother you.

But I got one query here now, in above scenario, i.e.if I use
Code:
//SYSIN    DD *                         
  SORT FIELDS=COPY                       
  OUTREC OVERLAY=(101:+0,TO=PD,LENGTH=20)
//*   


But SORTIN is of LRECL 80 then what type of data-type will be there in 80-100 field position?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Dec 13, 2007 10:08 pm    Post subject:
Reply with quote

Quote:
what type of data-type will be there in 80-100 field position?


Blanks. (You could have tried it yourself.)
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Dec 14, 2007 11:41 am    Post subject:
Reply with quote

Thank Frank. Yeah I tried it, but was bit skeptical about it.
Back to top
View user's profile Send private message
harsh singh

New User


Joined: 11 Dec 2007
Posts: 26
Location: INDIA

PostPosted: Mon Dec 17, 2007 10:59 am    Post subject:
Reply with quote

i am sorry dor the typing mistakes i did [like FIELDS& OTHER] MY APOLOGY FOR IT.

Definitely i am using DFS Sort in my pgm.File 1 has RL:
01 FILE1-RECORD.
05 ADDRESSLINE-1 PIC X(10).
05 ADDRESSLINE-2 PIC X(10).
05 NAME PIC X(10).
05 WORK-PHONE PIC 9(10).
05 HOME-PHONE PIC 9(10).
05 OCCUPATION PIC X(15).
05 STATE PIC X(5).
05 COUNTRY-CODE PIC X(10).
05 FILLER PIC X(20).

FILE1 is 100 byte file .
now i want to increase RL to 120 bytes by adding below two comp feilds

01 FILE1-RECORD.
05 ADDRESSLINE-1 PIC X(10).
05 ADDRESSLINE-2 PIC X(10).
05 SIR-NAME PIC S9(10) COMP-3.
05 NAME PIC X(10).
05 LAST-NAME PIC S9(10) COMP-3.
05 WORK-PHONE PIC 9(10).
05 HOME-PHONE PIC 9(10).
05 OCCUPATION PIC X(15).
05 STATE PIC X(5).
05 COUNTRY-CODE PIC X(10).
05 FILLER PIC X(20).

Below is the controle card which i am supplying to my job .

INREC FIELDS=(1:1,10, ADDRESSLINE-1
11:10,10, ADDRESSLINE-2
21:+0,TO=PD,LENGTH=10,
31:20,10, NAME
41:+0,TO=PD,LENGTH=10,
51:30,10, WORK-PHONE
61:40,10, HOME-PHONE
71:50,15, OCCUPATION
86:65,5, STATE
91:70,10, COUNTRY-CODE
101:80,20) FILLER

He i do !JACK i get MAXCC=8 with the following message

AE1 - DES10065E - PARAMETER 'TO' IS UNIDENTIFIED.
E2 - DSS10065AE - PARAMETER 'LENGTH' IS UNIDENTIFIED.

.Please look over this issue
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Dec 17, 2007 8:23 pm    Post subject:
Reply with quote

Hello,

As was previously posted, the DES/DSS messages do not come from DFSORT. If you post all of the sysout data from this step it will probably help us understand.

Why are SIR-NAME and LAST-NAME defined as comp-3? This looks invalid. . . Names are typically not numeric. . . icon_confused.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Dec 17, 2007 9:54 pm    Post subject:
Reply with quote

You cannot use these types of declared variables (e.g. ADDRESSLINE-1) directly in a DFSORT INREC statement. You must be using another program that interprets these statements. It's not clear what that other program does, but it obviously doesn't support all of DFSORT's syntax (like the TO= function).

If you used DFSORT directly rather than through this program, you could use all of the DFSORT syntax. You could also use DFSORT Symbols mapped to the declares.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts OPC JCL Variable passion_sujesh IBM Tools 5 Fri Jul 01, 2016 4:21 am
No new posts JOINKEYs and Variable files migusd SYNCSORT 8 Fri Jun 17, 2016 3:16 am


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