Sort and line spacing

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
blkraven1
Member
Posts: 5
Joined: Mon Oct 24, 2011 5:46 pm
Location: Annapolis

Sort and line spacing

Post by blkraven1 » Mon Oct 24, 2011 6:29 pm

Hello,

I am new to programming and the sort command. I have a file that looks like the one below. The data for one record is on two seperate lines. I need it all to be on the same line with the record type and amounts together. Is there a way to do this using the sort command or any other way?

Before:

Code: Select all

LGM01 07 GENERAL  ACCT
                               $200,305.16-                          $200,305.16
LGM01 08 GENERAL  ACCT
                               $114,092.88                           $143,518.42
LGM01 09 GENERAL  ACCT
                                $88,059.36                            $93,025.31
LGM01 10 GENERAL ACCT
                               $210,602.05                           $345,670.63
After:

Code: Select all

A000107GENERAL ACCT $200,305.16-                        $200,305.16
A000108GENERAL ACCT $114,092.88                         $143,518.42
A000109GENERAL ACCT $88,059.36                          $93,025.31
A000111GENERAL ACCT $210,602.05                         $345,670.63

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Mon Oct 24, 2011 8:46 pm

Refer to the "Create large records from small records" of the SORT TRICK Publication.
RESIZE operator of ICETOOL.
It appears that it may apply

Frank has provided many links to DFSORT publications as 'stickys' in the DFSORT forum,
or simply DFSORT, ICETOOL and UTILITIES
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Mon Oct 24, 2011 10:29 pm

blkraven1,

If you need more specific help, you need to state your requirement more clearly.

What is the RECFM and LRECL of your input file and expected output file?

What is the starting position and length of each field in the input records and expected output records?

Why do the output records have A0001 whereas the input records have LGM01?

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

blkraven1
Member
Posts: 5
Joined: Mon Oct 24, 2011 5:46 pm
Location: Annapolis

Post by blkraven1 » Tue Oct 25, 2011 7:28 pm

I am getting a RC=12 in my JCL. It looks like its pointing to TOOLIN but when I try to use it I get the error of invalid JCL statement:

174 XXTOOLIN DD *
175 XXSYSIN DD DSN=&PMS..&SYS..SYSIN(RESIZE),DISP=SHR

*****

STMT NO. MESSAGE
8 IEFC001I PROCEDURE A6XXX8 WAS EXPANDED USING PRIVATE LIBRARY
174 IEFC601I INVALID JCL STATEMENT


Below is where I removed the TOOLIN statement:

//************************************************************
//* JCL STEP *
//*****************************************************************
//NEW EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=LGM.J925.REPORTA,DISP=SHR (FB/200)
//OUT1 DD DSN=LGM.J925.REPORTB.OUT, (FB/100)
// UNIT=SYSDA,
// SPACE=(CYL,(3,1),RLSE),
// DCB=(RECFM=FB,LRECL=0,BLKSIZE=0),
// DISP=(NEW,CATLG,DELETE)
//SYSIN DD DSN=LGM.SOURCE.CODE.SYSIN(RESIZE),DISP=SHR
*************************************************************
SYSIN
EDIT LGM.SOURCE.CODE.SYSIN(RESIZE)
Command ===>
****** ***************************** Top of Data ****
000001 RESIZE FROM(IN1) TO(OUT1) TOLEN(100)
****** **************************** Bottom of Data **

*************************************************************THE FILE IS CREATED BUT DOESN’T GET POPULATED – I AM GETTING A TOOLIN ERROR
********************************************************************
WER108I SORTIN : RECFM=FBA ; LRECL= 133; BLKSIZE= 27930
WER110I SORTOUT : RECFM=FB ; LRECL= 200; BLKSIZE= 27800
WER462I OUTPUT LRECL DIFFERS FROM SORTOUT LRECL
WER055I INSERT 0, DELETE 372
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER054I RCD IN 1488, OUT 1116
WER169I RELEASE 1.3 BATCH 0513 TPF LEVEL 2.2
WER052I END SYNCSORT - AXXXXET,S60AA8,SRT9070A,DIAG=A400,730C,8882,0044,EC7E,
SYT000I SYNCTOOL RELEASE 1.6.2 - COPYRIGHT 2007 SYNCSORT INC.
SYT001I INITIAL PROCESSING MODE IS "STOP"
SYT002I "TOOLIN" INTERFACE BEING USED

SYT006E NO "TOOLIN" DD STATEMENT FOUND

SYT004I SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 12

Do you have any advice or suggestions that would help. This tool appears to be what I need but not sure shy Toolin statement doesn't work. Thanks

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Tue Oct 25, 2011 7:39 pm

You are using Syncsort not DFSORT. . .

You need to post the completely expanded PROCedure showing the generated statement numbers. Your post is confusing as the error occurred when a PROC was executed, but the job step is not in a PROC. . . :?

The process son't work without a TOOLIN DD statement.
Have a good one

blkraven1
Member
Posts: 5
Joined: Mon Oct 24, 2011 5:46 pm
Location: Annapolis

Post by blkraven1 » Tue Oct 25, 2011 8:28 pm

Sorry about the confusion. If I am using Syncsort will it still work? Also, it I want o use a proc how would I code it? Thanks

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Tue Oct 25, 2011 9:25 pm

The example containing the error WAS when a PROC was executed. . .

Why did you post the problem output (and this was most incomplete) from the proc run if you want to use inline jcl?
If I am using Syncsort will it still work?
Done correctly, it should work.
THE FILE IS CREATED BUT DOESN’T GET POPULATED

The jcl instructed the system to catalog the dataset if the step did not abend. The step did not abend, so the empty file was cataloged.

You are running in circles and need to decide on which way you want the process to run - proc or inline and proceed from there.
Have a good one

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Tue Oct 25, 2011 10:03 pm

>If I am using Syncsort will it still work?

Done correctly, it should work.
Really? RESIZE is a "newish" DFSORT/ICETOOL operator. Have you checked to see if Syncsort actually supports the RESIZE operator?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

blkraven1
Member
Posts: 5
Joined: Mon Oct 24, 2011 5:46 pm
Location: Annapolis

Post by blkraven1 » Tue Oct 25, 2011 10:38 pm

Frank,

Apologies for causing any confusion. You referred me to a DFSORT Trick manual pointing to code that I could possibly use for my file. I tried the code below at first inline after it did not work I thought that I should use a proc (not sure why). Anyway, I appreciate all of your help and if this is not the format/place for a newbie then please let me know. This site was suggested by a coworker as being a very reliable and good source of information. Thanks Again

//*
//********************************************************
//DAFRNEW EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=LGM.SYS.J998.AFR9070.FILE,DISP=SHR (FB/200)
//OUT1 DD DSN=LGM.SYS.J998.AFR9070.OUT, (FB/100)
// UNIT=SYSDA,
// SPACE=(CYL,(3,1),RLSE),
// DCB=(RECFM=FB,LRECL=0,BLKSIZE=0),
// DISP=(NEW,CATLG,DELETE)
//TOOLIN DD *
RESIZE FROM(IN1) TO(OUT1) TOLEN(100)


This is the error that I receive at the bottom of the output after running the above.

171 XXDFSMSG DD SYSOUT=*
172 XXIN1 DD DSN=LGM.J998.AFR9070.FILE,DISP=SHR
173 XXOUT1 DD DSN=LGM.J998.AFR9070.OUT,
XX UNIT=SYSDA,
XX SPACE=(CYL,(3,1),RLSE),
XX DCB=(RECFM=FB,LRECL=0,BLKSIZE=0),
XX DISP=(NEW,CATLG,DELETE)
174 XXTOOLIN DD *
175 RESIZE FROM(IN1) TO(OUT1) TOLEN(100)

STMT NO. MESSAGE
174 IEFC601I INVALID JCL STATEMENT
175 IEFC601I INVALID JCL STATEMENT

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Tue Oct 25, 2011 11:03 pm

if this is not the format/place for a newbie then please let me know
This is a good place for these questions. It would have been most helpful if you had posted that you were using Syncsort initially (preferable in the title) - then DFSORT suggestions would not have been made.
Done correctly, it should work.
My bad. . . I didn't mean to use resize, i meant this could be done with Syncsort. And no, even in the newest release of Syncsort, RESIZE is not n the manual.

From elsewhere:
I have a file with records like this:

Code: Select all

Unix: /test/ama/file01/rm_ext/daily/source/AMR_BIU_EU_R03_H20110303_H 
Unix: EDC_AMACAUBHSTAB.dat                                                      
Unix: /test/ama/file01/rm_ext/daily/source/AMR_BIU_EU_R03_H20110302_H 
Unix: EDC_AMACAUBHSTAB.dat                                                      
Unix: /test/ama/file01/rm_ext/daily/source/AMR_BIU_EU_R03_H20110301_H 
Unix: EDC_AMACAUBHSTAB.dat  


I want the output like this:

Code: Select all

Unix: /test/ama/file01/rm_ext/daily/source/AMR_BIU_EU_R03_H20110303_HEDC_AMACAUBHSTAB.dat  
Unix: /test/ama/file01/rm_ext/daily/source/AMR_BIU_EU_R03_H20110302_HEDC_AMACAUBHSTAB.dat      
Unix: /test/ama/file01/rm_ext/daily/source/AMR_BIU_EU_R03_H20110301_HEDC_AMACAUBHSTAB.dat 
Is this possible?
Thanks for your time.

Code: Select all

//SORT1 EXEC PGM=SORT                                                  
//SORTIN  DD *                                                        
UNIX: /TEST/AMA/FILE01/RM_EXT/DAILY/SOURCE/AMR_BIU_EU_R03_H20110303_H 
UNIX: EDC_AMACAUBHSTAB.DAT                                            
UNIX: /TEST/AMA/FILE01/RM_EXT/DAILY/SOURCE/AMR_BIU_EU_R03_H20110302_H 
UNIX: EDC_AMACAUBHSTAB.DAT                                            
UNIX: /TEST/AMA/FILE01/RM_EXT/DAILY/SOURCE/AMR_BIU_EU_R03_H20110301_H 
UNIX: EDC_AMACAUBHSTAB.DAT                                            
//SORTOUT DD SYSOUT=*                                                  
//SYSOUT  DD SYSOUT=*                                                  
//SYSIN   DD *                                                        
  INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(91:ID=8,99:SEQ=1)),        
        IFTHEN=(WHEN=(99,1,ZD,EQ,1),BUILD=(1,69,21Z,91,8)),            
        IFTHEN=(WHEN=NONE,BUILD=(69Z,7,21,91,8))                      
  SORT FIELDS=(91,8,ZD,A)                                              
  SUM FIELDS=(1,8,BI,9,8,BI,17,8,BI,25,8,BI,33,8,BI,41,8,BI,49,8,BI,  
    57,8,BI,65,8,BI,73,8,BI,81,8,BI,89,2,BI)                          
  OUTREC BUILD=(1,89)                                                  
/*   
Unless i've misunderstood something, this with proper modifications, should do what is wanted.
Have a good one

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Tue Oct 25, 2011 11:14 pm

blkraven1,

FYI: I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

blkraven1
Member
Posts: 5
Joined: Mon Oct 24, 2011 5:46 pm
Location: Annapolis

Syncsort for Z/OS 1.3.2.2R Question

Post by blkraven1 » Mon Oct 31, 2011 5:58 pm

Hello,
Please note that I am a newbie and have as for help before and have come upon some more problems. I am using Syncsort and my data currently looks like this and is uses 3 lines:
L0001 07 GENERAL FUND POP
$.00 $.00
$224,305.56- $224,305.56
L0001 08 GENERAL FUND POP
$.00 $9,481.54
$174,042.88 $183,524.42-
L0001 09 GENERAL FUND POP
$.00 $15,025.65
$58,059.36 $73,085.01-
*************************************************************I need it to look like the data below all needs to be on one line.
L0001 07 GENERAL FUND POP$.00 $.00 $224,305.56- $224,305.56
L0001 08 GENERAL FUND POP$.00 $9,481.54 $174,042.88 $183,524.42-
L0001 09 GENERAL FUND POP$.00 $15,025.65$58,059.36 $73,085.01-

I have used different examples from the manual but I continue to get an error. The record layout:
Name Postion Length:
Fund , 1-5 , 5
Year , 6-7 , 2
Descr ,9-23 , 15
Amt1 ,24-39 , 15
Amt2 , 40-45 , 15
Amt3 , 46-61 , 15
Amt4 , 62-77 , 15
Any advice would be helpful.
Thanks

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Mon Oct 31, 2011 9:56 pm

I have used different examples from the manual but I continue to get an error.
Do not post "it didn't work". . . This is a complete waste of everyone's time. Which error(s) are happening? If you do not post this, how are we to know/help?

You need to post the jcl and sort control statements as well as all of the diagnostic information generated by the run (including the message numbers).
Have a good one

academyindia4

Topic deleted by Admin

Post by academyindia4 » Mon Jan 25, 2016 9:56 pm

<< Content deleted By Admin >>

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others