IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

need clarification in outrec


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Fri Sep 02, 2011 11:37 pm
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 Developer


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

PostPosted: Sat Sep 03, 2011 1:15 am
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: 206
Location: Globe, India

PostPosted: Sun Sep 04, 2011 12:15 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Sep 04, 2011 12:23 pm
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: 206
Location: Globe, India

PostPosted: Sun Sep 04, 2011 12:39 pm
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: 206
Location: Globe, India

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

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Sep 04, 2011 2:30 pm
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: 206
Location: Globe, India

PostPosted: Sun Sep 04, 2011 5:00 pm
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: 206
Location: Globe, India

PostPosted: Sun Sep 04, 2011 5:12 pm
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: 206
Location: Globe, India

PostPosted: Sun Sep 04, 2011 5:17 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Sep 04, 2011 9:10 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
No new posts Sort w/OUTREC Question DFSORT/ICETOOL 2
No new posts Getting OUTREC - SHORT REC error for ... DFSORT/ICETOOL 12
No new posts Issues with outrec overlay while extr... SYNCSORT 7
No new posts SEQNUM with TRA=ETOA in OUTREC SYNCSORT 5
Search our Forums:

Back to Top