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

Overlay the different record using sort card


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 49
Location: United States

PostPosted: Mon Jul 13, 2009 9:48 pm
Reply with quote

Hi,

Can we overlay in the different record using sort card? For example my file contains the data as below

=COLS> ----+----1----+----2----+----3----+----4----+----5
****** ***************************** Top of Data ********
000001 1
000002
000003
000004
000005
000006
000007
000008
000009
000010 123456789101

If the 000001 record has '1 ' I would like to add 'REPORT' in the 000009 record like below
=COLS> ----+----1----+----2----+----3----+----4----+----5
****** ***************************** Top of Data ********
000001 1
000002
000003
000004
000005
000006
000007
000008
000009 REPORT
000010 123456789101

Thanks
Venkat
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Mon Jul 13, 2009 10:05 pm
Reply with quote

Hi, Venkata

Can u please explain your requirement in detail.

Suppose my i/p is
000001 1
000002
000003 1
000004
000005
000006 1
000007
000008
000009
000010 123456789101

What is the expected output?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jul 13, 2009 10:07 pm
Reply with quote

Venkata Ramayya,

The following DFSORT JCL will give you the desired results. I assumed that your input is FB recfm and lrecl of 80 bytes


Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                     
000001 1                                                             
000002                                                               
000003                                                               
000004                                                               
000005                                                               
000006                                                               
000007                                                               
000008                                                               
000009                                                               
000010 123456789101                                                 
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                   
  INREC IFOUTLEN=80,                                                 
  IFTHEN=(WHEN=GROUP,BEGIN=(1,6,ZD,EQ,1,AND,8,1,ZD,EQ,1),           
  PUSH=(81:8,1),RECORDS=9),                                         
  IFTHEN=(WHEN=(1,6,ZD,EQ,9,AND,81,1,ZD,EQ,1),OVERLAY=(8:C'REPORT'))
/*
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Mon Jul 13, 2009 10:15 pm
Reply with quote

Hi, Kolusu

I don't think this is the geralised way. What if I have more then 10 records.
This will work only for the example mentioned.

Please let me know if I am wrong.

Thanks And Regards
Rahul Gupta
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jul 13, 2009 10:25 pm
Reply with quote

rgupta71 wrote:
Hi, Kolusu

I don't think this is the geralised way. What if I have more then 10 records. This will work only for the example mentioned.

Please let me know if I am wrong.


Thanks And Regards
Rahul Gupta


Rahul gupta,

ofcourse you are wrong. My Job will work irrespective of the number of records in the file. Please don't assume when you can't test the solutions posted here.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Jul 13, 2009 10:28 pm
Reply with quote

Quote:
I don't think this is the geralised way. What if I have more then 10 records.


the requirement was...
if the first record contains a "1"
then overlay the 9th record with the string "report"

and the solution satisfied it

if the requirement was to overlay the record before the last one ( regardless of the number of records )
the TS should have asked in a different way
Back to top
View user's profile Send private message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 49
Location: United States

PostPosted: Tue Jul 14, 2009 12:04 am
Reply with quote

Thanks for the reply.

I would like to understand this

IFTHEN=(WHEN=GROUP,BEGIN=(1,6,ZD,EQ,1,AND,8,1,ZD,EQ,1),

Skolusu, can you please explain me?

I assume you understand that 000001,000002...000009 are record number when the file is in view mode. Actual record starts from '1'

'1 ' indicates the begining of the record and 8th record should have text 'REPORT'.

Please let me know if I confuse.

Thanks
Venkat
Back to top
View user's profile Send private message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 49
Location: United States

PostPosted: Tue Jul 14, 2009 7:10 pm
Reply with quote

Can any one respond to this?

I would like to understand this statement -

IFTHEN=(WHEN=GROUP,BEGIN=(1,6,ZD,EQ,1,AND,8,1,ZD,EQ,1),
PUSH=(81:8,1),RECORDS=9),

I am having issues when I customize this for my requirement.

Please help me.

Thanks
Venkat
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Jul 14, 2009 8:33 pm
Reply with quote

venkat ramayya,

*sigh*. why do you want to paste line numbers as part of input data? I am not even sure as to what the requirement is. I don't want to guess.

For explanation of the GROUP statement check the User Guide for DFSORT PTF UK90013

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jul 14, 2009 8:43 pm
Reply with quote

Venkat,

If you want help with this, show a good example of your input records and what you expect for output. If you have more than one group of records that start with '1' and need 'REPORT', show that in your example. If you have only one group, say so. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of each relevant field.
Back to top
View user's profile Send private message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 49
Location: United States

PostPosted: Tue Jul 14, 2009 9:16 pm
Reply with quote

Hi Frank,

Attached file has the input and output format. The Lrecl of input and output files are 133 FBA.

Please let me know if you have any questions.

Thanks
Venkat
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Jul 14, 2009 9:20 pm
Reply with quote

Venkata Ramayya,

Did you even bother to read frank's post? Answer all the questions of frank.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jul 14, 2009 9:23 pm
Reply with quote

That input and output shows ONE group of records. Is that all you have?

The "rules" you gave are "If the 000001 record has '1 ' I would like to add 'REPORT' in the 000009 record". What do you want to do if the 000001 record does not have '1'? Can any other record have '1'? Would that affect the expected output at all?
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Tue Jul 14, 2009 9:30 pm
Reply with quote

Quote:
*sigh*. why do you want to paste line numbers as part of input data? I am not even sure as to what the requirement is. I don't want to guess.

Venkata Ramayya did not paste line numbers as part of input data. Look at the original post again. It looks like a standard copy and paste from ISPF Edit. Cols was even used. It would have helped if code tags were used. We just did not carefully read what was posted. Any additional requirements would be helpful.
Back to top
View user's profile Send private message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 49
Location: United States

PostPosted: Tue Jul 14, 2009 9:41 pm
Reply with quote

The '1' indicates the begining of the each record. The every 8th record after 1(ie, 9th record including 1st record) should have 'Report' from 11th column. Let me know still you have any questions.

Thanks
Venkat
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Jul 14, 2009 9:52 pm
Reply with quote

venkat ramayya,

Use the following DFSORT job

Code:

//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                   
  INREC IFOUTLEN=133,                                               
  IFTHEN=(WHEN=GROUP,BEGIN=(1,1,ZD,EQ,1),PUSH=(134:SEQ=8),RECORDS=9),
  IFTHEN=(WHEN=(134,8,ZD,EQ,9),OVERLAY=(11:C'REPORT'))               
/*                                                                   
Back to top
View user's profile Send private message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 49
Location: United States

PostPosted: Tue Jul 14, 2009 11:07 pm
Reply with quote

Kolusu,

I am getting syntax error

SYSIN :
SORT FIELDS=COPY
INREC IFOUTLEN=133,
IFTHEN=(WHEN=GROUP,BEGIN=(1,1,ZD,EQ,1),PUSH=(134:SEQ=8),RECORDS=9),
*
IFTHEN=(WHEN=(134,8,ZD,EQ,9),OVERLAY=(11:C'REPORT'))
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
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jul 14, 2009 11:20 pm
Reply with quote

Kolusu's job works fine with DFSORT. The WER messages indicate you're using Syncsort, not DFSORT.

Why did you post in the DFSORT Forum when you're using Syncsort? You should have posted in the JCL Forum.

Kolusu and I are DFSORT developers. DFSORT and Syncsort are competitive products. We're happy to answer questions on DFSORT and DFSORT's ICETOOL, but we don't answer questions on Syncsort.
Back to top
View user's profile Send private message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 49
Location: United States

PostPosted: Tue Jul 14, 2009 11:30 pm
Reply with quote

I appologize for it. Recently the product got changed from DF to SYNC in our work palce. I did not think about that and posted. Sorry again.

Thanks for your responses.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top