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
 
how to add the fields

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

Active User


Joined: 24 Nov 2005
Posts: 121
Location: Tadepalligudem

PostPosted: Tue Feb 07, 2006 2:43 pm    Post subject: how to add the fields
Reply with quote

Hi,

I am having a file with 5 fileds of input, each of 2 characters length......

1010101010

and I have to add each field and add the sum to the end of the record....

so my output should be like...

101010101050

I need to do this only in JCL but not thru COBOL..
is there any chances of making it thru sort only, but not thru icetool.

Thanks,
Rajesh.
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Feb 07, 2006 3:11 pm    Post subject:
Reply with quote

Can you use REXX ?

O.
Back to top
View user's profile Send private message
rajesh_1183

Active User


Joined: 24 Nov 2005
Posts: 121
Location: Tadepalligudem

PostPosted: Tue Feb 07, 2006 3:14 pm    Post subject:
Reply with quote

No Mr.O

Rajesh.
Back to top
View user's profile Send private message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Tue Feb 07, 2006 4:27 pm    Post subject:
Reply with quote

Hi,

i am not sure this is the optimal way to do it.
But this does what you want.
Code:

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                               
1010101010                                             
1010101010                                             
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                     
  OUTREC FIELDS=(1,11,((1,2,ZD,ADD,3,2,ZD),             
                 ADD,(5,2,ZD,ADD,7,2,ZD)),ADD,9,2,ZD)   
/*                                                     
//                                                     

This gives the out put as
Code:

1010101010              50
1010101010              50


Regards,
Back to top
View user's profile Send private message
rajesh_1183

Active User


Joined: 24 Nov 2005
Posts: 121
Location: Tadepalligudem

PostPosted: Tue Feb 07, 2006 5:21 pm    Post subject:
Reply with quote

Hi fixdoubts,

Please fix the error...it is saying POSITIONAL PARAMETER 1 is not valid
POSITIONAL PARAMETER 2 is not valid
POSITIONAL PARAMETER zd is not valid
POSITIONAL PARAMETER ADD is not valid
ADD should have SEQNUM

................when we are doing JJ

and also how u got that 50 at the end...could u explain it...

Thanks,
Rajesh
Back to top
View user's profile Send private message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Tue Feb 07, 2006 5:46 pm    Post subject:
Reply with quote

Hi,

Could you pls post your job. your are saying its giving error for SYSIN i have not encountered any errors while doing a JJ for any SYSIN errors.

As far as the position of 50 is concerned it will copy the first 11 character from the input (1,11) the rest is the out come of the ADD statements.

Regards,
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: Tue Feb 07, 2006 10:22 pm    Post subject:
Reply with quote

Rajesh,

The following DFSORT job will do what you asked for. It adds the 5 fields as 2-byte ZD values and puts the result in positions 11-12 as a 2-byte ZD value.

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1010101010
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  INREC OVERLAY=(11:1,2,ZD,ADD,3,2,ZD,ADD,5,2,ZD,ADD,
                 7,2,ZD,ADD,9,2,ZD,TO=ZD,LENGTH=2)
/*
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: Tue Feb 07, 2006 10:24 pm    Post subject:
Reply with quote

Quote:
Please fix the error...it is saying POSITIONAL PARAMETER 1 is not valid


Those are certainly not DFSORT error messages. What program are you using? Please show the complete message log.
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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm

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