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
 

 

Is it possible to SORT horizontally using JCL

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

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Fri Apr 13, 2007 10:29 pm    Post subject: Is it possible to SORT horizontally using JCL
Reply with quote

Is it possible to SORT horizontally using JCL.

Input given as
CAT RAT PAT MAT ACT
TAR BAR CAR AIR RAR

should be sorted to give

ACT CAT MAT PAT RAT
AIR BAR CAR RAR TAR
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: Fri Apr 13, 2007 11:20 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. You get extra points for including my favorite pet (RAT) in your data. icon_biggrin.gif

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file (FB/25)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/25)
//TOOLIN   DD    *
COPY FROM(IN) USING(CTL1)
SORT FROM(T1) TO(T2) USING(CTL2)
SPLICE FROM(T2) TO(OUT) ON(26,8,ZD) -
  WITHEACH WITH(6,5) WITH(11,5) WITH(16,5) WITH(21,5) USING(CTL3)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,
    BUILD=(1,5,1,5,1,5,1,5,1,5,SEQNUM,8,ZD,/,
           6,5,6,5,6,5,6,5,6,5,SEQNUM,8,ZD,/,
          11,5,11,5,11,5,11,5,11,5,SEQNUM,8,ZD,/,
          16,5,16,5,16,5,16,5,16,5,SEQNUM,8,ZD,/,
          21,5,21,5,21,5,21,5,21,5,SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
  SORT FIELDS=(26,8,ZD,A,1,5,CH,A)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,BUILD=(1,25)
/*
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Sat Apr 14, 2007 11:17 pm    Post subject: Job failed
Reply with quote

Hi,
This job is failing for me with ABEND code U016.

CALLER-PROVIDED IDENTIFIER IS "0001"
OUTFIL STATEMENT : SYNTAX ERROR

This was the message for SORT.

Let me check

thanks anyways
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Apr 14, 2007 11:27 pm    Post subject:
Reply with quote

Hello,

You need to post the entire sysout from the sort - not just some part of it. . .
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Sat Apr 14, 2007 11:36 pm    Post subject: the full SYSOUT
Reply with quote

SYNCSORT FOR Z/OS 1.1BRI TPF3A U.S. PATENTS: 4210961, 5117495 (C) 2002 SYNC
z/OS 1.6.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 8D27F, MODEL 2084 309 LICEN
CTL1CNTL :
OUTFIL FNAMES=T1, 0015000
BUILD=(1,5,1,5,1,5,1,5,1,5,SEQNUM,8,ZD,/, 0016000
*
6,5,6,5,6,5,6,5,6,5,SEQNUM,8,ZD,/, 0017000
11,5,11,5,11,5,11,5,11,5,SEQNUM,8,ZD,/, 0018000
16,5,16,5,16,5,16,5,16,5,SEQNUM,8,ZD,/, 0019000
21,5,21,5,21,5,21,5,21,5,SEQNUM,8,ZD) 0020000
WER428I CALLER-PROVIDED IDENTIFIER IS "0001"
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Apr 15, 2007 1:51 am    Post subject:
Reply with quote

Hello,

The messages describe your situation. . .

You are using Syncsort - the posted solution is for DFSORT.
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Mon Apr 16, 2007 11:11 am    Post subject: Re: Is it possible to SORT horizontally using JCL
Reply with quote

Yes i am using SYNCSORT icon_sad.gif
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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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