Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Extracting only header and trailer from a PS file

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

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Wed Aug 26, 2009 9:37 am    Post subject: Extracting only header and trailer from a PS file
Reply with quote

I got a requirement to extract only header n trailer from a PS file and write them into a seperate file.

Can anyone help me with a JCL using Sort commands.
Back to top
View user's profile Send private message

Escapa

Senior Member


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

PostPosted: Wed Aug 26, 2009 9:50 am    Post subject:
Reply with quote

How to identify the record is header or trailer?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Aug 26, 2009 10:00 am    Post subject:
Reply with quote

Hi,

try this
Code:
//**********************************************************************
//*        SELECTS HEADER AND TRAILER RECORD                           
//*        IE. 1ST AND LAST RECORD                                     
//**********************************************************************
//S1       EXEC  PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=input file                                           
//SORTOUT  DD DSN=output file                                           
//SYSIN    DD *                                                         
  OPTION COPY                                                           
  OUTFIL REMOVECC,NODETAIL,                                             
    HEADER1=(1,80),                                                     
    TRAILER1=(1,80)                                                     


Gerry
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Wed Aug 26, 2009 10:06 am    Post subject:
Reply with quote

Or even
Code:

//S1    EXEC  PGM=ICETOOL                         
//SYSOUT    DD  SYSOUT=*                         
//DFSMSG    DD  SYSOUT=*                         
//TOOLMSG   DD  SYSOUT=*                         
//IN DD input dataset
//OUT DD output dataset
//TOOLIN   DD    *                               
  SUBSET FROM(IN) TO(OUT) KEEP INPUT FIRST LAST   
/*                                               
Back to top
View user's profile Send private message
Binaya

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Wed Aug 26, 2009 11:08 am    Post subject: Thanks Sambhaji and Gerry for ur reply.
Reply with quote

Its working fine.

Thnks
Back to top
View user's profile Send private message
Binaya

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Wed Aug 26, 2009 11:09 am    Post subject:
Reply with quote

Sambhaji N gerry. I need some more from u people.


I got a requirement to extract only header n trailer from a PS file and write them into a seperate file and I need a count(no of records) as well in another file.

Can anyone help me with a JCL using Sort commands.
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Wed Aug 26, 2009 12:32 pm    Post subject:
Reply with quote

Code:

//S1    EXEC  PGM=ICETOOL                         
//SYSOUT    DD  SYSOUT=*                         
//DFSMSG    DD  SYSOUT=*                         
//TOOLMSG   DD  SYSOUT=*                         
//IN DD input dataset
//OUT DD output dataset1
//OUT1 DD output dataset2
//TOOLIN   DD    *                               
  SUBSET FROM(IN) TO(OUT) KEEP INPUT FIRST LAST   
  COUNT FROM(IN) WRITE(OUT1)     
/*
Back to top
View user's profile Send private message
Binaya

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Thu Aug 27, 2009 2:39 pm    Post subject:
Reply with quote

Hi Guys

Thnks for the reply.

SUBSET Keyword is not working in my Mainframe as it has older version of ICETOOL.

Can you suggest me a JCL using DFSORT for extracting Header n trailer regardless of the input file length.

The subject posted by GERRY is working fine but I can process input file with 80 bytes long only which is specific.
FOR EXAMPLE:
In the Cycle 1 execution I may get a 80 bytes long file but cycle2 execution I may get a 160 bytes file. So I need a JCL which can extract Header N trailer from the Input file regardless of its length using DFSORT only.

Thnks in advance.
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Thu Aug 27, 2009 3:18 pm    Post subject:
Reply with quote

Hi, In above job, by mistake I pasted wrong code..
correct one is
Code:

//S1    EXEC  PGM=ICETOOL                                             
//SYSOUT    DD  SYSOUT=*                                               
//DFSMSG    DD  SYSOUT=*                                               
//TOOLMSG   DD  SYSOUT=*                                               
//IN DD DSN=input dataset with 211 lrecl
//OUT   DD DSN=output dataset with 4096 lrecl
//TOOLIN   DD    *                                             
  SUBSET FROM(IN) TO(OUT) KEEP INPUT FIRST LAST USING(CTL1)     
/*                                                             
//CTL1CNTL DD *                                                 
  INREC OVERLAY=(1,211,4096:X)                                 
/*           
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Thu Aug 27, 2009 5:42 pm    Post subject:
Reply with quote

If SUBSET is not working at your shop use below
Code:

//S1       EXEC  PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=input file                                           
//SORTOUT  DD DSN=output file                                           
//SYSIN    DD *                           
  OPTION COPY                             
  INREC OVERLAY=(1,211,4096:X)             
  OUTFIL REMOVECC,NODETAIL,               
  HEADER1=(1,211),                         
  TRAILER1=(1,211)                         
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us