Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

Google
 
Web mainframegurukul.com

Sort and line spacing

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
blkraven1
Member


Joined: 24 Oct 2011
Posts: 5
Location: Annapolis

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Oct 24, 2011 6:29 pm    Post subject: Sort and line spacing Reply with quote

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:

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:

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

dbzTHEdinosauer
Moderator


Joined: 02 Oct 2006
Posts: 981

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Oct 24, 2011 8:46 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Oct 24, 2011 10:29 pm    Post subject: Reply with quote

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?rs=114&uid=isg3T7000080
_________________
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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
blkraven1
Member


Joined: 24 Oct 2011
Posts: 5
Location: Annapolis

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Oct 25, 2011 7:28 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Oct 25, 2011 7:39 pm    Post subject: Reply with quote

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. . . Confused

The process son't work without a TOOLIN DD statement.
_________________
Have a good one
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
blkraven1
Member


Joined: 24 Oct 2011
Posts: 5
Location: Annapolis

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Oct 25, 2011 8:28 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Oct 25, 2011 9:25 pm    Post subject: Reply with quote

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?
Quote:

If I am using Syncsort will it still work?
Done correctly, it should work.

Quote:

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Oct 25, 2011 10:03 pm    Post subject: Reply with quote

Quote:
>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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
blkraven1
Member


Joined: 24 Oct 2011
Posts: 5
Location: Annapolis

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Oct 25, 2011 10:38 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Oct 25, 2011 11:03 pm    Post subject: Reply with quote

Quote:

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.
Quote:
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:
Quote:

I have a file with records like this:

Code:

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:

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:
//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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Oct 25, 2011 11:14 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
blkraven1
Member


Joined: 24 Oct 2011
Posts: 5
Location: Annapolis

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Oct 31, 2011 5:58 pm    Post subject: Syncsort for Z/OS 1.3.2.2R Question Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Oct 31, 2011 9:56 pm    Post subject: Reply with quote

Quote:

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
academyindia4
Guest





Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jan 25, 2016 9:56 pm    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-6090.html