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

Copy content to new location.


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

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Jul 13, 2012 5:06 pm
Reply with quote

Hi,

File - RECFM=FB, LRECL=90

Input:
Code:

----+----1----+----2----+----3----+----4
XXXXX1.ICCP.SCLB3H.INL
ICCP.SCLB3H.INL.XXXXX1
ICCP.SCLB3H.INL.CXXXX1
ICCP.SCLB3H.XXXXX1.INL
ICCP.SCLB3H.BXXXX1.INL
ICCP.PXXXX1.SCLB3H.INL


I want the "XXXXX1" to be copied to 30th column from above input.

Expected Output:
Code:

----+----1----+----2----+----3----+----4
XXXXX1.ICCP.SCLB3H.INL       XXXXX1
ICCP.SCLB3H.INL.XXXXX1       XXXXX1
ICCP.SCLB3H.INL.CXXXX1       CXXXX1
ICCP.SCLB3H.XXXXX1.INL       XXXXX1
ICCP.SCLB3H.BXXXX1.INL       BXXXX1
ICCP.PXXXX1.SCLB3H.INL       PXXXX1


Please help.

Thanks.
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Fri Jul 13, 2012 5:23 pm
Reply with quote

Code:
----+----1----+----2----+----3----+----4
XXXXX1.ICCP.SCLB3H.INL
ICCP.SCLB3H.INL.XXXXX1
ICCP.SCLB3H.INL.CXXXX1
ICCP.SCLB3H.XXXXX1.INL
ICCP.SCLB3H.BXXXX1.INL
ICCP.PXXXX1.SCLB3H.INL
1. Is this all you have in your file? or such GROUP records can recur?
2. Is XXXXX1 fixed at its position?
3. IF 1=YES AND 2=YES, use WHEN=GROUP. Its easy brother... try it.. you can do it...
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jul 13, 2012 5:25 pm
Reply with quote

You need to explain the rules of getting from input to output a little better since the character in position 30 seems to vary.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Jul 13, 2012 5:28 pm
Reply with quote

The rule is to copy the word having XXX to 30th position irrespective of its position in input.

Thanks.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jul 13, 2012 5:37 pm
Reply with quote

ramsri wrote:
The rule is to copy the word having XXX to 30th position irrespective of its position in input.

Thanks.


That is very different than your original post.
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Fri Jul 13, 2012 6:43 pm
Reply with quote

ramsri wrote:
The rule is to copy the word having XXX to 30th position irrespective of its position in input.

Thanks.


What?

ramsri,

1. You have not answered my questions.
2. Now you come back changing your requirements.
3. You look quite experienced too (personal assumption).
4. Please explain clearly what you want.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 13, 2012 6:45 pm
Reply with quote

Hello,

You need to start over and post what is really wanted. Your posts are rather inconsistent and do not explaikn what you are trying to accomplish.

You show a "rule" that has 5 Xs, data that has 4 and 5 Xs, data that has some Xs as well as some leading character, and finish with:
Quote:
The rule is to copy the word having XXX to 30th position
having only 3 Xs and no mention of how these other characters are supposed to be handled.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Jul 13, 2012 7:09 pm
Reply with quote

by the time I realized that I wanted add more info to it the EDIT did not allow me because 10 mintues were over..... The word containing XXXX from each input record should be moved to 30th column is what the SORT should achieve. That is a total of 6 characters including the numeral at the last should be moved to new position. That is why I used

Quote:

word having XXX


Input Data - LRECL=90, RECFM=FB
Code:

----+----1----+----2----+----3----+----4
XXXXX1.ICCP.SCLB3H.INL
ICCP.SCLB3H.INL.XXXXX1
ICCP.SCLB3H.INL.CXXXX1
ICCP.SCLB3H.XXXXX1.INL
ICCP.SCLB3H.BXXXX1.INL
ICCP.PXXXX1.SCLB3H.INL


If each record split into 4 parts, on part definitely contains a word with XXXX appearing in it. I am using only 4X here because the first and last character are changing.

Output:
Code:

----+----1----+----2----+----3----+----4
XXXXX1.ICCP.SCLB3H.INL       XXXXX1
ICCP.SCLB3H.INL.XXXXX1       XXXXX1
ICCP.SCLB3H.INL.CXXXX1       CXXXX1
ICCP.SCLB3H.XXXXX1.INL       XXXXX1
ICCP.SCLB3H.BXXXX1.INL       BXXXX1
ICCP.PXXXX1.SCLB3H.INL       PXXXX1


I tried below code but it does not give me expected results except first record
Code:

SORT FIELDS=COPY                                           
INREC IFTHEN=(WHEN=(1,80,SS,EQ,C'XXXX'),OVERLAY=(30:1,6)) 


Wrong Output:
Code:

XXXXX1.ICCP.SCLB3H.INL       XXXXX1
ICCP.SCLB3H.INL.XXXXX1       ICCP.S
ICCP.SCLB3H.INL.CXXXX1       ICCP.S
ICCP.SCLB3H.XXXXX1.INL       ICCP.S
ICCP.SCLB3H.BXXXX1.INL       ICCP.S
ICCP.PXXXX1.SCLB3H.INL       ICCP.P


I hope that I've explained it better ths time icon_smile.gif

Thanks.
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Fri Jul 13, 2012 7:19 pm
Reply with quote

By the way you got the right output (pun intended).

Anyway, assuming that you have such an input, suggest that you PARSE into 4 fields and then search in each of the PARSED field and then OVERLAY accordingly.

Hope this helps.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 13, 2012 7:46 pm
Reply with quote

Hello,

Quote:
I hope that I've explained it better ths time
Yup icon_smile.gif

Quote:
I tried below code but it does not give me expected results except first record
Code:
INREC IFTHEN=(WHEN=(1,80,SS,EQ,C'XXXX'),OVERLAY=(30:1,6))
Because you told the sort to use positions 1-6 no matter where the Xs were found. . .
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jul 13, 2012 8:04 pm
Reply with quote

Does your value always end with XXXX1?

To put it another way, can you describe the required field accurately. Is the file FB? Length>?
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Jul 13, 2012 8:29 pm
Reply with quote

Bill, its LRECL=90, RECFM=FB.

Its a 6 character field that will have XXXX appearing in the middle. This fields first position may have different alphabet and last position will always be a numeral.

Thanks.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jul 13, 2012 9:17 pm
Reply with quote

Four PARSEd fields, as Naish said, OVERLAY at the end of the existing record. Test the "middle" of each field for "XXXX". Personally, I'd validate the first and last bytes as well, unless feeling 100% secure about the possibility of not getting a false hitt. I wouldn't use SS looking for s substring.

Plonk the one that matches XXXX (if any) into the correct position on the record.

Assuming that this is connected to your other recent ones, are you going to be looking for multiple values?
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Jul 13, 2012 10:16 pm
Reply with quote

ramsri,

Use the following DFSORT JCL which will give you the desired results
Code:

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                   
XXXXX1.ICCP.SCLB3H.INL                                           
ICCP.SCLB3H.INL.XXXXX1                                           
ICCP.SCLB3H.INL.CXXXX1                                           
ICCP.SCLB3H.XXXXX1.INL                                           
ICCP.SCLB3H.BXXXX1.INL                                           
ICCP.PXXXX1.SCLB3H.INL                                           
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                               
  INREC IFOUTLEN=90,IFTHEN=(WHEN=INIT,                           
  PARSE=(%01=(STARTAFT=C'XXX',FIXLEN=3),%02=(SUBPOS=7,FIXLEN=6)),
  OVERLAY=(91:%01,X,%02)),                                       
  IFTHEN=(WHEN=(95,1,SS,EQ,C'. '),OVERLAY=(30:98,3,91,3)),       
  IFTHEN=(WHEN=NONE,OVERLAY=(30:95,6))                           
//*
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Jul 14, 2012 6:23 am
Reply with quote

ramsri,

Are you "piecing together" a solution with lthe ittle bits of code supplied to you?

If yes, please instead post the full requirement. There is a chance that people are wasting time with your "movable feast" descriptions.

Is X the letter X, or does it stand for "any letter of the alphabet in any position"? Will you be looking for more than one set of characters? What are you doing with the data once it is in position 30? What topics are you thinking of starting next?
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Mon Jul 23, 2012 8:28 pm
Reply with quote

Hi Kolusu, thanks a lot.......I got the results.

Bill, I won't extend this topic anymore icon_smile.gif
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jul 24, 2012 4:33 am
Reply with quote

Good for you, Ramsri. Thanks for the feedback.
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 Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top