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
 

 

Need Formating an Input File

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Wed May 04, 2011 12:51 pm    Post subject: Need Formating an Input File
Reply with quote

Hi All,

Could you please help me in formatting an input file like below,

I/P - Lrecl = 80, FB

Code:


----+----1----+----2----+----3----+----4----+----5----+----6----+----7----
213129999999991234567890123456719AKEY000019901052$1001ABCDE                 
999addafgd Michele gdhg jg jmg khgm99999923456789012345678   KEY000029900052
9999999asdasd994567890123456789018SKEY000049903052$1283ASAAS$1231GSHSA$9362JSSDS
999999999567asfasff890123456789011DSKEY000059902052$9312FDSFD$4321DXVDA       
123456 SAMPLECODE ashje ej
213123     adsf akdja akd kad asdaj
123123     asdwer ergtr hrht
212312 Program1
      *-------------
a2sfev     sdfsgf sfs sgdsg sff
312344     MICHELE 1nsj34h4jh3jh3j
212312 Program2
a2sfev     sdfsgf sfs sgdsg sff
312344     asdas wien qw9iwq33 93nnsjmhb3hb
adasds program3
223awd     nnsaffbmam j ma m amn
ad2445     adn b bj3b hw h
242453               Michele 123456577
121344       Michele 323242424
139329          MICHELE 09249jvj9u3j
adasds program-MICHELE
223awd     nnsaffbmam j ma m amn
ad2445     adn b bj3b hw h


Condition to format the file:
1) Skip the lines until we find the word " SAMPLECODE" starting from 7th character.
2) Search for the word "MICHELE" till end of the file where the 7th character on the line should be Space and should be the first word after 8th position.
3) In the input file the word MICHELE can have in caps or small letter.

The output file is of FB and LRECL = 80.

Here the output we require should populate the line having "MICHELE", when the 7th pos is Space and will be the first in the line after 8th position.

Prior to populating the line MICHELE, It should populate the line where 7th position is SPACE and the 8th position is not equal to SPACE.
And the formating needs to be done as per below sample code,

Code:


----+----1----+----2----+----3----+----4----+----5----+----6----+----7----
Program1
   MICHELE 1nsj34h4jh3jh3j
program3
   Michele 123456577
   Michele 323242424
   MICHELE 09249jvj9u3j
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed May 04, 2011 7:23 pm    Post subject:
Reply with quote

Ok.. but output is having Program1 AND program3? What is the logic for that?

What is the sort product you are using? if it is DFSORT, what is the PTF level?
Refer http://ibmmainframes.com/viewtopic.php?t=33389 For finding PTF
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Wed May 04, 2011 7:50 pm    Post subject:
Reply with quote

Hi Sambhahi,

Thanks for ur reply.

The output is having Program1 and program3

Logic:

Along with the line Michele, It should populate the prior line where the 7th character is Space and 8th character is not equal to Space.

As per my input the word Michele is present only under Program1 and program3. Hence both the lines are getiing populated.


I am using Z/OS DFSORT V1R12 and having ICE201I H ptf level.
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Wed May 04, 2011 8:32 pm    Post subject:
Reply with quote

Just to add, the word SAMPLECODE can have only once in the input file.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed May 04, 2011 9:06 pm    Post subject: Reply to: Need Formating an Input File
Reply with quote

Niki,

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

Code:

//STEP0100 EXEC PGM=SORT 
//SYSOUT   DD SYSOUT=*   
//SORTIN   DD DSN=Your input file,DISP=SHR                         
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                                 
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(8,1,SS,NE,C' ,-'),PUSH=(81:8,8))
                                                                   
  OUTFIL INCLUDE=(7,2,CH,EQ,C' ',AND,8,72,SS,EQ,C'MICHELE'),       
  BUILD=(7:7,73,JFY=(SHIFT=LEFT),80:X),REMOVECC,                   
  SECTIONS=(81,8,HEADER3=(81,8))                                   
//*
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Thu May 05, 2011 12:14 pm    Post subject:
Reply with quote

Hi Kolusu,

Thanks for your help.
Back to top
View user's profile Send private message
Goyal

New User


Joined: 16 Mar 2011
Posts: 2
Location: India

PostPosted: Fri May 06, 2011 3:40 pm    Post subject:
Reply with quote

Can same results be derived from "PARSE" option in DFSORT icon_question.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Fri May 06, 2011 4:17 pm    Post subject:
Reply with quote

Goyal - why don't you try and see what the result is?
Back to top
View user's profile Send private message
Goyal

New User


Joined: 16 Mar 2011
Posts: 2
Location: India

PostPosted: Fri May 06, 2011 4:29 pm    Post subject:
Reply with quote

Hmmmm... icon_wink.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri May 06, 2011 9:27 pm    Post subject:
Reply with quote

Goyal wrote:
Can same results be derived from "PARSE" option in DFSORT icon_question.gif


Goyal,

I would love to see a PARSE solution for this requirement especially when you need the program name from a different record.

Can you enlighten us with your solution?
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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