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 to create control card using flag from i/p file

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

New User


Joined: 11 Aug 2005
Posts: 85
Location: England

PostPosted: Wed Aug 29, 2007 5:58 pm    Post subject: Need to create control card using flag from i/p file
Reply with quote

Hi,

I want to create two separate control cards using a flag(6th position) in the Input File using DFSORT/ICETOOL. Is this possible?

Sample Input Data:
---------------------
00020L
00020R

Requirement:
--------------
IF the flag = 'L' THEN output control card should look like

LOAD DATA
RESUME YES
INTO TABLE
PART
00020(this is the 1st 5 bytes from the input file)
TABLE STRUCTURE

IF the flag = 'R' THEN output control card should look like

LOAD DATA
RESUME YES
INTO TABLE
PART
00020(this is the 1st 5 bytes from the input file)
REPLACE
TABLE STRUCTURE

Please let me know if this can be done.

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

shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed Aug 29, 2007 6:25 pm    Post subject:
Reply with quote

Code:
// EXEC PGM=SORT                                 
//SORTIN DD *                                     
00020L                                           
00020R                                           
/*                                               
//SORTOUT DD SYSOUT=*                             
//SYSOUT DD SYSOUT=*                             
//SYSIN DD *                                     
 OPTION COPY                                     
 OUTFIL IFOUTLEN=80,                             
        IFTHEN=(WHEN=(6,1,CH,EQ,C'L'),           
              BUILD=(C'LOAD DATA',/,             
                     C'RESUME YES',/,             
                     C'INTO TABLE',/,             
                     C'PART',/,                   
                     1,5,/,                       
                     C'TABLE STRUCTURE')),       
       IFTHEN=(WHEN=(6,1,CH,EQ,C'R'),             
              BUILD=(C'LOAD DATA',/,             
                     C'RESUME YES',/,         
                     C'INTO TABLE',/,         
                     C'PART',/,               
                     1,5,/,                   
                     C'REPLACE',/,             
                     C'TABLE STRUCTURE'))     
/*                                             
//

Output:
Code:
LOAD DATA       
RESUME YES     
INTO TABLE     
PART           
00020           
TABLE STRUCTURE
LOAD DATA       
RESUME YES     
INTO TABLE     
PART           
00020           
REPLACE         
TABLE STRUCTURE
Back to top
View user's profile Send private message
leo_sangha

New User


Joined: 11 Aug 2005
Posts: 85
Location: England

PostPosted: Wed Aug 29, 2007 10:36 pm    Post subject: Reply to: Need to create control card using flag from i/p fi
Reply with quote

Thanks Shankar,

i can try this 2mrw, just one question .. i hope i can give input file also where you have specified the input data DD statement SORTIN

// EXEC PGM=SORT
//SORTIN DD *
00020L
00020R
/*

//SORTIN DD DSN=INPUT.FILE,DISP=SHR


Regards
Manpreet
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Wed Aug 29, 2007 11:39 pm    Post subject:
Reply with quote

Hello,

Yes, you can use a file as input.
Back to top
View user's profile Send private message
leo_sangha

New User


Joined: 11 Aug 2005
Posts: 85
Location: England

PostPosted: Thu Aug 30, 2007 10:20 am    Post subject: Reply to: Need to create control card using flag from i/p fi
Reply with quote

Thanks Shankar & Dick Scherrer,

Sort is working fine. Appreciate all your help.

Thanks & Regards
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