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

SORT issue when pivoting data


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

New User


Joined: 08 Oct 2006
Posts: 19
Location: Bangalore

PostPosted: Tue Apr 01, 2008 3:53 am
Reply with quote

Hello All,

I am trying to pivot the data from multiple fields and then I am sorting them. The sort works fine but it gives some unwanted character on the same line.

Let me explain further. I have an input file which has three fields.

NAME1 from 1 to 30
NAME2 from 31 to 70
NAME3 from 71 to 130.

I use the below JCL step to sort the data from the input file and then merge it into a single field of length 100.

//RUN001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DISP=SHR,DSN=Z930028.NAMEXREF.TEST.INPUT
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE),DISP=(,DELETE)
//OUT DD DSN=Z930028.SPLIT.NAMES.TEMP,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(10,10),RLSE),
// DCB=(LRECL=100,BLKSIZE=0,RECFM=FB,DSORG=PS)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
SELECT FROM(T1) TO(OUT) ON(1,60,CH) FIRST
/*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,OUTREC=(1,30,/,31,40,/,71,60)
/*

And in the output I get as

EDIT Z930028.SPLIT.NAMES.TEMP Columns 00001 00072
****** ***************************** Top of Data *****************************
==MSG> -CAUTION- Data contains invalid (non-display) characters. Use command
==MSG> ===> FIND P'.' to position cursor to these
000001 FIRSTNAME1 156
000002 FIRSTNAME10
000003 FIRSTNAME100
000004 FIRSTNAME1000 ME158
000005 FIRSTNAME10000
000006 FIRSTNAME1001
000007 FIRSTNAME1002 E160
000008 FIRSTNAME1003

I was not expecting to see 156, ME158 etc on the records. I do not have any record in the input as
FIRSTNAME1 156
I get this issue when the records in the input file are more than 9K. Even after running the JCL multiple times, I always get the same result.

Could any one suggest, what I can do to avoid the extra data in the output.

Thanks.

Sudhir
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Apr 01, 2008 4:53 am
Reply with quote

Have you dumped/displayed the original input to see if the unexpected output is actually in the input?
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: Tue Apr 01, 2008 5:14 am
Reply with quote

Since I don't know what your input records look like, it's difficult to say what's happening. I ran something like what you said you had and didn't get the result you got.

One thing I noticed is that you're building a 60-byte record with the COPY operator, but then you're using LRECL=100 for the SELECT output. You might try changing your OUTFIL statement to the following so the two output LRECLs match:

Code:

   OUTFIL FNAMES=T1,OUTREC=(1,30,100:X,/,31,40,/,71,60)


I don't know if that has anything to do with what you're seeing, but it's worth a try.

If that's not it, then I agree with CICS guy that you should take a look at your input records.

I'd need to see your DFSMSG output and have some idea of what's actually in your input records to help you any more with this.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Apr 01, 2008 5:55 am
Reply with quote

sudhirk63 wrote:
EDIT Z930028.SPLIT.NAMES.TEMP Columns 00001 00072
****** ***************************** Top of Data *****************************
==MSG> -CAUTION- Data contains invalid (non-display) characters. Use command
==MSG> ===> FIND P'.' to position cursor to these
000001 FIRSTNAME1 156
000002 FIRSTNAME10
000003 FIRSTNAME100
000004 FIRSTNAME1000 ME158
000005 FIRSTNAME10000
000006 FIRSTNAME1001
000007 FIRSTNAME1002 E160
000008 FIRSTNAME1003
Sudhir,

Didn't you notice that what you posted did not look anything like what you intended?
You did preview it first, didn't you?
What you intended was this:
Code:
==MSG> -CAUTION- Data contains invalid (non-display) characters. Use command 
==MSG>           ===> FIND P'.' to position cursor to these                   
000001 FIRSTNAME1                                                  156       
000002 FIRSTNAME10                                                           
000003 FIRSTNAME100                                                           
000004 FIRSTNAME1000                                               ME158     
000005 FIRSTNAME10000                                                         
000006 FIRSTNAME1001                                                         
000007 FIRSTNAME1002                                               E160       
000008 FIRSTNAME1003                                                         
.......0000000001111111111222222222233333333334444444444555555555566666666667
.......1234567890123456789012345678901234567890123456789012345678901234567890
(I added the column counts)
Next time post 'code' with the code tags........
Looks like Franks solution should work, getting rid of the possibility of garbage in undefined portions of the output record......
Back to top
View user's profile Send private message
sudhirk63

New User


Joined: 08 Oct 2006
Posts: 19
Location: Bangalore

PostPosted: Wed Apr 02, 2008 6:51 pm
Reply with quote

Thanks Frank , your solution worked.
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 Store the data for fixed length COBOL Programming 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top