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
 

 

Modifying a data set Using OUTREC..

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ajay_udl

New User


Joined: 10 Oct 2006
Posts: 29

PostPosted: Tue Oct 10, 2006 9:13 pm    Post subject: Modifying a data set Using OUTREC..
Reply with quote

Hello all,

I have one query on OUTREC fields.

One dataset with LRECL '258' is there i have to add two new fields at the end, both are of S9(9). ie; 18bytes will be added and the file LRECL will be increased to 276. The new fields should be filled with zeros, containing a Sign digit.

i have given the SYSIN command as below.

SYSIN DD *
SORT FIELDS =COPY
OUTREC FIELDS=(1:1,258,C'000000000000000000')
*/

The above sysin works but it will fill zeros in the fields, no sign digit were appeared.

How do we give a sign thru OUTREC fields??

it's urgent any one please resond on the same, since it seems to be simple, but i'm not that good in SORT fields.. kindly help me.

Thanks
Ajay.
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 Oct 10, 2006 10:36 pm    Post subject:
Reply with quote

Quote:
The above sysin works but it will fill zeros in the fields, no sign digit were appeared.


S9(9) is a 9-byte ZD field. The sign of F (F0 in the last byte) is valid for ZD, but given what you've said, I guess you want a C sign, not an F sign.

You can use this DFSORT job to get what you want:

Code:

//S1    EXEC  PGM=ICEMAN                                         
//SYSOUT    DD  SYSOUT=*                                         
//SORTIN DD DSN=...  input file                             
//SORTOUT DD DSN=...  output file                                     
//SYSIN    DD    *                                               
  SORT FIELDS=COPY                                               
  OUTREC OVERLAY=(259:+0,TO=ZDC,LENGTH=9,+0,TO=ZDC,LENGTH=9)     
/*
Back to top
View user's profile Send private message
ajay_udl

New User


Joined: 10 Oct 2006
Posts: 29

PostPosted: Wed Oct 11, 2006 2:07 pm    Post subject: Re: Modifying a data set Using OUTREC..
Reply with quote

Thanks for ur quick reply frank, but it still giving a syntax error on OUTREC.

My output file will be having the fields filled with zeros, as shown below.

-----------------
PT-FORFED DISPLAY 00000000{
9/SNUM 0
PT-LATMT DISPLAY 00000000{
9/SNUM 0
-----------------

Actually as per you said 'ZDC' should work, but here OUTREC is creating a syntax error.

It will be helpful if ur gving ur valuable comments on this matter.

Many thanks
Ajay.
Back to top
View user's profile Send private message
ajay_udl

New User


Joined: 10 Oct 2006
Posts: 29

PostPosted: Wed Oct 11, 2006 3:16 pm    Post subject: Re: Modifying a data set Using OUTREC..
Reply with quote

Here i'm using SYNCSORT.

Is that the problem, so that i'm getting syntax error on OUTREC?


"WER268A OUTREC STATEMENT : SYNTAX ERROR "

that was the msg populated in SYSOUT.

IF ur finding any solution please reply.

Thanks
Ajay.
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Wed Oct 11, 2006 4:37 pm    Post subject: Re: Modifying a data set Using OUTREC..
Reply with quote

Hi Ajay,

I think in your shop, Overlay is not supported.

You can use the following code:
Slight modification of your code.
Code:

//jobname  JOB ...............   
//*                                               
//STEP001 EXEC PGM=SORT                           
//SORTIN   DD   DSN=input ddname 
//SORTOUT  DD   DSN=output ddname
//SYSIN    DD   *                                 
SORT FIELDS=COPY                                   
OUTREC  FIELDS=(1:1,258,8X'F0',X'C0',8X'F0',X'C0')               
//SORTOUT  DD   SYSOUT=*                           
//SYSOUT   DD   SYSOUT=*                           
Back to top
View user's profile Send private message
ajay_udl

New User


Joined: 10 Oct 2006
Posts: 29

PostPosted: Wed Oct 11, 2006 6:55 pm    Post subject:
Reply with quote

Hai Surya,

First of all the above thing really worked, thanks for ur support.

If my file is of 344 LRECL and i need to add two s9(9) COMP-3 (5bytes each)at the end, the file length will increase to 354.

what will be the sort condition for COMP-3 variable??

I think the procedure would be same, but syntax will be different rt??
I just need to fill zero in those fields.

Could you please help me in this regard.

Thanks
Ajay.
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 Oct 11, 2006 8:41 pm    Post subject:
Reply with quote

Quote:
Thanks for ur quick reply frank, but it still giving a syntax error on OUTREC.


The job works fine with DFSORT.

Quote:
Here i'm using SYNCSORT.

Is that the problem, so that i'm getting syntax error on OUTREC?


Yes, that's the problem.
Back to top
View user's profile Send private message
ajay_udl

New User


Joined: 10 Oct 2006
Posts: 29

PostPosted: Wed Oct 11, 2006 11:59 pm    Post subject:
Reply with quote

Hi Surya,

Can you please provide an update for the above given qtn on Comp-3 varible.?

it would helpful for me if i'm getting an answer from you.

Thanks
Ajay.
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Thu Oct 12, 2006 3:39 pm    Post subject: Re: Modifying a data set Using OUTREC..
Reply with quote

ajay,

This is for comp-3.

Code:

OUTREC  FIELDS=(1:1,344,4X'00',X'0C',4X'00',X'0C')
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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


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