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

Random or a sequential read of a VSAM file can we do


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vijaycics

New User


Joined: 01 Jul 2005
Posts: 1

PostPosted: Fri Jul 01, 2005 9:37 am
Reply with quote

Hi People,

I have a question from my end. When we do a random or a sequential read of a VSAM file can we do like this.

Let me say file that i want to read are 'ABCD' and 'EFGH'.

IF condition one applies then I read 'ABCD' by moving the key to the key field of the file 'ABCD' else i read 'EFGH. So my code will be

Move key to gen-KEY
IF condition 1
Move 'ABCD' to ws-file-name
Else
Move 'EFGH' to ws-file-name
END-IF

EXEC CICS READ
DATASET(ws-file-name)
INTO (file-REC)
RIDFLD(gen-key)
LENGTH(WS-length)
RESP(WS-RESPONSE)
END-EXEC

Will this work?
Back to top
View user's profile Send private message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Sun Jul 03, 2005 2:57 am
Reply with quote

ws-file-name Must not be a variable. You must use a literal in DATASET / FILE field.
Back to top
View user's profile Send private message
sivamf

New User


Joined: 28 May 2005
Posts: 6

PostPosted: Mon Aug 01, 2005 1:23 am
Reply with quote

You have to Code two read comands with dataset names hardcoded

if true

read dataset"abcd"

else

read dataset "efgh"

end-if.
(put it in right syntax)
Back to top
View user's profile Send private message
sivamf

New User


Joined: 28 May 2005
Posts: 6

PostPosted: Mon Aug 01, 2005 1:24 am
Reply with quote

You have to code two read commands with two dataset names hard coded
Back to top
View user's profile Send private message
batu544

New User


Joined: 21 Jul 2005
Posts: 17
Location: bangalore

PostPosted: Mon Aug 01, 2005 5:37 pm
Reply with quote

hi vijaycics,
U r right. U can code in that way . there is nothing wrong in ur coding style.
Back to top
View user's profile Send private message
batu544

New User


Joined: 21 Jul 2005
Posts: 17
Location: bangalore

PostPosted: Mon Aug 01, 2005 5:38 pm
Reply with quote

hi vijaycics,
U r right. U can code in that way . there is nothing wrong in ur coding style.
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top