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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort -re4mat accts to 2 cols from a 'variable length' fi
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Length of Tape file Mohan Kothakota JCL & VSAM 9 Thu Apr 20, 2017 10:24 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm


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