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
 

 

need clarification in outrec

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

Active User


Joined: 19 Mar 2009
Posts: 176
Location: Pune, Maharashtra, India

PostPosted: Fri Sep 02, 2011 11:37 pm    Post subject: need clarification in outrec
Reply with quote

in my sort card, i am using outrec with outfil.

Code:
OUTREC=(X:Y,L)
X = refers to the starting position of output field
Y = refers to the starting position of the corresponding input field


but i am confused about L : is this the length of the input field or output field ?

as in input file if some field like NAME which starts from 10th position and length 12 whereas same field starts at 15th position in the output field but layout shows it has max length of 8 bytes.

then shall i write the outrec as
Code:
OUTREC=(15:10,12) OR OUTREC=(15:10,8)

Also what in case if i want to put spaces or zeros at BRANCH-NO field having S9(9) COMP-3 starting at 10th position & length 5 bytes in the output file ?

shall i write
Code:
OUTREC=(10:5X)
?
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: Sat Sep 03, 2011 1:15 am    Post subject:
Reply with quote

Quote:
L : is this the length of the input field or output field ?


Yes.

L refers to the input length but for X:Y,L it will also be used as the output length, so if you want a different output length then the input length, you need to truncate or pad accordingly. For something like X:Y,L,F,TO=ZD,LENGTH=N, L is the input length and N is the output length.

Quote:

as in input file if some field like NAME which starts from 10th position and length 12 whereas same field starts at 15th position in the output field but layout shows it has max length of 8 bytes.


Code:

    OUTREC=(15:10,12)


will put input positions 10-21 in output positions 15-26.

Code:

  OUTREC=(15:10,8)


will put input positions 10-17 in output positions 15-22.

10:5X would give you spaces in output positions 10-14.

10:5Z would give you binary zeros in output positions 10-14.

10:X'000000000C' would give you a PD 0 in positions 10-14

10:+0,TO=PD,LENGTH=5 would also give you a PD 0 in positions 10-14.
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 176
Location: Pune, Maharashtra, India

PostPosted: Sun Sep 04, 2011 12:15 pm    Post subject: Reply to: need clarification in outrec
Reply with quote

Hi Frank,
Thanks for the info.
I tried to truncate the input using outrec but its not working.

i have DOB at 105th position in input file in 9(08) and corresponding output field is at 41st position and type S9(09) COMP-3,

I tried the below ways but it gives me syntax error:
Code:
1. 41:105,8,F,TO=PD,LENGTH=5
2. 41:105,TO=PD,LENGTH=5
3. 41:105,8,TO=PD,LENGTH=5

but none of the above worked for me icon_sad.gif
Can you please guide me over this if i am going wrong somewhere ?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Sun Sep 04, 2011 12:23 pm    Post subject: Reply to: need clarification in outrec
Reply with quote

Can you show your whole OUTREC card and the output messages with the error?
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 176
Location: Pune, Maharashtra, India

PostPosted: Sun Sep 04, 2011 12:39 pm    Post subject:
Reply with quote

Code:
INREC OVERLAY=(601:DATENS=(MD4),601,8,ZD,PD,LENGTH=5)               
 SORT FIELDS=COPY                                                     
 OMIT COND=(1,3,CH,EQ,C'HDR',OR,1,3,CH,EQ,C'TLR')                     
 OUTFIL FNAMES=SORTOF01,REMOVECC,                                     
 HEADER1=(1:4X,5:5X,10:609,5,15:3X,18:609,5,23:'HDR',26:10X,36:365X),
 OUTREC=(1:1,4,5:5,5,10:5X,15:3X,18:10X,28:12,4,32:X,33:10,2,35:X,   
         36:5X,41:+0,TO=PD,LENGTH=5,46:445,8,TO=PD,LENGTH=7,53:348X),
                                             £               


Temporarily i have kept zeros at 41st position in the output file for length zeros, now similar problem occured while copying from 445th position [S9(13)V99 COMP-3] into the 46th position in the output having S9(13) COMP-3.

Help needs in both the scenarios: icon_sad.gif

1. copying from 9(8) to S9(9) COMP-3 field
2. copying from S9(13)V99 COMP-3 to S9(13) COMP-3.
[/code]
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 176
Location: Pune, Maharashtra, India

PostPosted: Sun Sep 04, 2011 1:51 pm    Post subject:
Reply with quote

Is this info enough Bill ?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Sun Sep 04, 2011 2:30 pm    Post subject: Reply to: need clarification in outrec
Reply with quote

OK. In the example Frank used, a literal became a packed decimal. Now you want "something" to become packed decimal, but DFSORT needs to know what the "something" is to start with, and if it is numbers, presumably it is Zoned Decimal.

If you try
Code:
41:105,8,ZD,TO=PD,LENGTH=5


then DFSORT will know what it is turning into a packed field, so it will be able to do it.
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 176
Location: Pune, Maharashtra, India

PostPosted: Sun Sep 04, 2011 5:00 pm    Post subject:
Reply with quote

thanks Frank ...

Let me correct my syntax ..

and what about
Code:
copying from S9(13)V99 COMP-3 to S9(13) COMP-3
?

SHall i try something like this
Code:
41:105,8,PD,LENGTH=7
OR anything else ?
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 176
Location: Pune, Maharashtra, India

PostPosted: Sun Sep 04, 2011 5:12 pm    Post subject:
Reply with quote

Thanks Bill n Frank...

Above solution is working fine...

Now need help for
Code:
copying from S9(13)V99 COMP-3 to S9(13) COMP-3
?
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 176
Location: Pune, Maharashtra, India

PostPosted: Sun Sep 04, 2011 5:17 pm    Post subject:
Reply with quote

As per above suggestions:

i tried below formatting
Code:
46:445,8,PD,TO=PD,LENGTH=7


And it worked... thanks both of you and thanks IBMMAINFRAMES !!!
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Sun Sep 04, 2011 9:10 pm    Post subject: Reply to: need clarification in outrec
Reply with quote

Have you checked your figures? I think what you sort card will have done is retain the decimal places and truncate at the left.

If you want to get rid of decimals, division works. To get rid of two decimals, divide by +100.
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- outrec ram_vizag DFSORT/ICETOOL 10 Tue Sep 27, 2016 12:50 am
No new posts OUTREC FILELDS FAILS WITH ICE126A 2 ... balaji81_k DFSORT/ICETOOL 8 Sat Jul 02, 2016 1:22 am
No new posts OUTREC RDW NOT INCLUDED krsenthil85 SYNCSORT 10 Fri May 06, 2016 3:22 am
No new posts Need clarification of VSAM FCT and DF... pkmurali CICS 15 Sun Apr 10, 2016 1:06 am
No new posts OUTREC on OUTFIL error rocky_balboa DFSORT/ICETOOL 4 Thu Aug 27, 2015 10:26 am


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