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

Syncsort -re4mat accts to 2 cols from a 'variable length' fi


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
darkstar13

New User


Joined: 06 Nov 2008
Posts: 46
Location: Manila, Philippines

PostPosted: Fri Sep 03, 2010 5:54 am
Reply with quote

Hi all,

I have a fixed block file with account number entries like the following

Code:

1234567890123456789012345678901234567890123456789
-------------------------------------------------
10010001  10010002  10010003  10010004
10110001  10110002  10110003
10210001
10310001  10310005  10310021  10310042  10310123


although the file is FB, the number of accounts number to the right is variable. fields are padded with spaces to make it fixed block and the max occurrence of the account numbers to the right is 49.

I want to have an output that looks this:
Code:

10010001  10010001
10010001  10010002
10010001  10010003
10010001  10010004
10110001  10110001
10110001  10110002
10110001  10110003
10210001  10211001
10310001  10310001
10310001  10310005
10310001  10310021
10310001  10310042
10310001  10310123


as you see, the first 8 bytes is the primary account and all accounts to the right are secondary accounts. I want to have a list of primary and secondary accounts with the primary accounts on one column and the secondary accounts on the second column. the primary account repeats as the secondary account for each row.

is this possible through syncsort 1.3.3.2?

thanks!
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Fri Sep 03, 2010 7:25 am
Reply with quote

One possile solution (SORTOUT LRECL=18):

Code:
 INREC FIELDS=(001,10,001,08,/,001,10,011,08,/,001,10,021,08,/,
               001,10,031,08,/,001,10,041,08,/,001,10,051,08,/,
               001,10,061,08,/,001,10,071,08,/,001,10,081,08,/,
               001,10,091,08,/,001,10,101,08,/,001,10,111,08,/,
               001,10,121,08,/,001,10,131,08,/,001,10,141,08,/,
               001,10,151,08,/,001,10,161,08,/,001,10,171,08,/,
               001,10,181,08,/,001,10,191,08,/,001,10,201,08,/,
               001,10,211,08,/,001,10,221,08,/,001,10,231,08,/,
               001,10,241,08,/,001,10,251,08,/,001,10,261,08,/,
               001,10,271,08,/,001,10,281,08,/,001,10,291,08,/,
               001,10,301,08,/,001,10,311,08,/,001,10,321,08,/,
               001,10,331,08,/,001,10,341,08,/,001,10,351,08,/,
               001,10,361,08,/,001,10,371,08,/,001,10,381,08,/,
               001,10,391,08,/,001,10,401,08,/,001,10,411,08,/,
               001,10,421,08,/,001,10,431,08,/,001,10,441,08,/,
               001,10,451,08,/,001,10,461,08,/,001,10,471,08,/,
               001,10,481,08,/,001,10,491,08)
SORT FIELDS=COPY
OUTFIL FILES=OUT,OMIT=(11,1,CH,EQ,C' '),OUTREC=(1,18)


What this does is build one 18 byte record for each possible secondary account (including the first) with the primary account in pos 1-8 and the secondary account in pos 11-18. There will obviously be many, many records where the secondary account will be blank (equal to spaces). The OUTFIL OMIT process eliminates those records that contain a space where the secondary account would start.
Back to top
View user's profile Send private message
darkstar13

New User


Joined: 06 Nov 2008
Posts: 46
Location: Manila, Philippines

PostPosted: Fri Sep 03, 2010 7:47 am
Reply with quote

Hi Ronald, thanks for the solution.
I have been trying something like that as well, however,
I am getting syntax error on using the slash.
I think you can't use '/' on inrec. icon_sad.gif

I ran using your sort statement and I got syntax error as follows:
Code:

SYNCSORT FOR Z/OS  1.3.2.2R    U.S. PATENTS: 4210961, 5117495   (C
SYSIN :                                                           
   INREC FIELDS=(001,10,001,08,/,001,10,011,08,/,001,10,021,08,/,
                               *                                 
                 001,10,031,08,/,001,10,041,08,/,001,10,051,08,/,
                 001,10,061,08,/,001,10,071,08,/,001,10,081,08,/,
                 001,10,091,08,/,001,10,101,08,/,001,10,111,08,/,
.
.
.
WER268A  INREC 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
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Fri Sep 03, 2010 5:20 pm
Reply with quote

Ahhh,
Unfortunately, you are correct - after taking another look at the manual, I see that it does say that the n/ parameter can only be used on the OUTREC statement within an OUTFIL statement. I missed noting that restriction earlier. Sorry about that.

If you can live with doing it in TWO steps, however, you can do the INREC processing as OUTFIL OUTREC processing in step 1 and the OMIT processing in step 2.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top