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
 

 

Extract header record from file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Richa Jain

New User


Joined: 18 Mar 2008
Posts: 35
Location: Gurgaon

PostPosted: Fri Oct 10, 2008 7:32 pm    Post subject: Extract header record from file
Reply with quote

Input file contain a header record and detail records. eg.

ABCDEF66GHI GHG 12345
ABCDEF66GHI GHG 12345 GHDG HTYEUIYR UREIOWOE ETWYTWE
AGDJULL77GH TYU 12345 HJFHJ BHDSJHDF FJDSJFKLS FHSDFDSD
FSGAHJK77JKI GJJ 12345 JUJLL LLKLGYUU IOUJKLJLL KLLKLFGJGJ
FGSFASK66JSK GJH 12345 HJKH HLJJKLJKL JLJLKLKLJHHJ UYTUYTUYT

I want to create two files. One file contains records which has '66' at position 7-8 in one file and another file should contain records which has '77' at position 7-8.

Also I need a header record in both the files.

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

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Fri Oct 10, 2008 7:38 pm    Post subject:
Reply with quote

Quote:
Also I need a header record in both the files


How does your header record look like? Are they same for both the output files? Also can you post the sort product info and file attibutes.
Back to top
View user's profile Send private message
ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Sun Oct 12, 2008 11:16 pm    Post subject:
Reply with quote

Hi,

Assuming your File length is 80 and the First Record is a Header Record. The output file DD Names are File1 and File 2.
Please try with the below card
Code:

INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD),HIT=NEXT),
      IFTHEN=((WHEN=81:8,ZD,EQ,1),
      OVERLAY=89:C'HHHHH'),HIT=NEXT),
      IFTHEN=((WHEN=81:8,ZD,GT,1),
      OVERLAY=89:C'RRRRR'))
SORT FIELDS=COPY
OUTFIL FNAMES=FILE1,
      INCLUDE=((81,8,ZD,EQ,1,AND,89,5,CH,EQ,C'HHHHH'),OR,
        (7,2,CH,EQ,C'66' AND,89,5,CH,EQ,C'RRRRR'))
OUTFIL FNAMES=FILE2,
      INCLUDE=((81,8,ZD,EQ,1,AND,89,5,CH,EQ,C'HHHHH'),OR,
        (7,2,CH,EQ,C'77' AND,89,5,CH,EQ,C'RRRRR'))
OUTREC BUILD=(1,80)
Back to top
View user's profile Send private message
ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Mon Oct 13, 2008 10:53 pm    Post subject:
Reply with quote

Please try the below card.
Code:

INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD))
SORT FIELDS=COPY
OUTFIL FNAMES=FILE1,INCLUDE =((81,8,ZD,EQ,1,OR,7,2,CH,EQ,C'66')
OUTFIL FNAMES=FILE2,INCLUDE =((81,8,ZD,EQ,1,OR,7,2,CH,EQ,C'77')
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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